def test_check_vlan_id_validation(self): PoteenLogger.add_test_case("Check VlanID field validation") cluster_key = "cluster" logger.info(Main().navigate()) logger.info(Cluster_BrowseView().remove_all()) # create cluster logger.info(Cluster_BrowseView().click_add_new_cluster(cluster_key)) logger.info(CreateEnvironmentDialog().create_environment({ "name": "Test environment", "version": OPENSTACK_CURRENT_VERSION, "deployment_mode": Cluster.DEPLOYMENT_MODE_MULTI_NODE })) logger.info(Cluster_BrowseView().select_by_key(cluster_key)) logger.info(Cluster_View().click_network_settings_tab()) logger.info(NetworkSettingsView().set_VLAN_manager("on")) logger.info(NetworkSettingsView().verify_error_amount( "10", True, "250", "259")) vlan_id_range_start_array = [("0", False), ("4095", False), ("-100", False), ("5000", False), ("1", True), ("4094", True), ("2000", True)] for vlan_id_range_start, valid in vlan_id_range_start_array: logger.info(NetworkSettingsView().verify_vlan_id_range_start( vlan_id_range_start, valid))
def test_show_logs(self): PoteenLogger.add_test_case("Test show logs") cluster_key = "cluster" cluster_name = "Test environment" logger.info(Main().navigate()) logger.info(Cluster_BrowseView().remove_all()) # create cluster logger.info(Cluster_BrowseView().click_add_new_cluster(cluster_key)) logger.info(CreateEnvironmentDialog().create_environment({ "name": "Test environment", "version": OPENSTACK_CURRENT_VERSION, "deployment_mode": Cluster.DEPLOYMENT_MODE_MULTI_NODE })) logger.info(Cluster_BrowseView().select_by_key(cluster_key)) logger.info(Cluster_View().click_logs_tab()) logger.info(Cluster_Logs_View().set_log_filter(log="Admin node", source="REST API", level="DEBUG")) logger.info(Cluster_Logs_View().show_button.click()) logger.info(WaitBot().wait_loading()) logger.info(Cluster_Logs_View().table_logs.verify_visible(True))
def test_verify_start_ip(self): PoteenLogger.add_test_case("Check CIDR field validation") cluster_key = "cluster" logger.info(Main().navigate()) logger.info(Cluster_BrowseView().remove_all()) # create cluster logger.info(Cluster_BrowseView().click_add_new_cluster(cluster_key)) logger.info(CreateEnvironmentDialog().create_environment({ "name": "Test environment", "version": OPENSTACK_CURRENT_VERSION, "deployment_mode": Cluster.DEPLOYMENT_MODE_MULTI_NODE })) logger.info(Cluster_BrowseView().select_by_key(cluster_key)) logger.info(Cluster_View().click_network_settings_tab()) cidr_vm_networks = [(" ", False), ("0.10.-1.255/15", False), ("0.-100.240.255/15 ", False), ("0.256.240.255/15", False), ("0.750.240.255/15", False), ("0.01.240.255/15", False), ("0.000.240.255/15", False), ("0.50.240.255.45/15", False), ("0.240.255/15 ", False), ("0.1000.240.255/15", False), ("0..240.255/15", False), ("0.10.100.255/15", True)] for cidr_vm_network, valid in cidr_vm_networks: logger.info(NetworkSettingsView().verify_cidr_vm_networks( cidr_vm_network, valid))
def test_addition_node_compute_role(self): PoteenLogger.add_test_case( "Testing node addition to compute role") cluster_key = "cluster" cluster_name = "Test environment" logger.info(Main().navigate()) logger.info(Cluster_BrowseView().remove_all()) logger.info(Cluster_BrowseView().click_add_new_cluster(cluster_key)) logger.info(CreateEnvironmentDialog().create_environment( { "name": "Test environment", "version": OPENSTACK_CURRENT_VERSION, "deployment_mode": Cluster.DEPLOYMENT_MODE_MULTI_NODE } )) logger.info(Cluster_BrowseView().select_by_key(cluster_key)) logger.info(Cluster_Nodes_View().click_add_nodes()) available_nodes_names = Cluster_Nodes_ListView()\ .get_nodes_names_by_status('Discovered') logger.info(Cluster_Nodes_View().assign_roles_to_nodes( ['compute'], available_nodes_names[:1] )) logger.info(Cluster_Nodes_View().verify_amount('compute', 1))
def test_deploy_no_ha_1_compute(self): PoteenLogger.add_test_case( "Deploy without HA mode 1 compute") cluster_key = "cluster" logger.info(Main().navigate()) logger.info(Cluster_BrowseView().remove_all()) # create cluster logger.info(Cluster_BrowseView().click_add_new_cluster(cluster_key)) logger.info(CreateEnvironmentDialog().create_environment( { "name": "Test environment", "version": OPENSTACK_CURRENT_VERSION, "deployment_mode": Cluster.DEPLOYMENT_MODE_MULTI_NODE } )) logger.info(Cluster_BrowseView().select_by_key(cluster_key)) logger.info(Cluster_Nodes_View().click_add_nodes()) logger.info(Cluster_Nodes_View().assign_roles_to_nodes( ['compute'], ["Dell Inspiron"] )) logger.info(Cluster_Nodes_View().verify_nodes( 'compute', ["Dell Inspiron"] )) logger.info(Cluster_View().click_deploy_changes()) logger.info(VerifyBot().verify_contains( 'disabled', DeployChangesDialog().deploy_button().get_element() .get_attribute('class'), 'Deploy button')) logger.info(VerifyBot().verify_visibility( DeployChangesDialog().alert_message.get_element(), True, "Alert error message"))
def test_form(self): PoteenLogger.add_test_case("Check environment creation page with RHOS") logger.info(Main().navigate()) logger.info(Cluster_BrowseView().remove_all()) # create cluster logger.info(Cluster_BrowseView().click_add_new_cluster()) logger.info(CreateEnvironmentDialog().create_environment({ "name": "Test environment", "version": OPENSTACK_RHOS, "rh": { "mode": "rhn", "username": "******", "password": "******", "host": "satellite.server.host.name", "activation_key": "activationKey" }, "deployment_mode": Cluster.DEPLOYMENT_MODE_MULTI_NODE, "compute_type": "kvm", }))
def test_check_cidr_prefix(self): PoteenLogger.add_test_case("Check CIDR prefix") cluster_key = "cluster" logger.info(Main().navigate()) logger.info(Cluster_BrowseView().remove_all()) # create cluster logger.info(Cluster_BrowseView().click_add_new_cluster(cluster_key)) logger.info(CreateEnvironmentDialog().create_environment({ "name": "Test environment", "version": OPENSTACK_CURRENT_VERSION, "deployment_mode": Cluster.DEPLOYMENT_MODE_MULTI_NODE })) logger.info(Cluster_BrowseView().select_by_key(cluster_key)) logger.info(Cluster_View().click_network_settings_tab()) cidr_vm_networks = [("240.0.1.0/1", False), ("240.0.1.0/-10", False), ("240.0.1.0/0 ", False), ("240.0.1.0/31", False), ("240.0.1.0/75", False), ("240.0.1.0/test", False), ("240.0.1.0/", False), ("240.0.1.0/2", True), ("240.0.1.0/30", True), ("240.0.1.0/15", True)] for cidr_vm_network, valid in cidr_vm_networks: logger.info(NetworkSettingsView().verify_cidr_vm_networks( cidr_vm_network, valid))
def test_deploy_no_ha_1_compute(self): PoteenLogger.add_test_case("Deploy without HA mode 1 compute") cluster_key = "cluster" logger.info(Main().navigate()) logger.info(Cluster_BrowseView().remove_all()) # create cluster logger.info(Cluster_BrowseView().click_add_new_cluster(cluster_key)) logger.info(CreateEnvironmentDialog().create_environment({ "name": "Test environment", "version": OPENSTACK_CURRENT_VERSION, "deployment_mode": Cluster.DEPLOYMENT_MODE_MULTI_NODE })) logger.info(Cluster_BrowseView().select_by_key(cluster_key)) logger.info(Cluster_Nodes_View().click_add_nodes()) logger.info(Cluster_Nodes_View().assign_roles_to_nodes( ['compute'], ["Dell Inspiron"])) logger.info(Cluster_Nodes_View().verify_nodes('compute', ["Dell Inspiron"])) logger.info(Cluster_View().click_deploy_changes()) logger.info(VerifyBot().verify_contains( 'disabled', DeployChangesDialog().deploy_button().get_element().get_attribute( 'class'), 'Deploy button')) logger.info(VerifyBot().verify_visibility( DeployChangesDialog().alert_message.get_element(), True, "Alert error message"))
def test_can_not_add_offline_node(self): PoteenLogger.add_test_case( "Can not add 'offline' node to environment") cluster_key = "cluster" logger.info(Main().navigate()) logger.info(Cluster_BrowseView().remove_all()) # create cluster logger.info(Cluster_BrowseView().click_add_new_cluster(cluster_key)) logger.info(CreateEnvironmentDialog().create_environment( { "name": "Test environment", "version": OPENSTACK_CURRENT_VERSION, "deployment_mode": Cluster.DEPLOYMENT_MODE_MULTI_NODE } )) logger.info(Cluster_BrowseView().select_by_key(cluster_key)) logger.info(Cluster_Nodes_View().click_add_nodes()) logger.info(Cluster_Nodes_View().assign_roles_to_nodes( ['controller'], ["Supermicro X9SCD (offline)", "Supermicro X9DRW"] )) logger.info(Cluster_Nodes_View().verify_nodes( 'controller', ["Supermicro X9DRW"] )) logger.info(Cluster_Nodes_View().verify_node_with_role_not_exists( 'controller', "Supermicro X9SCD (offline)" ))
def test_form(self): PoteenLogger.add_test_case( "Testing cluster page") cluster_key = "cluster" logger.info(Main().navigate()) logger.info(Cluster_BrowseView().remove_all()) logger.info( Cluster_BrowseView().click_add_new_cluster(cluster_key)) logger.info(CreateEnvironmentDialog().create_environment( { "name": "Test environment", "version": OPENSTACK_CURRENT_VERSION, "deployment_mode": Cluster.DEPLOYMENT_MODE_MULTI_NODE } )) logger.info(Cluster_BrowseView().select_by_key(cluster_key)) logger.info(VerifyBot().verify_visibility( Cluster_Nodes_View().addNodes.get_element(), True, "Add nodes button")) logger.info(VerifyBot().verify_disabled( Cluster_Nodes_View().deleteNodes.get_element(), 'true', "Delete nodes button")) logger.info(VerifyBot().verify_visibility( Cluster_Nodes_View().environment_status.get_element(), True, "Environment status")) logger.info(VerifyBot().verify_disabled( Cluster_Nodes_View().groupBy.get_element(), 'true', "Group by select"))
def test_testing_deployment(self): PoteenLogger.add_test_case( "Testing deployment") cluster_key = "cluster" logger.info(Main().navigate()) logger.info(Cluster_BrowseView().remove_all()) logger.info(Cluster_BrowseView().click_add_new_cluster(cluster_key)) logger.info(CreateEnvironmentDialog().create_environment( { "name": "Test environment", "version": OPENSTACK_CURRENT_VERSION, "deployment_mode": Cluster.DEPLOYMENT_MODE_MULTI_NODE } )) logger.info(Cluster_BrowseView().select_by_key(cluster_key)) logger.info(Cluster_Nodes_View().click_add_nodes()) available_nodes_names = Cluster_Nodes_ListView()\ .get_nodes_names_by_status('Discovered') logger.info(Cluster_Nodes_View().assign_roles_to_nodes( ['controller'], available_nodes_names[:1] )) logger.info(Cluster_View().click_deploy_changes()) logger.info(DeployChangesDialog().deploy()) logger.info(VerifyBot().verify_disabled( Cluster_Nodes_View().addNodes.get_element(), 'true', "Add node button is disabled")) logger.info(VerifyBot().verify_disabled( Cluster_Nodes_View().deleteNodes.get_element(), 'true', "Delete node button is disabled")) logger.info(Cluster_View().wait_deployment_done( DEFAULT_DEPLOYMENT_TIMEOUT_UI ))
def test_can_not_add_offline_node(self): PoteenLogger.add_test_case("Can not add 'offline' node to environment") cluster_key = "cluster" logger.info(Main().navigate()) logger.info(Cluster_BrowseView().remove_all()) # create cluster logger.info(Cluster_BrowseView().click_add_new_cluster(cluster_key)) logger.info(CreateEnvironmentDialog().create_environment({ "name": "Test environment", "version": OPENSTACK_CURRENT_VERSION, "deployment_mode": Cluster.DEPLOYMENT_MODE_MULTI_NODE })) logger.info(Cluster_BrowseView().select_by_key(cluster_key)) logger.info(Cluster_Nodes_View().click_add_nodes()) logger.info(Cluster_Nodes_View().assign_roles_to_nodes( ['controller'], ["Supermicro X9SCD (offline)", "Supermicro X9DRW"])) logger.info(Cluster_Nodes_View().verify_nodes('controller', ["Supermicro X9DRW"])) logger.info(Cluster_Nodes_View().verify_node_with_role_not_exists( 'controller', "Supermicro X9SCD (offline)"))
def test_releases(self): PoteenLogger.add_test_case( "Test releases page") logger.info(Main().navigate()) logger.info(Main_Menu().releases.click()) logger.info(Releases_Table().verify_releases_count(3)) logger.info(Releases_Table().verify_release_status( RELEASE_GRIZZLY_CENTOS, "Active")) logger.info(Releases_Table().verify_release_status( RELEASE_GRIZZLY_UBUNTU, "Active")) if Releases_Table().verify_release_status( RELEASE_RHOS, "Not available").i_passed(): logger.info(Releases_Table().click_configure(RELEASE_RHOS)) logger.info(Configure_Release_Dialog().licence_rhn.click()) logger.info( Configure_Release_Dialog().licence_rhn.verify_value(True)) logger.info( Configure_Release_Dialog().verify_controls_presence("RHN") ) logger.info(Configure_Release_Dialog().licence_rhsm.click()) logger.info( Configure_Release_Dialog().licence_rhsm.verify_value(True)) logger.info( Configure_Release_Dialog().verify_controls_presence("RHSM") ) logger.info(Configure_Release_Dialog().populate( "rheltest", "password")) logger.info(Configure_Release_Dialog().apply()) logger.info(Releases_Table().wait_downloading(RELEASE_RHOS)) logger.info(Releases_Table().verify_release_status( RELEASE_RHOS, "Active")) else: logger.info(Releases_Table().verify_release_status( RELEASE_RHOS, "Active"))
def test_deploy_no_ha_1_compute(self): PoteenLogger.add_test_case("Deploy without HA mode 1 compute") cluster_key = "cluster" cluster_name = "Test environment" logger.info(Main().navigate()) logger.info(Cluster_BrowseView().remove_all()) logger.info(Cluster_BrowseView().click_add_new_cluster(cluster_key)) logger.info( CreateEnvironmentDialog().populate(name=cluster_name, version=OPENSTACK_CURRENT_VERSION, submit=True) ) logger.info(Cluster_BrowseView().select_by_key(cluster_key)) logger.info(Cluster_Nodes_View().select_environment_mode(deploymentMode=Cluster.DEPLOYMENT_MODE_MULTI_NODE)) logger.info(Cluster_Nodes_View().click_add_compute()) logger.info(Cluster_Nodes_ListView().select_nodes("Dell Inspiron")) logger.info(Cluster_Nodes_View().verify_compute_nodes("Dell Inspiron")) logger.info(Cluster_View().click_deploy_changes()) logger.info(DeployChangesDialog().deploy()) logger.info(Cluster_View().wait_deployment_done(DEFAULT_DEPLOYMENT_TIMEOUT)) logger.info( Cluster_View().verify_success_message( "Deployment of environment {name} is done." " Access WebUI of OpenStack".format(name=cluster_name) ) )
def test_deploy_no_ha_1_controller(self): PoteenLogger.add_test_case("Deploy without HA mode 1 controller") cluster_key = "cluster" cluster_name = "Test environment" logger.info(Main().navigate()) logger.info(Cluster_BrowseView().remove_all()) # create cluster logger.info(Cluster_BrowseView().click_add_new_cluster(cluster_key)) logger.info(CreateEnvironmentDialog().create_environment({ "name": cluster_name, "version": OPENSTACK_CURRENT_VERSION, "deployment_mode": Cluster.DEPLOYMENT_MODE_MULTI_NODE })) logger.info(Cluster_BrowseView().select_by_key(cluster_key)) logger.info(Cluster_Nodes_View().click_add_nodes()) logger.info(Cluster_Nodes_View().assign_roles_to_nodes( ['controller'], ["Supermicro X9DRW"])) logger.info(Cluster_Nodes_View().verify_nodes('controller', ["Supermicro X9DRW"])) logger.info(Cluster_View().click_deploy_changes()) logger.info(DeployChangesDialog().deploy()) logger.info( Cluster_View().wait_deployment_done(DEFAULT_DEPLOYMENT_TIMEOUT_UI)) logger.info( Cluster_View().verify_successful_deployment_per_name(cluster_name))
def test_redeployment_after_addition_new_compute_node(self): PoteenLogger.add_test_case( "Redeployment after addition new compute node") cluster_key = "cluster" logger.info(Main().navigate()) logger.info(Cluster_BrowseView().remove_all()) # create cluster logger.info(Cluster_BrowseView().click_add_new_cluster(cluster_key)) logger.info(CreateEnvironmentDialog().create_environment({ "name": "Test environment", "version": OPENSTACK_CURRENT_VERSION, "deployment_mode": Cluster.DEPLOYMENT_MODE_MULTI_NODE })) logger.info(Cluster_BrowseView().select_by_key(cluster_key)) logger.info(Cluster_Nodes_View().click_add_nodes()) available_nodes_names = Cluster_Nodes_ListView()\ .get_nodes_names_by_status('Discovered') logger.info(Cluster_Nodes_View().assign_roles_to_nodes( ['controller'], available_nodes_names[:1])) logger.info(Cluster_Nodes_View().click_add_nodes()) available_nodes_names = Cluster_Nodes_ListView()\ .get_nodes_names_by_status('Discovered') logger.info(Cluster_Nodes_View().assign_roles_to_nodes( ['compute'], available_nodes_names[:1])) logger.info(Cluster_View().click_deploy_changes()) logger.info(DeployChangesDialog().deploy()) logger.info( Cluster_View().wait_deployment_done(DEFAULT_DEPLOYMENT_TIMEOUT_UI)) logger.info(Cluster_View().verify_successful_deployment_per_name( "Test environment")) logger.info(Cluster_Nodes_ListView().verify_amount_nodes_in_status( 'Ready', 2)) logger.info(Cluster_Nodes_View().click_add_nodes()) available_nodes_names = Cluster_Nodes_ListView()\ .get_nodes_names_by_status('Discovered') logger.info(Cluster_Nodes_View().assign_roles_to_nodes( ['compute'], available_nodes_names[:1])) logger.info(Cluster_Nodes_ListView().verify_amount_nodes_in_status( 'Pending Addition', 1)) logger.info(Cluster_View().click_deploy_changes()) logger.info(DeployChangesDialog().deploy()) logger.info(Cluster_Nodes_ListView().verify_amount_nodes_in_status( 'Ready', 2)) logger.info( Cluster_View().wait_deployment_done(DEFAULT_DEPLOYMENT_TIMEOUT_UI)) logger.info(Cluster_View().verify_successful_deployment_per_name( "Test environment")) logger.info(Cluster_Nodes_ListView().verify_amount_nodes_in_status( 'Ready', 3))
def test_compute_disk(self): PoteenLogger.add_test_case( "Compute disk") cluster_key = "cluster" cluster_name = "Test compute disk" logger.info(Main().navigate()) logger.info(Cluster_BrowseView().remove_all()) # create cluster logger.info(Cluster_BrowseView().click_add_new_cluster(cluster_key)) logger.info(CreateEnvironmentDialog().populate( name=cluster_name, version=OPENSTACK_CURRENT_VERSION, submit=True )) logger.info(Cluster_BrowseView().select_by_key(cluster_key)) # add compute node logger.info(Cluster_Nodes_View().click_add_compute()) available_nodes_names = Cluster_Nodes_ListView()\ .get_nodes_names_by_status('Discovered') logger.info(Cluster_Nodes_ListView().select_nodes( available_nodes_names[-1] )) logger.info(Cluster_Nodes_View().verify_compute_nodes( available_nodes_names[-1] )) # navigate to disks configuration page logger.info( Cluster_Nodes_View().get_nodes_computes()[-1].click_hardware()) logger.info(NodeHardwareDialog().click_disk_configuration()) # verify default disks settings logger.info(ConfigureDisks().get_disk_box('sda').click_disk_map()) logger.info(ConfigureDisks().get_disk_box( 'sda').verify_volume_size_is_identical('Base System')) logger.info(ConfigureDisks().get_disk_box( 'sda').verify_volume_size_is_identical('Virtual Storage')) logger.info(ConfigureDisks().get_disk_box( 'sda').make_bootable.find().verify_attribute( 'disabled', 'disabled')) logger.info(ConfigureDisks().get_disk_box('sdb').click_disk_map()) logger.info(ConfigureDisks().get_disk_box( 'sdb').verify_volume_size_is_identical('Virtual Storage')) logger.info(ConfigureDisks().get_disk_box( 'sdb').make_bootable.find().verify_attribute('disabled', None)) logger.info(ConfigureDisks().get_disk_box('sdc').click_disk_map()) logger.info(ConfigureDisks().get_disk_box( 'sdc').verify_volume_size_is_identical('Virtual Storage')) logger.info(ConfigureDisks().get_disk_box( 'sdc').make_bootable.find().verify_attribute('disabled', None))
def deploy(self, controllers=0, computes=0): PoteenLogger.add_test_case( "Deploy in mode with HA ({controllers} controllers + " "{computes} compute nodes)".format( controllers=controllers, computes=computes)) cluster_key = "cluster" cluster_name = "Test environment" logger.info(Main().navigate()) logger.info(Cluster_BrowseView().remove_all()) logger.info(Cluster_BrowseView().click_add_new_cluster(cluster_key)) logger.info(CreateEnvironmentDialog().populate( name=cluster_name, version=OPENSTACK_CURRENT_VERSION, submit=True )) logger.info(Cluster_BrowseView().select_by_key(cluster_key)) logger.info(Cluster_Nodes_View().select_environment_mode( deploymentMode=Cluster.DEPLOYMENT_MODE_MULTI_NODE_WITH_HA )) if controllers > 0: logger.info(Cluster_Nodes_View().click_add_controller()) available_nodes_names = Cluster_Nodes_ListView()\ .get_nodes_names_by_status('Discovered') logger.info(Cluster_Nodes_ListView().select_nodes( *available_nodes_names[:controllers] )) if computes > 0: logger.info(Cluster_Nodes_View().click_add_compute()) logger.info(Cluster_Nodes_ListView().select_nodes( *available_nodes_names[controllers:controllers + computes] )) logger.info(Cluster_Nodes_View().verify_controller_nodes( *available_nodes_names[:controllers] )) logger.info(Cluster_Nodes_View().verify_compute_nodes( *available_nodes_names[controllers:controllers + computes] )) logger.info(Cluster_View().click_deploy_changes()) logger.info(DeployChangesDialog().deploy()) logger.info(Cluster_View().wait_deployment_done( DEFAULT_DEPLOYMENT_TIMEOUT )) logger.info(Cluster_View().verify_success_message( "Deployment of environment {name} is done." " Access WebUI of OpenStack" .format(name=cluster_name) ))
def deploy(self, cluster_name, controllers=1, computes=0): PoteenLogger.add_test_case( "Deploy in mode with HA ({controllers} controllers + " "{computes} compute nodes)".format( controllers=controllers, computes=computes)) cluster_key = "cluster" logger.info(Main().navigate()) logger.info(Cluster_BrowseView().remove_all()) # create cluster logger.info(Cluster_BrowseView().click_add_new_cluster(cluster_key)) logger.info(CreateEnvironmentDialog().create_environment( { "name": "Test environment", "version": OPENSTACK_CURRENT_VERSION, "deployment_mode": Cluster.DEPLOYMENT_MODE_MULTI_NODE_WITH_HA } )) logger.info(Cluster_BrowseView().select_by_key(cluster_key)) logger.info(Cluster_Nodes_View().click_add_nodes()) available_nodes_names = Cluster_Nodes_ListView()\ .get_nodes_names_by_status('Discovered') logger.info(Cluster_Nodes_View().assign_roles_to_nodes( ['controller'], available_nodes_names[:controllers] )) if computes > 0: logger.info(Cluster_Nodes_View().click_add_nodes()) logger.info(Cluster_Nodes_View().assign_roles_to_nodes( ['compute'], available_nodes_names[controllers:controllers + computes] )) logger.info(Cluster_Nodes_View().verify_nodes( 'controller', available_nodes_names[:controllers] )) if computes > 0: logger.info(Cluster_Nodes_View().verify_nodes( 'compute', available_nodes_names[controllers:controllers + computes] )) logger.info(Cluster_View().click_deploy_changes()) logger.info(DeployChangesDialog().deploy()) logger.info(Cluster_View().wait_deployment_done( DEFAULT_DEPLOYMENT_TIMEOUT_UI ))
def test_form_creation_with_grizzly(self): PoteenLogger.add_test_case("Check creation page with grizzly") cluster_key = "cluster" logger.info(Main().navigate()) logger.info(Cluster_BrowseView().remove_all()) logger.info(Cluster_BrowseView().click_add_new_cluster(cluster_key)) logger.info( CreateEnvironmentDialog().name.set_value("Test environment")) logger.info(WaitBot().wait_loading()) logger.info( CreateEnvironmentDialog().version.set_value(OPENSTACK_GRIZZLY)) logger.info(CreateEnvironmentDialog().name.click()) WaitBot().wait_for_stop_resizing( By.XPATH, CreateEnvironmentDialog().XPATH_DIALOG) logger.info(VerifyBot().verify_visibility( CreateEnvironmentDialog().instruction.get_element(), False, "Instruction for RHOS")) logger.info(CreateEnvironmentDialog().verify_release_description( "OpenStack Grizzly packages using CentOS as a base operating " "system")) logger.info( CreateEnvironmentDialog().version.set_value(OPENSTACK_RHOS)) logger.info(CreateEnvironmentDialog().name.click()) WaitBot().wait_for_stop_resizing( By.XPATH, CreateEnvironmentDialog().XPATH_DIALOG) logger.info(CreateEnvironmentDialog().verify_release_description( "Red Hat Enterprise Linux OpenStack Platform using RHEL as a base " "operating system")) if VerifyBot().is_element_displayed( CreateEnvironmentDialog().username): logger.info(VerifyBot().verify_visibility( CreateEnvironmentDialog().instruction.get_element(), True, "Instruction for RHOS")) logger.info( CreateEnvironmentDialog().version.set_value(OPENSTACK_GRIZZLY)) logger.info(CreateEnvironmentDialog().name.click()) WaitBot().wait_for_stop_resizing( By.XPATH, CreateEnvironmentDialog().XPATH_DIALOG) logger.info(CreateEnvironmentDialog().verify_release_description( "OpenStack Grizzly packages using CentOS as a base operating " "system")) logger.info(VerifyBot().verify_visibility( CreateEnvironmentDialog().instruction.get_element(), False, "Instruction for RHOS"))
def test_deploy_concurrent_deployment_3_environments(self): PoteenLogger.add_test_case("Concurrent simple deployment 3 environments") clusters = { "cluster1": {"name": "Test environment 1", "controllers": ["VirtualBox"], "computes": ["Supermicro X9DRW"]}, "cluster2": {"name": "Test environment 2", "controllers": ["Supermicro X9SCD"], "computes": ["KVM"]}, "cluster3": { "name": "Test environment 3", "controllers": ["Dell Inspiron"], "computes": ["Supermicro X9DRW (srv07)"], }, } logger.info(Main().navigate()) logger.info(Cluster_BrowseView().remove_all()) for cluster_key, cluster_info in clusters.iteritems(): logger.info(Main().navigate()) logger.info(Cluster_BrowseView().click_add_new_cluster(cluster_key)) logger.info( CreateEnvironmentDialog().populate( name=cluster_info["name"], version=OPENSTACK_CURRENT_VERSION, submit=True ) ) logger.info(Cluster_BrowseView().select_by_key(cluster_key)) logger.info(Cluster_Nodes_View().select_environment_mode(deploymentMode=Cluster.DEPLOYMENT_MODE_MULTI_NODE)) logger.info(Cluster_Nodes_View().click_add_controller()) logger.info(Cluster_Nodes_ListView().select_nodes(*cluster_info["controllers"])) logger.info(Cluster_Nodes_View().click_add_compute()) logger.info(Cluster_Nodes_ListView().select_nodes(*cluster_info["computes"])) logger.info(Cluster_Nodes_View().verify_controller_nodes(*cluster_info["controllers"])) logger.info(Cluster_Nodes_View().verify_compute_nodes(*cluster_info["computes"])) for cluster_key, cluster_info in clusters.iteritems(): logger.info(Main().navigate()) logger.info(Cluster_BrowseView().select_by_key(cluster_key)) logger.info(Cluster_View().click_deploy_changes()) logger.info(DeployChangesDialog().deploy()) for cluster_key, cluster_info in clusters.iteritems(): logger.info(Main().navigate()) logger.info(Cluster_BrowseView().select_by_key(cluster_key)) logger.info(Cluster_View().wait_deployment_done(DEFAULT_DEPLOYMENT_TIMEOUT)) logger.info( Cluster_View().verify_success_message( "Deployment of environment {name} is done." " Access WebUI of OpenStack".format(name=cluster_info["name"]) ) )
def test_deploy_HA_1_cinder(self): PoteenLogger.add_test_case( "Deploy HA mode 3 controllers 1 compute 1 cinder") cluster_key = "cluster" cluster_name = "Test simple deployment" logger.info(Main().navigate()) logger.info(Cluster_BrowseView().remove_all()) # create cluster logger.info(Cluster_BrowseView().click_add_new_cluster(cluster_key)) logger.info(CreateEnvironmentDialog().create_environment( { "name": cluster_name, "version": OPENSTACK_CURRENT_VERSION, "deployment_mode": Cluster.DEPLOYMENT_MODE_MULTI_NODE } )) logger.info(Cluster_BrowseView().select_by_key(cluster_key)) logger.info(Cluster_Nodes_View().click_add_nodes()) available_nodes_names = Cluster_Nodes_ListView()\ .get_nodes_names_by_status('Discovered') logger.info(Cluster_Nodes_View().assign_roles_to_nodes( ['controller'], available_nodes_names[:3] )) logger.info(Cluster_Nodes_View().click_add_nodes()) available_nodes_names = Cluster_Nodes_ListView()\ .get_nodes_names_by_status('Discovered') logger.info(Cluster_Nodes_View().assign_roles_to_nodes( ['compute'], available_nodes_names[:1] )) logger.info(Cluster_Nodes_View().click_add_nodes()) available_nodes_names = Cluster_Nodes_ListView()\ .get_nodes_names_by_status('Discovered') logger.info(Cluster_Nodes_View().assign_roles_to_nodes( ['cinder'], available_nodes_names[:1] )) logger.info(Cluster_View().click_deploy_changes()) logger.info(DeployChangesDialog().deploy()) logger.info(Cluster_View().wait_deployment_done( DEFAULT_DEPLOYMENT_TIMEOUT_UI )) logger.info( Cluster_View().verify_successful_deployment_per_name(cluster_name) ) logger.info(Cluster_Nodes_ListView().verify_amount_nodes_in_status( "Ready", 5))
def test_delete_cluster_after_successful_deployment(self): PoteenLogger.add_test_case( "Delete cluster after successful deployment") cluster_key = "cluster" cluster_name = "Test environment" logger.info(Main().navigate()) logger.info(Cluster_BrowseView().remove_all()) # create cluster logger.info(Cluster_BrowseView().click_add_new_cluster(cluster_key)) logger.info(CreateEnvironmentDialog().create_environment( { "name": cluster_name, "version": OPENSTACK_CURRENT_VERSION, "deployment_mode": Cluster.DEPLOYMENT_MODE_MULTI_NODE } )) logger.info(Cluster_BrowseView().select_by_key(cluster_key)) logger.info(Cluster_Nodes_View().click_add_nodes()) logger.info(Cluster_Nodes_View().assign_roles_to_nodes( ['controller'], ["Supermicro X9DRW"] )) logger.info(Cluster_Nodes_View().click_add_nodes()) logger.info(Cluster_Nodes_View().assign_roles_to_nodes( ['compute'], ["Dell Inspiron"] )) logger.info(Cluster_Nodes_View().verify_nodes( 'controller', ["Supermicro X9DRW"] )) logger.info(Cluster_Nodes_View().verify_nodes( 'compute', ["Dell Inspiron"] )) logger.info(Cluster_View().click_deploy_changes()) logger.info(DeployChangesDialog().deploy()) logger.info(Cluster_View().wait_deployment_done( DEFAULT_DEPLOYMENT_TIMEOUT_UI )) logger.info( Cluster_View().verify_successful_deployment_per_name(cluster_name) ) logger.info(Main().navigate()) logger.info(Cluster_BrowseView().remove("Test environment")) logger.info(Cluster_BrowseView().verify_clusters_amount(0))
def test_form_creation_with_grizzly(self): PoteenLogger.add_test_case( "Check creation page with grizzly") cluster_key = "cluster" logger.info(Main().navigate()) logger.info(Cluster_BrowseView().remove_all()) logger.info(Cluster_BrowseView().click_add_new_cluster(cluster_key)) logger.info( CreateEnvironmentDialog().name.set_value("Test environment")) logger.info(WaitBot().wait_loading()) logger.info( CreateEnvironmentDialog().version.set_value(OPENSTACK_GRIZZLY)) logger.info(CreateEnvironmentDialog().name.click()) WaitBot().wait_for_stop_resizing( By.XPATH, CreateEnvironmentDialog().XPATH_DIALOG) logger.info(VerifyBot().verify_visibility( CreateEnvironmentDialog().instruction.get_element(), False, "Instruction for RHOS")) logger.info(CreateEnvironmentDialog().verify_release_description( "OpenStack Grizzly packages using CentOS as a base operating " "system")) logger.info( CreateEnvironmentDialog().version.set_value(OPENSTACK_RHOS)) logger.info(CreateEnvironmentDialog().name.click()) WaitBot().wait_for_stop_resizing( By.XPATH, CreateEnvironmentDialog().XPATH_DIALOG) logger.info(CreateEnvironmentDialog().verify_release_description( "Red Hat Enterprise Linux OpenStack Platform using RHEL as a base " "operating system")) if VerifyBot().is_element_displayed( CreateEnvironmentDialog().username): logger.info(VerifyBot().verify_visibility( CreateEnvironmentDialog().instruction.get_element(), True, "Instruction for RHOS")) logger.info( CreateEnvironmentDialog().version.set_value(OPENSTACK_GRIZZLY)) logger.info(CreateEnvironmentDialog().name.click()) WaitBot().wait_for_stop_resizing( By.XPATH, CreateEnvironmentDialog().XPATH_DIALOG) logger.info(CreateEnvironmentDialog().verify_release_description( "OpenStack Grizzly packages using CentOS as a base operating " "system")) logger.info(VerifyBot().verify_visibility( CreateEnvironmentDialog().instruction.get_element(), False, "Instruction for RHOS"))
def deploy(self, cluster_name, controllers=1, computes=0): PoteenLogger.add_test_case( "Deploy in mode with HA ({controllers} controllers + " "{computes} compute nodes)".format(controllers=controllers, computes=computes)) cluster_key = "cluster" logger.info(Main().navigate()) logger.info(Cluster_BrowseView().remove_all()) # create cluster logger.info(Cluster_BrowseView().click_add_new_cluster(cluster_key)) logger.info(CreateEnvironmentDialog().create_environment({ "name": "Test environment", "version": OPENSTACK_CURRENT_VERSION, "deployment_mode": Cluster.DEPLOYMENT_MODE_MULTI_NODE_WITH_HA })) logger.info(Cluster_BrowseView().select_by_key(cluster_key)) logger.info(Cluster_Nodes_View().click_add_nodes()) available_nodes_names = Cluster_Nodes_ListView()\ .get_nodes_names_by_status('Discovered') logger.info(Cluster_Nodes_View().assign_roles_to_nodes( ['controller'], available_nodes_names[:controllers])) if computes > 0: logger.info(Cluster_Nodes_View().click_add_nodes()) logger.info(Cluster_Nodes_View().assign_roles_to_nodes( ['compute'], available_nodes_names[controllers:controllers + computes])) logger.info(Cluster_Nodes_View().verify_nodes( 'controller', available_nodes_names[:controllers])) if computes > 0: logger.info(Cluster_Nodes_View().verify_nodes( 'compute', available_nodes_names[controllers:controllers + computes])) logger.info(Cluster_View().click_deploy_changes()) logger.info(DeployChangesDialog().deploy()) logger.info( Cluster_View().wait_deployment_done(DEFAULT_DEPLOYMENT_TIMEOUT_UI))
def test_deploy_HA_1_cinder(self): PoteenLogger.add_test_case( "Deploy HA mode 3 controllers 1 compute 1 cinder") cluster_key = "cluster" cluster_name = "Test simple deployment" logger.info(Main().navigate()) logger.info(Cluster_BrowseView().remove_all()) # create cluster logger.info(Cluster_BrowseView().click_add_new_cluster(cluster_key)) logger.info(CreateEnvironmentDialog().create_environment({ "name": cluster_name, "version": OPENSTACK_CURRENT_VERSION, "deployment_mode": Cluster.DEPLOYMENT_MODE_MULTI_NODE })) logger.info(Cluster_BrowseView().select_by_key(cluster_key)) logger.info(Cluster_Nodes_View().click_add_nodes()) available_nodes_names = Cluster_Nodes_ListView()\ .get_nodes_names_by_status('Discovered') logger.info(Cluster_Nodes_View().assign_roles_to_nodes( ['controller'], available_nodes_names[:3])) logger.info(Cluster_Nodes_View().click_add_nodes()) available_nodes_names = Cluster_Nodes_ListView()\ .get_nodes_names_by_status('Discovered') logger.info(Cluster_Nodes_View().assign_roles_to_nodes( ['compute'], available_nodes_names[:1])) logger.info(Cluster_Nodes_View().click_add_nodes()) available_nodes_names = Cluster_Nodes_ListView()\ .get_nodes_names_by_status('Discovered') logger.info(Cluster_Nodes_View().assign_roles_to_nodes( ['cinder'], available_nodes_names[:1])) logger.info(Cluster_View().click_deploy_changes()) logger.info(DeployChangesDialog().deploy()) logger.info( Cluster_View().wait_deployment_done(DEFAULT_DEPLOYMENT_TIMEOUT_UI)) logger.info( Cluster_View().verify_successful_deployment_per_name(cluster_name)) logger.info(Cluster_Nodes_ListView().verify_amount_nodes_in_status( "Ready", 5))
def test_form(self): PoteenLogger.add_test_case( "Check network settings page") cluster_key = "cluster" logger.info(Main().navigate()) logger.info(Cluster_BrowseView().remove_all()) # create cluster logger.info(Cluster_BrowseView().click_add_new_cluster(cluster_key)) logger.info(CreateEnvironmentDialog().create_environment( { "name": "Test environment", "version": OPENSTACK_CURRENT_VERSION, "deployment_mode": Cluster.DEPLOYMENT_MODE_MULTI_NODE } )) logger.info(Cluster_BrowseView().select_by_key(cluster_key)) logger.info(Cluster_View().click_network_settings_tab()) logger.info(NetworkSettingsView().verify_flatDHCP_manager_value("on")) logger.info(NetworkSettingsView().verify_VLAN_manager_value("off")) logger.info(NetworkSettingsView().verify_amount_of_blocks(5)) logger.info(VerifyBot().verify_disabled( NetworkSettingsView().cancel_changes.get_element(), 'true', "Cancel changes button")) logger.info(VerifyBot().verify_disabled( NetworkSettingsView().save_settings.get_element(), 'true', "Save settings button")) logger.info(VerifyBot().verify_disabled( NetworkSettingsView().verify_networks.get_element(), None, "Verify networks button")) default_value = NetworkSettingsView().vm_networks_cidr.get_value() logger.info( NetworkSettingsView().vm_networks_cidr.set_value("240.0.1.0/25")) logger.info(VerifyBot().verify_disabled( NetworkSettingsView().save_settings.get_element(), None, "Save settings button")) logger.info( NetworkSettingsView().vm_networks_cidr.set_value(default_value)) logger.info(VerifyBot().verify_disabled( NetworkSettingsView().save_settings.get_element(), 'true', "Save settings button"))
def test_form(self): PoteenLogger.add_test_case("Check network settings page") cluster_key = "cluster" logger.info(Main().navigate()) logger.info(Cluster_BrowseView().remove_all()) # create cluster logger.info(Cluster_BrowseView().click_add_new_cluster(cluster_key)) logger.info(CreateEnvironmentDialog().create_environment({ "name": "Test environment", "version": OPENSTACK_CURRENT_VERSION, "deployment_mode": Cluster.DEPLOYMENT_MODE_MULTI_NODE })) logger.info(Cluster_BrowseView().select_by_key(cluster_key)) logger.info(Cluster_View().click_network_settings_tab()) logger.info(NetworkSettingsView().verify_flatDHCP_manager_value("on")) logger.info(NetworkSettingsView().verify_VLAN_manager_value("off")) logger.info(NetworkSettingsView().verify_amount_of_blocks(5)) logger.info(VerifyBot().verify_disabled( NetworkSettingsView().cancel_changes.get_element(), 'true', "Cancel changes button")) logger.info(VerifyBot().verify_disabled( NetworkSettingsView().save_settings.get_element(), 'true', "Save settings button")) logger.info(VerifyBot().verify_disabled( NetworkSettingsView().verify_networks.get_element(), None, "Verify networks button")) default_value = NetworkSettingsView().vm_networks_cidr.get_value() logger.info( NetworkSettingsView().vm_networks_cidr.set_value("240.0.1.0/25")) logger.info(VerifyBot().verify_disabled( NetworkSettingsView().save_settings.get_element(), None, "Save settings button")) logger.info( NetworkSettingsView().vm_networks_cidr.set_value(default_value)) logger.info(VerifyBot().verify_disabled( NetworkSettingsView().save_settings.get_element(), 'true', "Save settings button"))
def test_amount_field_validation(self): PoteenLogger.add_test_case( "Check Amount field validation") cluster_key = "cluster" logger.info(Main().navigate()) logger.info(Cluster_BrowseView().remove_all()) # create cluster logger.info(Cluster_BrowseView().click_add_new_cluster(cluster_key)) logger.info(CreateEnvironmentDialog().create_environment( { "name": "Test environment", "version": OPENSTACK_CURRENT_VERSION, "deployment_mode": Cluster.DEPLOYMENT_MODE_MULTI_NODE } )) logger.info(Cluster_BrowseView().select_by_key(cluster_key)) logger.info(Cluster_View().click_network_settings_tab()) logger.info(NetworkSettingsView().set_VLAN_manager("on")) amount_array = [ (" ", False), ("-10", False), ("0", False) ] for amount, valid in amount_array: logger.info( NetworkSettingsView().verify_error_amount(amount, valid)) logger.info( NetworkSettingsView().verify_error_amount("2", False, "4094")) amount_array = [ ("2", True, "4093", "4094"), ("4094", True, "1", "4094"), ("10", True, "250", "259")] for amount, valid, start_ip, end_ip in amount_array: logger.info( NetworkSettingsView().verify_error_amount( amount, valid, start_ip, end_ip)) logger.info( NetworkSettingsView().verify_error_amount("1", True, "4094"))
def test_compute_disk(self): PoteenLogger.add_test_case("Compute disk") cluster_key = "cluster" cluster_name = "Test compute disk" logger.info(Main().navigate()) logger.info(Cluster_BrowseView().remove_all()) # create cluster logger.info(Cluster_BrowseView().click_add_new_cluster(cluster_key)) logger.info(CreateEnvironmentDialog().create_environment({ "name": "Test environment", "version": OPENSTACK_CURRENT_VERSION, "deployment_mode": Cluster.DEPLOYMENT_MODE_MULTI_NODE })) logger.info(Cluster_BrowseView().select_by_key(cluster_key)) # add compute node logger.info(Cluster_Nodes_View().click_add_nodes()) available_nodes_names = Cluster_Nodes_ListView()\ .get_nodes_names_by_status('Discovered') logger.info(Cluster_Nodes_View().assign_roles_to_nodes( ['compute'], [available_nodes_names[-1]])) logger.info(Cluster_Nodes_View().verify_nodes( 'compute', [available_nodes_names[-1]])) # navigate to disks configuration page logger.info( Cluster_Nodes_View().get_nodes('compute')[-1].click_node_details()) logger.info(NodeHardwareDialog().click_disk_configuration()) # verify default disks settings logger.info(ConfigureDisks().get_disk_box('sda').click_disk_map()) logger.info(ConfigureDisks().get_disk_box( 'sda').verify_volume_size_is_identical('Base System')) logger.info(ConfigureDisks().get_disk_box( 'sda').verify_volume_size_is_identical('Virtual Storage'))
def test_deploy_2_controller(self): PoteenLogger.add_test_case( "Deploy in mode with HA ({controllers} controllers + " "{computes} compute nodes)".format( controllers=2, computes=0)) cluster_key = "cluster" logger.info(Main().navigate()) logger.info(Cluster_BrowseView().remove_all()) # create cluster logger.info(Cluster_BrowseView().click_add_new_cluster(cluster_key)) logger.info(CreateEnvironmentDialog().create_environment( { "name": "Test environment", "version": OPENSTACK_CURRENT_VERSION, "deployment_mode": Cluster.DEPLOYMENT_MODE_MULTI_NODE_WITH_HA } )) logger.info(Cluster_BrowseView().select_by_key(cluster_key)) logger.info(Cluster_Nodes_View().click_add_nodes()) available_nodes_names = Cluster_Nodes_ListView()\ .get_nodes_names_by_status('Discovered') logger.info(Cluster_Nodes_View().assign_roles_to_nodes( ['controller'], available_nodes_names[:2] )) logger.info(Cluster_Nodes_View().verify_nodes( 'controller', *available_nodes_names[:2] )) logger.info(Cluster_View().click_deploy_changes()) logger.info(VerifyBot().verify_visibility( DeployChangesDialog().alert_message.get_element(), True, 'Alert message')) logger.info(VerifyBot().verify_contains( 'disabled', DeployChangesDialog().deploy_button().get_element() .get_attribute('class'), 'Deploy button'))
def test_change_network(self): PoteenLogger.add_test_case("Change network manager") cluster_key = "cluster" logger.info(Main().navigate()) logger.info(Cluster_BrowseView().remove_all()) # create cluster logger.info(Cluster_BrowseView().click_add_new_cluster(cluster_key)) logger.info(CreateEnvironmentDialog().create_environment({ "name": "Test environment", "version": OPENSTACK_CURRENT_VERSION, "deployment_mode": Cluster.DEPLOYMENT_MODE_MULTI_NODE })) logger.info(Cluster_BrowseView().select_by_key(cluster_key)) logger.info(Cluster_View().click_network_settings_tab()) logger.info(NetworkSettingsView().verify_flatDHCP_manager_value("on")) logger.info(NetworkSettingsView().verify_VLAN_manager_value("off")) logger.info( NetworkSettingsView().verify_visibility_vlan_manager_fields(False)) logger.info(VerifyBot().verify_disabled( NetworkSettingsView().save_settings.get_element(), 'true', "Save settings button")) logger.info(NetworkSettingsView().set_VLAN_manager("on")) logger.info(NetworkSettingsView().verify_flatDHCP_manager_value("off")) logger.info(VerifyBot().verify_disabled( NetworkSettingsView().save_settings.get_element(), None, "Save settings button")) logger.info( NetworkSettingsView().verify_visibility_vlan_manager_fields(True)) logger.info(NetworkSettingsView().set_flatDHCP_manager("on")) logger.info(NetworkSettingsView().verify_VLAN_manager_value("off")) logger.info( NetworkSettingsView().verify_visibility_vlan_manager_fields(False))
def test_change_network(self): PoteenLogger.add_test_case( "Change network manager") cluster_key = "cluster" logger.info(Main().navigate()) logger.info(Cluster_BrowseView().remove_all()) # create cluster logger.info(Cluster_BrowseView().click_add_new_cluster(cluster_key)) logger.info(CreateEnvironmentDialog().create_environment( { "name": "Test environment", "version": OPENSTACK_CURRENT_VERSION, "deployment_mode": Cluster.DEPLOYMENT_MODE_MULTI_NODE } )) logger.info(Cluster_BrowseView().select_by_key(cluster_key)) logger.info(Cluster_View().click_network_settings_tab()) logger.info(NetworkSettingsView().verify_flatDHCP_manager_value("on")) logger.info(NetworkSettingsView().verify_VLAN_manager_value("off")) logger.info( NetworkSettingsView().verify_visibility_vlan_manager_fields(False)) logger.info(VerifyBot().verify_disabled( NetworkSettingsView().save_settings.get_element(), 'true', "Save settings button")) logger.info(NetworkSettingsView().set_VLAN_manager("on")) logger.info(NetworkSettingsView().verify_flatDHCP_manager_value("off")) logger.info(VerifyBot().verify_disabled( NetworkSettingsView().save_settings.get_element(), None, "Save settings button")) logger.info( NetworkSettingsView().verify_visibility_vlan_manager_fields(True)) logger.info(NetworkSettingsView().set_flatDHCP_manager("on")) logger.info(NetworkSettingsView().verify_VLAN_manager_value("off")) logger.info( NetworkSettingsView().verify_visibility_vlan_manager_fields(False))
def test_deploy_2_controller(self): PoteenLogger.add_test_case( "Deploy in mode with HA ({controllers} controllers + " "{computes} compute nodes)".format(controllers=2, computes=0)) cluster_key = "cluster" logger.info(Main().navigate()) logger.info(Cluster_BrowseView().remove_all()) # create cluster logger.info(Cluster_BrowseView().click_add_new_cluster(cluster_key)) logger.info(CreateEnvironmentDialog().create_environment({ "name": "Test environment", "version": OPENSTACK_CURRENT_VERSION, "deployment_mode": Cluster.DEPLOYMENT_MODE_MULTI_NODE_WITH_HA })) logger.info(Cluster_BrowseView().select_by_key(cluster_key)) logger.info(Cluster_Nodes_View().click_add_nodes()) available_nodes_names = Cluster_Nodes_ListView()\ .get_nodes_names_by_status('Discovered') logger.info(Cluster_Nodes_View().assign_roles_to_nodes( ['controller'], available_nodes_names[:2])) logger.info(Cluster_Nodes_View().verify_nodes( 'controller', *available_nodes_names[:2])) logger.info(Cluster_View().click_deploy_changes()) logger.info(VerifyBot().verify_visibility( DeployChangesDialog().alert_message.get_element(), True, 'Alert message')) logger.info(VerifyBot().verify_contains( 'disabled', DeployChangesDialog().deploy_button().get_element().get_attribute( 'class'), 'Deploy button'))
def test_verify_start_ip(self): PoteenLogger.add_test_case( "Check CIDR field validation") cluster_key = "cluster" logger.info(Main().navigate()) logger.info(Cluster_BrowseView().remove_all()) # create cluster logger.info(Cluster_BrowseView().click_add_new_cluster(cluster_key)) logger.info(CreateEnvironmentDialog().create_environment( { "name": "Test environment", "version": OPENSTACK_CURRENT_VERSION, "deployment_mode": Cluster.DEPLOYMENT_MODE_MULTI_NODE } )) logger.info(Cluster_BrowseView().select_by_key(cluster_key)) logger.info(Cluster_View().click_network_settings_tab()) cidr_vm_networks = [ (" ", False), ("0.10.-1.255/15", False), ("0.-100.240.255/15 ", False), ("0.256.240.255/15", False), ("0.750.240.255/15", False), ("0.01.240.255/15", False), ("0.000.240.255/15", False), ("0.50.240.255.45/15", False), ("0.240.255/15 ", False), ("0.1000.240.255/15", False), ("0..240.255/15", False), ("0.10.100.255/15", True)] for cidr_vm_network, valid in cidr_vm_networks: logger.info( NetworkSettingsView().verify_cidr_vm_networks( cidr_vm_network, valid))
def test_form(self): PoteenLogger.add_test_case( "Check environment creation page with RHOS") logger.info(Main().navigate()) logger.info(Cluster_BrowseView().remove_all()) # create cluster logger.info(Cluster_BrowseView().click_add_new_cluster()) logger.info(CreateEnvironmentDialog().create_environment( { "name": "Test environment", "version": OPENSTACK_RHOS, "rh": { "mode": "rhn", "username": "******", "password": "******", "host": "satellite.server.host.name", "activation_key": "activationKey"}, "deployment_mode": Cluster.DEPLOYMENT_MODE_MULTI_NODE, "compute_type": "kvm", } ))
def test_check_cidr_prefix(self): PoteenLogger.add_test_case( "Check CIDR prefix") cluster_key = "cluster" logger.info(Main().navigate()) logger.info(Cluster_BrowseView().remove_all()) # create cluster logger.info(Cluster_BrowseView().click_add_new_cluster(cluster_key)) logger.info(CreateEnvironmentDialog().create_environment( { "name": "Test environment", "version": OPENSTACK_CURRENT_VERSION, "deployment_mode": Cluster.DEPLOYMENT_MODE_MULTI_NODE } )) logger.info(Cluster_BrowseView().select_by_key(cluster_key)) logger.info(Cluster_View().click_network_settings_tab()) cidr_vm_networks = [ ("240.0.1.0/1", False), ("240.0.1.0/-10", False), ("240.0.1.0/0 ", False), ("240.0.1.0/31", False), ("240.0.1.0/75", False), ("240.0.1.0/test", False), ("240.0.1.0/", False), ("240.0.1.0/2", True), ("240.0.1.0/30", True), ("240.0.1.0/15", True) ] for cidr_vm_network, valid in cidr_vm_networks: logger.info( NetworkSettingsView().verify_cidr_vm_networks( cidr_vm_network, valid))
def test_delete_node_add_node_and_deploy(self): PoteenLogger.add_test_case( "Delete one node from environment after successful deployment. " "Add new nodes and deploy.") cluster_key = "cluster" cluster_name = "Test environment" logger.info(Main().navigate()) logger.info(Cluster_BrowseView().remove_all()) logger.info(Cluster_BrowseView().click_add_new_cluster(cluster_key)) logger.info(CreateEnvironmentDialog().create_environment( { "name": cluster_name, "version": OPENSTACK_CURRENT_VERSION, "deployment_mode": Cluster.DEPLOYMENT_MODE_MULTI_NODE } )) logger.info(Cluster_BrowseView().select_by_key(cluster_key)) logger.info(Cluster_Nodes_View().click_add_nodes()) available_nodes_names = Cluster_Nodes_ListView()\ .get_nodes_names_by_status('Discovered') logger.info(Cluster_Nodes_View().assign_roles_to_nodes( ['controller'], available_nodes_names[:1] )) logger.info(Cluster_Nodes_View().click_add_nodes()) available_nodes_names = Cluster_Nodes_ListView()\ .get_nodes_names_by_status('Discovered') logger.info(Cluster_Nodes_View().assign_roles_to_nodes( ['compute'], available_nodes_names[:1] )) logger.info(Cluster_View().click_deploy_changes()) logger.info(DeployChangesDialog().deploy()) logger.info(Cluster_View().wait_deployment_done( DEFAULT_DEPLOYMENT_TIMEOUT_UI )) logger.info( Cluster_View().verify_successful_deployment_per_name(cluster_name)) logger.info(Main().navigate()) logger.info(Cluster_BrowseView().select_by_key(cluster_key)) available_nodes_names = Cluster_Nodes_ListView()\ .get_nodes_names_by_status('Ready') logger.info( Cluster_Nodes_View().delete_nodes(*available_nodes_names[:1])) logger.info(Cluster_Nodes_View().click_add_nodes()) available_nodes_names = Cluster_Nodes_ListView()\ .get_nodes_names_by_status('Discovered') logger.info(Cluster_Nodes_View().assign_roles_to_nodes( ['controller'], available_nodes_names[:1])) available_nodes_names = Cluster_Nodes_ListView()\ .get_nodes_names_by_status('Discovered') logger.info(Cluster_Nodes_View().assign_roles_to_nodes( ['compute'], available_nodes_names[:2])) logger.info(Cluster_View().click_deploy_changes()) logger.info(DeployChangesDialog().deploy()) logger.info(Cluster_View().wait_deployment_done( DEFAULT_DEPLOYMENT_TIMEOUT_UI )) logger.info( Cluster_View().verify_success_message("Successfully removed")) logger.info(Cluster_Nodes_View().verify_amount('compute', 2)) logger.info(Cluster_Nodes_View().verify_amount('controller', 1))
def test_redeployment_after_deletion_node(self): PoteenLogger.add_test_case( "Redeployment after deletion node") cluster_key = "cluster" cluster_name = "Test simple deployment" logger.info(Main().navigate()) logger.info(Cluster_BrowseView().remove_all()) # create cluster logger.info(Cluster_BrowseView().click_add_new_cluster(cluster_key)) logger.info(CreateEnvironmentDialog().create_environment( { "name": "Test environment", "version": OPENSTACK_CURRENT_VERSION, "deployment_mode": Cluster.DEPLOYMENT_MODE_MULTI_NODE } )) logger.info(Cluster_BrowseView().select_by_key(cluster_key)) logger.info(Cluster_Nodes_View().click_add_nodes()) available_nodes_names = Cluster_Nodes_ListView()\ .get_nodes_names_by_status('Discovered') logger.info(Cluster_Nodes_View().assign_roles_to_nodes( ['controller'], available_nodes_names[:1] )) logger.info(Cluster_Nodes_View().click_add_nodes()) available_nodes_names = Cluster_Nodes_ListView()\ .get_nodes_names_by_status('Discovered') logger.info(Cluster_Nodes_View().assign_roles_to_nodes( ['compute'], available_nodes_names[:2] )) logger.info(Cluster_View().click_deploy_changes()) logger.info(DeployChangesDialog().deploy()) logger.info(Cluster_View().wait_deployment_done( DEFAULT_DEPLOYMENT_TIMEOUT_UI )) logger.info( Cluster_View().verify_successful_deployment_per_name(cluster_name) ) logger.info(Cluster_Nodes_ListView().verify_amount_nodes_in_status( 'Ready', 3)) available_nodes_names = Cluster_Nodes_ListView()\ .get_nodes_names_by_status('Ready') logger.info( Cluster_Nodes_View().delete_nodes(*available_nodes_names[:1])) logger.info(Cluster_Nodes_ListView().verify_amount_nodes_in_status( 'Pending Deletion', 1)) logger.info(Cluster_View().click_deploy_changes()) logger.info(DeployChangesDialog().deploy()) logger.info(Cluster_Nodes_ListView().verify_amount_nodes_in_status( 'Ready', 2)) logger.info(Cluster_View().wait_deployment_done( DEFAULT_DEPLOYMENT_TIMEOUT_UI )) logger.info( Cluster_View().verify_success_message("Successfully removed") ) logger.info(Cluster_Nodes_View().verify_amount('compute', 1)) logger.info(Cluster_Nodes_View().verify_amount('controller', 1))
def test_deploy_concurrent_deployment_3_environments(self): PoteenLogger.add_test_case( "Concurrent simple deployment 3 environments") clusters = { "cluster1": { "name": "Test environment 1", "controllers": ["VirtualBox"], "computes": ["Supermicro X9DRW"] }, "cluster2": { "name": "Test environment 2", "controllers": ["Supermicro X9SCD"], "computes": ["KVM"] }, "cluster3": { "name": "Test environment 3", "controllers": ["Dell Inspiron"], "computes": ["Supermicro X9DRW (srv07)"] } } logger.info(Main().navigate()) logger.info(Cluster_BrowseView().remove_all()) for cluster_key, cluster_info in clusters.iteritems(): logger.info(Main().navigate()) # create cluster logger.info(Cluster_BrowseView().click_add_new_cluster( cluster_key)) logger.info(CreateEnvironmentDialog().create_environment( { "name": "Test environment", "version": OPENSTACK_CURRENT_VERSION, "deployment_mode": Cluster.DEPLOYMENT_MODE_MULTI_NODE } )) logger.info(Cluster_BrowseView().select_by_key(cluster_key)) logger.info(Cluster_Nodes_View().click_add_nodes()) logger.info(Cluster_Nodes_View().assign_roles_to_nodes( ['controller'], cluster_info['controllers'] )) logger.info(Cluster_Nodes_View().click_add_nodes()) logger.info(Cluster_Nodes_View().assign_roles_to_nodes( ['compute'], cluster_info['computes'] )) logger.info(Cluster_Nodes_View().verify_nodes( 'controller', cluster_info['controllers'] )) logger.info(Cluster_Nodes_View().verify_nodes( 'compute', cluster_info['computes'] )) for cluster_key, cluster_info in clusters.iteritems(): logger.info(Main().navigate()) logger.info(Cluster_BrowseView().select_by_key(cluster_key)) logger.info(Cluster_View().click_deploy_changes()) logger.info(DeployChangesDialog().deploy()) for cluster_key, cluster_info in clusters.iteritems(): logger.info(Main().navigate()) logger.info(Cluster_BrowseView().select_by_key(cluster_key)) logger.info(Cluster_View().wait_deployment_done( DEFAULT_DEPLOYMENT_TIMEOUT_UI )) logger.info( Cluster_View().verify_successful_deployment_per_name( cluster_info['name'] ) )
def test_form(self): PoteenLogger.add_test_case( "Check openstack settings page") cluster_key = "cluster" logger.info(Main().navigate()) logger.info(Cluster_BrowseView().remove_all()) # create cluster logger.info(Cluster_BrowseView().click_add_new_cluster(cluster_key)) logger.info(CreateEnvironmentDialog().create_environment( { "name": "Test environment", "version": OPENSTACK_CURRENT_VERSION, "deployment_mode": Cluster.DEPLOYMENT_MODE_MULTI_NODE } )) logger.info(Cluster_BrowseView().select_by_key(cluster_key)) logger.info(Cluster_View().click_openstack_settings_tab()) logger.info(VerifyBot().verify_disabled( OpenstackSettingsView().load_defaults.get_element(), None, "Load defaults button")) logger.info(VerifyBot().verify_disabled( OpenstackSettingsView().cancel_changes.get_element(), 'true', "Cancel changes button")) logger.info(VerifyBot().verify_disabled( OpenstackSettingsView().save_settings.get_element(), 'true', "Save settings button")) logger.info(OpenstackSettingsView().show_password.click()) logger.info(VerifyBot().verify_disabled( OpenstackSettingsView().cancel_changes.get_element(), 'true', "Cancel changes button")) logger.info(VerifyBot().verify_disabled( OpenstackSettingsView().save_settings.get_element(), 'true', "Save settings button")) logger.info(VerifyBot().verify_disabled( OpenstackSettingsView().load_defaults.get_element(), None, "Load defaults button")) logger.info(VerifyBot().verify_visibility( OpenstackSettingsView().show_password_off.get_element(), True, "Show password button off")) logger.info(OpenstackSettingsView().show_password.click()) logger.info(VerifyBot().verify_visibility( OpenstackSettingsView().show_password_on.get_element(), True, "Show password button on")) logger.info(OpenstackSettingsView().set_parameter_input( "username", "test name")) logger.info(VerifyBot().verify_disabled( OpenstackSettingsView().load_defaults.get_element(), None, "Load defaults button")) logger.info(VerifyBot().verify_disabled( OpenstackSettingsView().save_settings.get_element(), None, "Save settings button")) logger.info(VerifyBot().verify_disabled( OpenstackSettingsView().cancel_changes.get_element(), None, "Cancel changes button")) logger.info(OpenstackSettingsView().set_parameter_input( "username", "admin")) logger.info(VerifyBot().verify_disabled( OpenstackSettingsView().load_defaults.get_element(), None, "Load defaults button")) logger.info(VerifyBot().verify_disabled( OpenstackSettingsView().save_settings.get_element(), 'true', "Save settings button")) logger.info(VerifyBot().verify_disabled( OpenstackSettingsView().cancel_changes.get_element(), 'true', "Cancel changes button")) logger.info(OpenstackSettingsView().set_parameter_input( "username", "test name")) logger.info(Cluster_View().click_network_settings_tab()) logger.info(ConfirmLeavePageDialog().click_stay_on_page()) ConfirmLeavePageDialog().wait_closing() logger.info(OpenstackSettingsView().cancel_changes.click_and_wait()) logger.info(VerifyBot().verify_disabled( OpenstackSettingsView().save_settings.get_element(), 'true', "Save settings button")) logger.info(OpenstackSettingsView().set_parameter_input( "username", "test name")) logger.info(OpenstackSettingsView().save_settings.click_and_wait()) logger.info(VerifyBot().verify_disabled( OpenstackSettingsView().cancel_changes.get_element(), 'true', "Cancel changes button")) logger.info(OpenstackSettingsView().load_defaults.click_and_wait()) logger.info(VerifyBot().verify_disabled( OpenstackSettingsView().cancel_changes.get_element(), None, "Cancel changes button")) logger.info(VerifyBot().verify_disabled( OpenstackSettingsView().save_settings.get_element(), None, "Save settings button"))
def test_deploy_concurrent_deployment_3_environments(self): PoteenLogger.add_test_case( "Concurrent simple deployment 3 environments") clusters = { "cluster1": { "name": "Test environment 1", "controllers": ["VirtualBox"], "computes": ["Supermicro X9DRW"] }, "cluster2": { "name": "Test environment 2", "controllers": ["Supermicro X9SCD"], "computes": ["KVM"] }, "cluster3": { "name": "Test environment 3", "controllers": ["Dell Inspiron"], "computes": ["Supermicro X9DRW (srv07)"] } } logger.info(Main().navigate()) logger.info(Cluster_BrowseView().remove_all()) for cluster_key, cluster_info in clusters.iteritems(): logger.info(Main().navigate()) # create cluster logger.info( Cluster_BrowseView().click_add_new_cluster(cluster_key)) logger.info(CreateEnvironmentDialog().create_environment({ "name": "Test environment", "version": OPENSTACK_CURRENT_VERSION, "deployment_mode": Cluster.DEPLOYMENT_MODE_MULTI_NODE })) logger.info(Cluster_BrowseView().select_by_key(cluster_key)) logger.info(Cluster_Nodes_View().click_add_nodes()) logger.info(Cluster_Nodes_View().assign_roles_to_nodes( ['controller'], cluster_info['controllers'])) logger.info(Cluster_Nodes_View().click_add_nodes()) logger.info(Cluster_Nodes_View().assign_roles_to_nodes( ['compute'], cluster_info['computes'])) logger.info(Cluster_Nodes_View().verify_nodes( 'controller', cluster_info['controllers'])) logger.info(Cluster_Nodes_View().verify_nodes( 'compute', cluster_info['computes'])) for cluster_key, cluster_info in clusters.iteritems(): logger.info(Main().navigate()) logger.info(Cluster_BrowseView().select_by_key(cluster_key)) logger.info(Cluster_View().click_deploy_changes()) logger.info(DeployChangesDialog().deploy()) for cluster_key, cluster_info in clusters.iteritems(): logger.info(Main().navigate()) logger.info(Cluster_BrowseView().select_by_key(cluster_key)) logger.info(Cluster_View().wait_deployment_done( DEFAULT_DEPLOYMENT_TIMEOUT_UI)) logger.info(Cluster_View().verify_successful_deployment_per_name( cluster_info['name']))
def test_form(self): PoteenLogger.add_test_case("Check openstack settings page") cluster_key = "cluster" logger.info(Main().navigate()) logger.info(Cluster_BrowseView().remove_all()) # create cluster logger.info(Cluster_BrowseView().click_add_new_cluster(cluster_key)) logger.info(CreateEnvironmentDialog().create_environment({ "name": "Test environment", "version": OPENSTACK_CURRENT_VERSION, "deployment_mode": Cluster.DEPLOYMENT_MODE_MULTI_NODE })) logger.info(Cluster_BrowseView().select_by_key(cluster_key)) logger.info(Cluster_View().click_openstack_settings_tab()) logger.info(VerifyBot().verify_disabled( OpenstackSettingsView().load_defaults.get_element(), None, "Load defaults button")) logger.info(VerifyBot().verify_disabled( OpenstackSettingsView().cancel_changes.get_element(), 'true', "Cancel changes button")) logger.info(VerifyBot().verify_disabled( OpenstackSettingsView().save_settings.get_element(), 'true', "Save settings button")) logger.info(OpenstackSettingsView().show_password.click()) logger.info(VerifyBot().verify_disabled( OpenstackSettingsView().cancel_changes.get_element(), 'true', "Cancel changes button")) logger.info(VerifyBot().verify_disabled( OpenstackSettingsView().save_settings.get_element(), 'true', "Save settings button")) logger.info(VerifyBot().verify_disabled( OpenstackSettingsView().load_defaults.get_element(), None, "Load defaults button")) logger.info(VerifyBot().verify_visibility( OpenstackSettingsView().show_password_off.get_element(), True, "Show password button off")) logger.info(OpenstackSettingsView().show_password.click()) logger.info(VerifyBot().verify_visibility( OpenstackSettingsView().show_password_on.get_element(), True, "Show password button on")) logger.info(OpenstackSettingsView().set_parameter_input( "username", "test name")) logger.info(VerifyBot().verify_disabled( OpenstackSettingsView().load_defaults.get_element(), None, "Load defaults button")) logger.info(VerifyBot().verify_disabled( OpenstackSettingsView().save_settings.get_element(), None, "Save settings button")) logger.info(VerifyBot().verify_disabled( OpenstackSettingsView().cancel_changes.get_element(), None, "Cancel changes button")) logger.info(OpenstackSettingsView().set_parameter_input( "username", "admin")) logger.info(VerifyBot().verify_disabled( OpenstackSettingsView().load_defaults.get_element(), None, "Load defaults button")) logger.info(VerifyBot().verify_disabled( OpenstackSettingsView().save_settings.get_element(), 'true', "Save settings button")) logger.info(VerifyBot().verify_disabled( OpenstackSettingsView().cancel_changes.get_element(), 'true', "Cancel changes button")) logger.info(OpenstackSettingsView().set_parameter_input( "username", "test name")) logger.info(Cluster_View().click_network_settings_tab()) logger.info(ConfirmLeavePageDialog().click_stay_on_page()) ConfirmLeavePageDialog().wait_closing() logger.info(OpenstackSettingsView().cancel_changes.click_and_wait()) logger.info(VerifyBot().verify_disabled( OpenstackSettingsView().save_settings.get_element(), 'true', "Save settings button")) logger.info(OpenstackSettingsView().set_parameter_input( "username", "test name")) logger.info(OpenstackSettingsView().save_settings.click_and_wait()) logger.info(VerifyBot().verify_disabled( OpenstackSettingsView().cancel_changes.get_element(), 'true', "Cancel changes button")) logger.info(OpenstackSettingsView().load_defaults.click_and_wait()) logger.info(VerifyBot().verify_disabled( OpenstackSettingsView().cancel_changes.get_element(), None, "Cancel changes button")) logger.info(VerifyBot().verify_disabled( OpenstackSettingsView().save_settings.get_element(), None, "Save settings button"))