def __init__(self): parser = Option_parser() self.console_url = parser.parse_options()['console_url'] self.webdriver_url = parser.parse_options()['web_driver'] self.account = parser.parse_options()['account'] self.user = parser.parse_options()['user_name'] self.password = parser.parse_options()['password'] self.sauce = parser.parse_options()['sauce'] self.browser = parser.parse_options()['browser'] self.version = parser.parse_options()['version'] self.platform = parser.parse_options()['platform'] self.tester = GuiOps(console_url=self.console_url, webdriver_url=self.webdriver_url, sauce=self.sauce, browser=self.browser, version=self.version, platform=self.platform) self.tester.zoom_out()
def __init__(self): parser = Option_parser() self.console_url = parser.parse_options()['console_url'] self.webdriver_url = parser.parse_options()['web_driver'] self.account = parser.parse_options()['account'] self.user = parser.parse_options()['user_name'] self.password = parser.parse_options()['password'] self.sauce = parser.parse_options()['sauce'] self.browser = parser.parse_options()['browser'] self.version = parser.parse_options()['version'] self.platform = parser.parse_options()['platform'] self.tester = GuiOps(console_url=self.console_url, webdriver_url=self.webdriver_url, sauce=self.sauce, browser=self.browser, version=self.version, platform=self.platform) logging.basicConfig(format='%(asctime)s %(message)s')
class Navigation_sequence(GuiOps): def id_generator(self, size = 6, chars=string.ascii_uppercase + string.digits): return ''.join(random.choice(chars) for _ in range(size)) def __init__(self): parser = Option_parser() self.console_url = parser.parse_options()['console_url'] self.webdriver_url = parser.parse_options()['web_driver'] self.account = parser.parse_options()['account'] self.user = parser.parse_options()['user_name'] self.password = parser.parse_options()['password'] self.sauce = parser.parse_options()['sauce'] self.browser = parser.parse_options()['browser'] self.version = parser.parse_options()['version'] self.platform = parser.parse_options()['platform'] self.tester = GuiOps(console_url=self.console_url, webdriver_url=self.webdriver_url, sauce=self.sauce, browser=self.browser, version=self.version, platform=self.platform) logging.basicConfig(format='%(asctime)s %(message)s') def navigation_test(self): self.tester.login(self.account, self.user, self.password) self.tester.goto_images_page_via_nav() self.tester.logout() self.tester.exit_browser()
def __init__(self): parser = Option_parser() options = parser.parse_options() self.console_url = options['console_url'] self.webdriver_url = options['web_driver'] self.account = options['account'] self.user = options['user_name'] self.password = options['password'] self.sauce = options['sauce'] self.browser = options['browser'] self.version = options['version'] self.platform = options['platform'] self.zones = self.get_zones_from_options(options) self.zone1 = self.zones.get(0) self.zone2 = self.zones.get(1, self.zones.get(0)) self.tester = GuiOps(console_url=self.console_url, webdriver_url=self.webdriver_url, sauce=self.sauce, browser=self.browser, version=self.version, platform=self.platform)
def __init__(self): parser = Option_parser() self.console_url = parser.parse_options()['console_url'] self.webdriver_url = parser.parse_options()['web_driver'] self.account = parser.parse_options()['account'] self.user = parser.parse_options()['user_name'] self.password = parser.parse_options()['password'] self.sauce = parser.parse_options()['sauce'] self.browser = parser.parse_options()['browser'] self.version = parser.parse_options()['version'] self.platform = parser.parse_options()['platform'] self.tester = GuiOps(console_url=self.console_url, webdriver_url=self.webdriver_url, sauce=self.sauce, browser=self.browser, version=self.version, platform=self.platform)
class Resource_operations_sequence(GuiOps): def __init__(self): parser = Option_parser() self.console_url = parser.parse_options()['console_url'] self.webdriver_url = parser.parse_options()['web_driver'] self.account = parser.parse_options()['account'] self.user = parser.parse_options()['user_name'] self.password = parser.parse_options()['password'] self.sauce = parser.parse_options()['sauce'] self.browser = parser.parse_options()['browser'] self.version = parser.parse_options()['version'] self.platform = parser.parse_options()['platform'] self.tester = GuiOps(console_url=self.console_url, webdriver_url=self.webdriver_url, sauce=self.sauce, browser=self.browser, version=self.version, platform=self.platform) def resource_ops_test(self): self.tester.login(self.account, self.user, self.password) resource_name = self.id_generator() + "-resource" # Add your tests here use existing tests like instances.py for reference self.tester.logout() self.tester.exit_browser()
def __init__(self): parser = Option_parser() self.console_url = parser.parse_options()['console_url'] self.webdriver_url = parser.parse_options()['web_driver'] self.account = parser.parse_options()['account'] self.user = parser.parse_options()['user_name'] self.password = parser.parse_options()['password'] self.sauce = parser.parse_options()['sauce'] self.browser = parser.parse_options()['browser'] self.version = parser.parse_options()['version'] self.platform = parser.parse_options()['platform'] self.tester = GuiOps(console_url=self.console_url, webdriver_url=self.webdriver_url, sauce=self.sauce, browser=self.browser, version=self.version, platform=self.platform) logging.basicConfig(format='%(asctime)s %(message)s') self.tester.zoom_out()
def __init__(self): parser = Option_parser() options = parser.parse_options() self.console_url = options['console_url'] self.webdriver_url = options['web_driver'] self.account = options['account'] self.user = options['user_name'] self.password = options['password'] self.sauce = options['sauce'] self.browser = options['browser'] self.version = options['version'] self.platform = options['platform'] self.zones = self.get_zones_from_options(options) self.zone1 = self.zones.get(0) self.tester = GuiOps(console_url=self.console_url, webdriver_url=self.webdriver_url, sauce=self.sauce, browser=self.browser, version=self.version, platform=self.platform)
def __init__(self): parser = Option_parser() self.console_url = parser.parse_options()["console_url"] self.webdriver_url = parser.parse_options()["web_driver"] self.account = parser.parse_options()["account"] self.user = parser.parse_options()["user_name"] self.password = parser.parse_options()["password"] self.sauce = parser.parse_options()["sauce"] self.browser = parser.parse_options()["browser"] self.version = parser.parse_options()["version"] self.platform = parser.parse_options()["platform"] self.tester = GuiOps( console_url=self.console_url, webdriver_url=self.webdriver_url, sauce=self.sauce, browser=self.browser, version=self.version, platform=self.platform, )
class Resource_operations_sequence(GuiOps): def __init__(self): parser = Option_parser() self.console_url = parser.parse_options()['console_url'] self.webdriver_url = parser.parse_options()['web_driver'] self.account = parser.parse_options()['account'] self.user = parser.parse_options()['user_name'] self.password = parser.parse_options()['password'] self.sauce = parser.parse_options()['sauce'] self.browser = parser.parse_options()['browser'] self.version = parser.parse_options()['version'] self.platform = parser.parse_options()['platform'] self.tester = GuiOps(console_url=self.console_url, webdriver_url=self.webdriver_url, sauce=self.sauce, browser=self.browser, version=self.version, platform=self.platform) def resource_ops_test(self): self.tester.login(self.account, self.user, self.password) resource_name = self.id_generator()+"-resource" # Add your tests here use existing tests like instances.py for reference self.tester.logout() self.tester.exit_browser()
class Keypair_operations_sequence(GuiOps): keypair = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDI1x6tEjkBQCCP0ssF69vAgP2xg+N9ScoTrqRqyl5w4qEgsV/AppfHHYRKYr0N/tTyG4/" \ "z1XGNrB2SaslnRpgEOsvMZldlOnqsUujL2fgoEg+/gB92+1JhZgTjU8nL5j5BFkVTh93nSHtXHdzYl7SjlXrv26ZbyuDwJmI+s6bJQk5noJ4Q4g" \ "7N/0y9pHRvezyhgxkyX7PQoA9WJm8SqlakyhMYa0j/baMhb/ehSI0VvwNodmcaWaS6Z2F4rZS4C2DmCUDXYy/1+0tiRTjHjlPbqRKCVKam8ImWy" \ "tlZD0zbdV/tpADxDpnhW2cPVpXcjy4sRzUCc8AZW+OE3LQxXild [email protected]" def __init__(self): parser = Option_parser() self.console_url = parser.parse_options()['console_url'] self.webdriver_url = parser.parse_options()['web_driver'] self.account = parser.parse_options()['account'] self.user = parser.parse_options()['user_name'] self.password = parser.parse_options()['password'] self.sauce = parser.parse_options()['sauce'] self.browser = parser.parse_options()['browser'] self.version = parser.parse_options()['version'] self.platform = parser.parse_options()['platform'] self.tester = GuiOps(console_url=self.console_url, webdriver_url=self.webdriver_url, sauce=self.sauce, browser=self.browser, version=self.version, platform=self.platform) logging.basicConfig(format='%(asctime)s %(message)s') self.tester.zoom_out() def keypair_ops_test(self): keypair1_name=self.id_generator()+"-key" self.tester.login(self.account, self.user, self.password) self.tester.create_keypair_from_keypair_view_page(keypair1_name) self.tester.delete_keypair_from_detail_page(keypair1_name) keypair2_name=self.id_generator()+"-key" self.tester.create_keypair_from_dashboard(keypair2_name) self.tester.delete_keypair_from_view_page(keypair2_name) keypair3_name=self.id_generator()+"-key" self.tester.import_keypair(self.keypair, keypair3_name) self.tester.delete_keypair_from_detail_page(keypair3_name) self.tester.logout() self.tester.exit_browser()
class ElasticIPsOperationsSequence(GuiOps): def __init__(self): parser = Option_parser() self.console_url = parser.parse_options()['console_url'] self.webdriver_url = parser.parse_options()['web_driver'] self.account = parser.parse_options()['account'] self.user = parser.parse_options()['user_name'] self.password = parser.parse_options()['password'] self.sauce = parser.parse_options()['sauce'] self.browser = parser.parse_options()['browser'] self.version = parser.parse_options()['version'] self.platform = parser.parse_options()['platform'] self.tester = GuiOps(console_url=self.console_url, webdriver_url=self.webdriver_url, sauce=self.sauce, browser=self.browser, version=self.version, platform=self.platform) self.tester.zoom_out() def elastic_ip_ops_test(self): self.tester.login(self.account, self.user, self.password) self.elastic_ip_single_allocate_release_test_from_lp() self.elastic_ips_multi_allocate_release_test_from_dashboard() self.elastic_ips_associate_disassociate_ip() self.tester.logout() self.tester.exit_browser() def elastic_ip_single_allocate_release_test_from_lp(self): elastic_ips = self.tester.allocate_eip_from_lp(1) self.tester.release_eip_from_eip_lp(elastic_ips[0]) def elastic_ips_multi_allocate_release_test_from_dashboard(self): elastic_ips = self.tester.allocate_eip_from_dashboard(2) released_ips = self.tester.release_eips_from_eip_lp(elastic_ips) assert elastic_ips == released_ips def elastic_ips_associate_disassociate_ip(self): elastic_ip = self.tester.allocate_eip_from_dashboard(1) elastic_ip = str(elastic_ip[0]) launch_instance = self.tester.launch_instance_from_dashboard( instance_type="m1.medium") instance_id = launch_instance['instance_id'] self.tester.associate_eip_from_eip_lp(elastic_ip, instance_id) self.tester.disassociate_eip_from_eip_lp(elastic_ip, instance_id) self.tester.associate_eip_from_eip_detail_page(elastic_ip, instance_id) self.tester.disassociate_eip_from_eip_detail_page( elastic_ip, instance_id) self.tester.associate_eip_from_instances_lp(elastic_ip, instance_id) self.tester.disassociate_eip_from_instances_lp(elastic_ip, instance_id) self.tester.associate_eip_from_instance_detail_page( elastic_ip, instance_id) self.tester.disassociate_eip_from_instance_detail_page( elastic_ip, instance_id) self.tester.terminate_instance_from_view_page(instance_id) self.tester.release_eip_from_eip_lp(elastic_ip)
class Instance_operations_sequence(GuiOps): def __init__(self): parser = Option_parser() self.console_url = parser.parse_options()['console_url'] self.webdriver_url = parser.parse_options()['web_driver'] self.account = parser.parse_options()['account'] self.user = parser.parse_options()['user_name'] self.password = parser.parse_options()['password'] self.sauce = parser.parse_options()['sauce'] self.browser = parser.parse_options()['browser'] self.version = parser.parse_options()['version'] self.platform = parser.parse_options()['platform'] self.tester = GuiOps(console_url=self.console_url, webdriver_url=self.webdriver_url, sauce=self.sauce, browser=self.browser, version=self.version, platform=self.platform) def id_generator(self, size = 6, chars=string.ascii_uppercase + string.digits): return ''.join(random.choice(chars) for j in range(size)) def instance_ops_test(self): self.tester.login(self.account, self.user, self.password) s_group1_name = self.id_generator()+"-group" s_group1=self.tester.create_security_group_from_view_page(s_group1_name, "Security group created by instance test") s_group1_id = s_group1.get("s_group_id") keypair1_name = self.id_generator()+"-key-pair" self.tester.create_keypair_from_dashboard(keypair1_name) instance1_name = self.id_generator()+"-instance" instance1 = self.tester.launch_instance_from_image_view_page(image_id_or_type="centos", instance_name=instance1_name, instance_type= "m1.medium", security_group=s_group1_name, key_name=keypair1_name) instance1_id = instance1.get("instance_id") instance2_name = self.id_generator()+"-instance" instance2 = self.tester.launch_more_like_this_from_view_page(inatance_id=instance1_id, instance_name=instance2_name) instance2_id = instance2.get("instance_id") self.tester.terminate_instance_from_view_page(instance2_id, instance2_name) self.tester.launch_more_like_this_from_detail_page(instance2_id, monitoring=True, user_data="Test user data.") self.tester.terminate_instance_from_detail_page(instance1_id) instance3_name = self.id_generator()+"-instance" instance3=self.tester.launch_instance_from_dashboard(image="centos", instance_name=instance3_name, availability_zone="one", instance_type= "m1.small",security_group=s_group1_name, key_name=keypair1_name) instance3_id = instance3.get("instance_id") self.tester.terminate_instance_from_detail_page(instance3_id) self.tester.batch_terminate_all_instances() instance4 = self.tester.launch_instance_from_dashboard(image="centos", availability_zone="one", instance_type= "m1.large") instance4_id = instance4.get("instance_id") self.tester.terminate_instance_from_view_page(instance_id=instance4_id) self.tester.delete_keypair_from_detail_page(keypair1_name) self.tester.delete_security_group_from_view_page(s_group1_name, s_group1_id) self.tester.logout() self.tester.exit_browser()
class ElasticIPsOperationsSequence(GuiOps): def __init__(self): parser = Option_parser() self.console_url = parser.parse_options()['console_url'] self.webdriver_url = parser.parse_options()['web_driver'] self.account = parser.parse_options()['account'] self.user = parser.parse_options()['user_name'] self.password = parser.parse_options()['password'] self.sauce = parser.parse_options()['sauce'] self.browser = parser.parse_options()['browser'] self.version = parser.parse_options()['version'] self.platform = parser.parse_options()['platform'] self.tester = GuiOps(console_url=self.console_url, webdriver_url=self.webdriver_url, sauce=self.sauce, browser=self.browser, version=self.version, platform=self.platform) def elastic_ip_ops_test(self): self.tester.login(self.account, self.user, self.password) self.elastic_ip_single_allocate_release_test_from_lp() self.elastic_ips_multi_allocate_release_test_from_dashboard() self.elastic_ips_associate_disassociate_ip() self.tester.logout() self.tester.exit_browser() def elastic_ip_single_allocate_release_test_from_lp(self): elastic_ips = self.tester.allocate_eip_from_lp(1) self.tester.release_eip_from_eip_lp(elastic_ips[0]) def elastic_ips_multi_allocate_release_test_from_dashboard(self): elastic_ips = self.tester.allocate_eip_from_dashboard(2) released_ips = self.tester.release_eips_from_eip_lp(elastic_ips) assert elastic_ips == released_ips def elastic_ips_associate_disassociate_ip(self): elastic_ip = self.tester.allocate_eip_from_dashboard(1) elastic_ip = str(elastic_ip[0]) launch_instance = self.tester.launch_instance_from_dashboard(instance_type="m1.medium") instance_id = launch_instance['instance_id'] self.tester.associate_eip_from_eip_lp(elastic_ip, instance_id) self.tester.disassociate_eip_from_eip_lp(elastic_ip, instance_id) self.tester.associate_eip_from_eip_detail_page(elastic_ip, instance_id) self.tester.disassociate_eip_from_eip_detail_page(elastic_ip, instance_id) self.tester.associate_eip_from_instances_lp(elastic_ip, instance_id) self.tester.disassociate_eip_from_instances_lp(elastic_ip, instance_id) self.tester.associate_eip_from_instance_detail_page(elastic_ip, instance_id) self.tester.disassociate_eip_from_instance_detail_page(elastic_ip, instance_id) self.tester.terminate_instance_from_view_page(instance_id) self.tester.release_eip_from_eip_lp(elastic_ip)
class InstanceOperationsSequence(GuiOps): def __init__(self): parser = Option_parser() options = parser.parse_options() self.console_url = options['console_url'] self.webdriver_url = options['web_driver'] self.account = options['account'] self.user = options['user_name'] self.password = options['password'] self.sauce = options['sauce'] self.browser = options['browser'] self.version = options['version'] self.platform = options['platform'] self.zones = self.get_zones_from_options(options) self.zone1 = self.zones.get(0) self.tester = GuiOps(console_url=self.console_url, webdriver_url=self.webdriver_url, sauce=self.sauce, browser=self.browser, version=self.version, platform=self.platform) def instance_ops_test(self): self.tester.login(self.account, self.user, self.password) keypair1_name = self.id_generator()+"-key-pair" self.tester.create_keypair_from_dashboard(keypair1_name) s_group1_name = self.id_generator() + "-group" s_group1 = self.tester.create_security_group_from_view_page( s_group1_name, "Security group created by instance test") s_group1_id = s_group1.get("s_group_id") instance1_name = self.id_generator() + "-instance" instance1 = self.tester.launch_instance_from_image_view_page( image_id_or_type="centos", instance_name=instance1_name, instance_type="m1.medium", security_group=s_group1_name, key_name=keypair1_name, timeout_in_seconds=480) instance1_id = instance1.get("instance_id") instance2_name = self.id_generator() + "-instance" instance2 = self.tester.launch_more_like_this_from_view_page( instance_id=instance1_id, instance_name=instance2_name, timeout_in_seconds=480) instance2_id = instance2.get("instance_id") self.tester.terminate_instance_from_view_page(instance2_id, instance2_name,timeout_in_seconds=480) self.tester.launch_more_like_this_from_detail_page(instance2_id, monitoring=True, user_data="Test user data.") self.tester.terminate_instance_from_detail_page(instance1_id, timeout_in_seconds=480) instance3_name = self.id_generator() + "-instance" instance3 = self.tester.launch_instance_from_dashboard( image="centos", instance_name=instance3_name, availability_zone=self.zone1, instance_type="m1.small", security_group=s_group1_name, key_name=keypair1_name, timeout_in_seconds=480) instance3_id = instance3.get("instance_id") self.tester.terminate_instance_from_detail_page(instance3_id,timeout_in_seconds=480) self.tester.batch_terminate_all_instances() instance4 = self.tester.launch_instance_from_dashboard( image="centos", availability_zone=self.zone1, instance_type="m1.large", timeout_in_seconds=480) instance4_id = instance4.get("instance_id") self.tester.terminate_instance_from_view_page(instance_id=instance4_id, timeout_in_seconds=480) self.tester.delete_keypair_from_detail_page(keypair1_name) self.tester.delete_security_group_from_view_page(s_group1_name, s_group1_id) self.tester.logout() self.tester.exit_browser()
class Stack_operations_sequence(GuiOps): TEMPLATE_URL = 'https://raw.githubusercontent.com/eucalyptus/eucaconsole/19b2a55ce33e0d76567bff9541319bb7b51e18d4/eucaconsole/cf-templates/Euca%20Stacks/Basic%20Instance.json' def __init__(self): parser = Option_parser() self.console_url = parser.parse_options()['console_url'] self.webdriver_url = parser.parse_options()['web_driver'] self.account = parser.parse_options()['account'] self.user = parser.parse_options()['user_name'] self.password = parser.parse_options()['password'] self.sauce = parser.parse_options()['sauce'] self.browser = parser.parse_options()['browser'] self.version = parser.parse_options()['version'] self.platform = parser.parse_options()['platform'] self.tester = GuiOps(console_url=self.console_url, webdriver_url=self.webdriver_url, sauce=self.sauce, browser=self.browser, version=self.version, platform=self.platform) def stack_ops_test(self): self.tester.login(self.account, self.user, self.password) keypair_name = self.id_generator() + "-keypair" self.tester.create_keypair_from_dashboard(keypair_name) # test stack from sample stack1_name = "test-" + self.id_generator() + "-stack" self.tester.create_stack_from_dashboard(stack1_name) stack2_name = "test-" + self.id_generator() + "-stack" self.tester.create_stack_from_lp(stack2_name) # update a stack self.tester.update_stack_from_lp(stack2_name) # delete the stacks self.tester.delete_stack_from_lp(stack1_name) self.tester.delete_stack_from_detail_page(stack2_name) #test stack from uploaded template stack3_name = "test-" + self.id_generator() + "-stack" self.tester.create_stack_from_dashboard(stack3_name, template_url=self.TEMPLATE_URL) self.tester.delete_stack_from_lp(stack3_name) self.tester.delete_keypair_from_detail_page(keypair_name) self.tester.logout() self.tester.exit_browser()
class ElasticIPsOperationsSequence(GuiOps): def __init__(self): parser = Option_parser() self.console_url = parser.parse_options()['console_url'] self.webdriver_url = parser.parse_options()['web_driver'] self.account = parser.parse_options()['account'] self.user = parser.parse_options()['user_name'] self.password = parser.parse_options()['password'] self.sauce = parser.parse_options()['sauce'] self.browser = parser.parse_options()['browser'] self.version = parser.parse_options()['version'] self.platform = parser.parse_options()['platform'] self.tester = GuiOps(console_url=self.console_url, webdriver_url=self.webdriver_url, sauce=self.sauce, browser=self.browser, version=self.version, platform=self.platform) def elastic_ip_ops_test(self): self.tester.login(self.account, self.user, self.password) self.elastic_ip_single_allocate_release_test_from_lp() self.elastic_ips_multi_allocate_release_test_from_dashboard() self.tester.logout() self.tester.exit_browser() def elastic_ip_single_allocate_release_test_from_lp(self): elastic_ips = self.tester.allocate_eip_from_lp(1) self.tester.release_eip_from_eip_lp(elastic_ips[0]) def elastic_ips_multi_allocate_release_test_from_dashboard(self): elastic_ips = self.tester.allocate_eip_from_dashboard(2) released_ips = self.tester.release_eips_from_eip_lp(elastic_ips) assert elastic_ips == released_ips
class VolumeOperationsSequence(GuiOps): def __init__(self): parser = Option_parser() options = parser.parse_options() self.console_url = options['console_url'] self.webdriver_url = options['web_driver'] self.account = options['account'] self.user = options['user_name'] self.password = options['password'] self.sauce = options['sauce'] self.browser = options['browser'] self.version = options['version'] self.platform = options['platform'] self.zones = self.get_zones_from_options(options) self.zone1 = self.zones.get(0) self.zone2 = self.zones.get(1, self.zones.get(0)) self.tester = GuiOps(console_url=self.console_url, webdriver_url=self.webdriver_url, sauce=self.sauce, browser=self.browser, version=self.version, platform=self.platform) self.tester.zoom_out() def volume_ops_test(self): self.tester.login(self.account, self.user, self.password) volume1_name = self.id_generator()+"-volume" volume1 = self.tester.create_volume_from_view_page(volume1_name, volume_size=2, availability_zone=self.zone1) volume1_id = volume1.get("volume_id") instance1 = self.tester.launch_instance_from_dashboard(availability_zone=self.zone1, timeout_in_seconds=400) instance1_id = instance1.get("instance_id") self.tester.verify_attach_notice_on_volume_monitoring_page(volume1_id) self.tester.attach_volume_from_instance_detail_page(volume1_id, instance1_id, timeout_in_seconds=400) self.tester.verify_charts_on_volume_monitoring_page(volume1_id) self.tester.detach_volume_from_volumes_lp(volume1_id, timeout_in_seconds=800) self.tester.attach_volume_from_instance_lp(volume1_id, instance1_id, timeout_in_seconds=800) self.tester.detach_volume_from_volumes_lp(volume1_id, timeout_in_seconds=800) self.tester.attach_volume_from_volume_detail_page(instance1_id, volume1_id, device="/dev/vdd", timeout_in_seconds=800) self.tester.detach_volume_from_volumes_lp(volume1_id, timeout_in_seconds=800) self.tester.attach_volume_from_volume_lp(instance1_id, volume1_id, timeout_in_seconds=800) self.tester.terminate_instance_from_view_page(instance1_id) self.tester.delete_volume_from_view_page(volume1_id) volume2 = self.tester.create_volume_from_dashboard(volume_size=3, availability_zone=self.zone2) volume2_id = volume2.get("volume_id") self.tester.delete_volume_from_detail_page(volume2_id) self.sortable_volumes_tables_test() self.tester.logout() self.tester.exit_browser() def sortable_volumes_tables_test(self): volume1_name = "!!!!"+self.id_generator()+"-volume" volume1 = self.tester.create_volume_from_view_page(volume1_name, volume_size=1, availability_zone=self.zone1) volume1_id = volume1.get("volume_id") volume2_name = "~~~~"+self.id_generator()+"-volume" volume2 = self.tester.create_volume_from_dashboard(volume2_name, volume_size=1, availability_zone=self.zone1) volume2_id = volume2.get("volume_id") # Test ascending sort by name column self.tester.click_sortable_column_header_on_volumes_landing_page(column_name='name') self.tester.verify_sort_position_for_volume(volume1_id, position=1) # Test descending sort by name column (second click sorts descending) self.tester.click_sortable_column_header_on_volumes_landing_page(column_name='name') self.tester.verify_sort_position_for_volume(volume2_id, position=1) # Cleanup volumes self.tester.delete_volume_from_view_page(volume1_id) self.tester.delete_volume_from_view_page(volume2_id)
class Keypair_operations_sequence(GuiOps): keypair = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDI1x6tEjkBQCCP0ssF69vAgP2xg+N9ScoTrqRqyl5w4qEgsV/AppfHHYRKYr0N/tTyG4/" \ "z1XGNrB2SaslnRpgEOsvMZldlOnqsUujL2fgoEg+/gB92+1JhZgTjU8nL5j5BFkVTh93nSHtXHdzYl7SjlXrv26ZbyuDwJmI+s6bJQk5noJ4Q4g" \ "7N/0y9pHRvezyhgxkyX7PQoA9WJm8SqlakyhMYa0j/baMhb/ehSI0VvwNodmcaWaS6Z2F4rZS4C2DmCUDXYy/1+0tiRTjHjlPbqRKCVKam8ImWy" \ "tlZD0zbdV/tpADxDpnhW2cPVpXcjy4sRzUCc8AZW+OE3LQxXild [email protected]" def __init__(self): parser = Option_parser() self.console_url = parser.parse_options()['console_url'] self.webdriver_url = parser.parse_options()['web_driver'] self.account = parser.parse_options()['account'] self.user = parser.parse_options()['user_name'] self.password = parser.parse_options()['password'] self.sauce = parser.parse_options()['sauce'] self.browser = parser.parse_options()['browser'] self.version = parser.parse_options()['version'] self.platform = parser.parse_options()['platform'] self.tester = GuiOps(console_url=self.console_url, webdriver_url=self.webdriver_url, sauce=self.sauce, browser=self.browser, version=self.version, platform=self.platform) logging.basicConfig(format='%(asctime)s %(message)s') self.tester.zoom_out() def keypair_ops_test(self): keypair1_name = self.id_generator() + "-key" self.tester.login(self.account, self.user, self.password) self.tester.create_keypair_from_keypair_view_page(keypair1_name) self.tester.delete_keypair_from_detail_page(keypair1_name) keypair2_name = self.id_generator() + "-key" self.tester.create_keypair_from_dashboard(keypair2_name) self.tester.delete_keypair_from_view_page(keypair2_name) keypair3_name = self.id_generator() + "-key" self.tester.import_keypair(self.keypair, keypair3_name) self.tester.delete_keypair_from_detail_page(keypair3_name) self.tester.logout() self.tester.exit_browser()
class AutoScalingOperationsSequence(GuiOps): def __init__(self): parser = Option_parser() self.console_url = parser.parse_options()['console_url'] self.webdriver_url = parser.parse_options()['web_driver'] self.account = parser.parse_options()['account'] self.user = parser.parse_options()['user_name'] self.password = parser.parse_options()['password'] self.sauce = parser.parse_options()['sauce'] self.browser = parser.parse_options()['browser'] self.version = parser.parse_options()['version'] self.platform = parser.parse_options()['platform'] self.tester = GuiOps(console_url=self.console_url, webdriver_url=self.webdriver_url, sauce=self.sauce, browser=self.browser, version=self.version, platform=self.platform) logging.basicConfig(format='%(asctime)s %(message)s') self.tester.zoom_out() def asg_ops_test(self): self.tester.login(self.account, self.user, self.password) launchconfig1_name = self.id_generator() + "-launch-config" scalinggroup1_name = self.id_generator() + "-auto-scaling-group" self.tester.create_launch_config_and_asg_from_lc_lp(lc_name=launchconfig1_name, asg_name=scalinggroup1_name, max_capacity=2, desired_capacity=1, min_cpapacity=0) self.tester.delete_asg_from_lp(scalinggroup1_name) scalinggroup2_name = self.id_generator() + "-auto-scaling-group" self.tester.create_asg_from_asg_lp(launch_config_name=launchconfig1_name, asg_name=scalinggroup2_name) self.tester.delete_asg_from_lp(scalinggroup2_name) self.tester.delete_launch_config_from_lp(launchconfig1_name) launchconfig2_name = self.id_generator() + "-launch-config" self.tester.create_launch_config_from_lc_lp(launchconfig2_name) self.tester.create_asg_from_dashboard(launch_config_name=launchconfig2_name, asg_name=scalinggroup2_name, min_capacity=1, desired_capacity=1, max_capacity=1) self.tester.verify_scaling_history(scalinggroup2_name) self.tester.set_scaling_group_capacity(scalinggroup2_name, 0, 0, 1) self.tester.delete_asg_from_lp(scalinggroup2_name) self.tester.delete_launch_config_from_lp(launchconfig2_name) self.test_scaling_group_monitoring_page_with_monitoring_enabled() self.tester.logout() self.tester.exit_browser() def test_scaling_group_monitoring_page_with_monitoring_enabled(self): """Scaling group monitoring page should display charts when metrics collection is enabled and its launch config has monitoring enabled""" launchconfig3_name = self.id_generator() + "-launch-config" scalinggroup3_name = self.id_generator() + "-auto-scaling-group" self.tester.create_launch_config_and_asg_from_lc_lp( lc_name=launchconfig3_name, asg_name=scalinggroup3_name, enable_monitoring=True) self.tester.enable_metrics_collection_for_auto_scaling_group(scalinggroup3_name) self.tester.verify_charts_on_scaling_group_monitoring_page(scalinggroup3_name) self.tester.delete_asg_from_lp(scalinggroup3_name) self.tester.delete_launch_config_from_lp(launchconfig3_name)
class Snapshot_operations_sequence(GuiOps): def __init__(self): parser = Option_parser() self.console_url = parser.parse_options()['console_url'] self.webdriver_url = parser.parse_options()['web_driver'] self.account = parser.parse_options()['account'] self.user = parser.parse_options()['user_name'] self.password = parser.parse_options()['password'] self.sauce = parser.parse_options()['sauce'] self.browser = parser.parse_options()['browser'] self.version = parser.parse_options()['version'] self.platform = parser.parse_options()['platform'] self.tester = GuiOps(console_url=self.console_url, webdriver_url=self.webdriver_url, sauce=self.sauce, browser=self.browser, version=self.version, platform=self.platform) def snapshot_ops_test(self): self.tester.login(self.account, self.user, self.password) volume1_name = self.id_generator() + "-volume" volume1 = self.tester.create_volume_from_view_page( volume1_name, availability_zone="one") volume1_id = volume1.get("volume_id") snapshot1 = self.tester.create_snapshot_on_volumes_view_page( volume1_id, snapshot_description="Created by snapshot operations test") snapshot1_id = snapshot1.get("snapshot_id") snapshot2_name = self.id_generator() + "-snapshot" snapshot2 = self.tester.create_snapshot_from_dashboard( volume1_id, snapshot2_name, "Created by snapshot operations test") snapshot2_id = snapshot2.get("snapshot_id") instance1 = self.tester.launch_instance_from_dashboard( availability_zone="one") instance1_id = instance1.get("instance_id") self.tester.attach_volume_from_instance_lp(volume1_id, instance1_id, device="/dev/vdg") snapshot3_name = self.id_generator() + "-snapshot" snapshot3 = self.tester.create_snapshot_on_snapshot_view_page( volume1_id, snapshot3_name, "Created by snapshot operations test") snapshot3_id = snapshot3.get("snapshot_id") image1 = self.tester.register_snapshot_as_an_image_from_snapshot_landing_page( snapshot3_id, self.id_generator() + "-image") image1_id = image1.get("image_id") self.tester.remove_image_from_cloud_on_images_lp(image1_id) volume2 = self.tester.create_volume_from_snapshot_on_snapshot_lp( snapshot3_id, availability_zone="one") volume2_id = volume2.get("volume_id") self.tester.delete_volume_from_view_page(volume2_id) volume3_name = self.id_generator() + "-volume" volume3 = self.tester.create_volume_from_snapshot_on_snapshot_detail_page( snapshot3_id, volume_name=volume3_name, availability_zone="one") volume3_id = volume3.get("volume_id") self.tester.delete_volume_from_detail_page(volume3_id) snapshot4 = self.tester.create_snapshot_on_volumes_view_page( volume1_id) snapshot4_id = snapshot4.get("snapshot_id") image2 = self.tester.register_snapshot_as_an_image_from_snapshot_detail_page( snapshot4_id, self.id_generator() + "-image", description="Created by guitester automated snapshot test", register_as_windows_image=True) image2_id = image2.get("image_id") self.tester.remove_image_from_cloud_on_images_lp( image2_id, delete_associated_snapshot=True) self.tester.verify_snapshot_not_present_on_lp(snapshot4_id) self.tester.delete_snapshot_from_detail_page(snapshot1_id) self.tester.delete_snapshot_from_landing_page(snapshot2_id) self.tester.delete_snapshot_from_landing_page(snapshot3_id) self.tester.terminate_instance_from_view_page(instance1_id) self.tester.delete_volume_from_view_page(volume1_id) self.tester.logout() self.tester.exit_browser()
class InstanceOperationsSequence(GuiOps): def __init__(self): parser = Option_parser() options = parser.parse_options() self.console_url = options['console_url'] self.webdriver_url = options['web_driver'] self.account = options['account'] self.user = options['user_name'] self.password = options['password'] self.sauce = options['sauce'] self.browser = options['browser'] self.version = options['version'] self.platform = options['platform'] self.zones = self.get_zones_from_options(options) self.zone1 = self.zones.get(0) self.tester = GuiOps(console_url=self.console_url, webdriver_url=self.webdriver_url, sauce=self.sauce, browser=self.browser, version=self.version, platform=self.platform) def instance_ops_test(self): self.tester.login(self.account, self.user, self.password) keypair1_name = self.id_generator() + "-key-pair" self.tester.create_keypair_from_dashboard(keypair1_name) s_group1_name = self.id_generator() + "-group" s_group1 = self.tester.create_security_group_from_view_page( s_group1_name, "Security group created by instance test") s_group1_id = s_group1.get("s_group_id") instance1_name = self.id_generator() + "-instance" instance1 = self.tester.launch_instance_from_image_view_page( image_id_or_type="centos", instance_name=instance1_name, instance_type="m1.medium", security_group=s_group1_name, key_name=keypair1_name, timeout_in_seconds=480) instance1_id = instance1.get("instance_id") instance2_name = self.id_generator() + "-instance" instance2 = self.tester.launch_more_like_this_from_view_page( instance_id=instance1_id, instance_name=instance2_name, timeout_in_seconds=480) instance2_id = instance2.get("instance_id") self.tester.terminate_instance_from_view_page(instance2_id, instance2_name, timeout_in_seconds=480) self.tester.launch_more_like_this_from_detail_page( instance2_id, monitoring=True, user_data="Test user data.") self.tester.terminate_instance_from_detail_page(instance1_id, timeout_in_seconds=480) instance3_name = self.id_generator() + "-instance" instance3 = self.tester.launch_instance_from_dashboard( image="centos", instance_name=instance3_name, availability_zone=self.zone1, instance_type="m1.small", security_group=s_group1_name, key_name=keypair1_name, timeout_in_seconds=480) instance3_id = instance3.get("instance_id") self.tester.terminate_instance_from_detail_page(instance3_id, timeout_in_seconds=480) self.tester.batch_terminate_all_instances() instance4 = self.tester.launch_instance_from_dashboard( image="centos", availability_zone=self.zone1, instance_type="m1.large", timeout_in_seconds=480) instance4_id = instance4.get("instance_id") self.tester.terminate_instance_from_view_page(instance_id=instance4_id, timeout_in_seconds=480) self.tester.delete_keypair_from_detail_page(keypair1_name) self.tester.delete_security_group_from_view_page( s_group1_name, s_group1_id) self.tester.logout() self.tester.exit_browser()
class Snapshot_operations_sequence(GuiOps): def __init__(self): parser = Option_parser() self.console_url = parser.parse_options()['console_url'] self.webdriver_url = parser.parse_options()['web_driver'] self.account = parser.parse_options()['account'] self.user = parser.parse_options()['user_name'] self.password = parser.parse_options()['password'] self.sauce = parser.parse_options()['sauce'] self.browser = parser.parse_options()['browser'] self.version = parser.parse_options()['version'] self.platform = parser.parse_options()['platform'] self.tester = GuiOps(console_url=self.console_url, webdriver_url=self.webdriver_url, sauce=self.sauce, browser=self.browser, version=self.version, platform=self.platform) def snapshot_ops_test(self): self.tester.login(self.account, self.user, self.password) volume1_name = self.id_generator()+"-volume" volume1 = self.tester.create_volume_from_view_page(volume1_name, availability_zone="one") volume1_id = volume1.get("volume_id") snapshot1 = self.tester.create_snapshot_on_volumes_view_page(volume1_id, snapshot_description="Created by snapshot operations test") snapshot1_id = snapshot1.get("snapshot_id") snapshot2_name =self.id_generator()+"-snapshot" snapshot2 = self.tester.create_snapshot_from_dashboard(volume1_id, snapshot2_name, "Created by snapshot operations test") snapshot2_id = snapshot2.get("snapshot_id") instance1 = self.tester.launch_instance_from_dashboard(availability_zone="one") instance1_id = instance1.get("instance_id") self.tester.attach_volume_from_instance_lp(volume1_id, instance1_id, device= "/dev/vdg") snapshot3_name =self.id_generator()+"-snapshot" snapshot3 = self.tester.create_snapshot_on_snapshot_view_page(volume1_id, snapshot3_name,"Created by snapshot operations test") snapshot3_id = snapshot3.get("snapshot_id") image1 = self.tester.register_snapshot_as_an_image_from_snapshot_landing_page(snapshot3_id, self.id_generator()+"-image") image1_id = image1.get("image_id") self.tester.remove_image_from_cloud_on_images_lp(image1_id) volume2=self.tester.create_volume_from_snapshot_on_snapshot_lp(snapshot3_id, availability_zone="two") volume2_id=volume2.get("volume_id") self.tester.delete_volume_from_view_page(volume2_id) volume3_name = self.id_generator()+"-volume" volume3=self.tester.create_volume_from_snapshot_on_snapshot_detail_page(snapshot3_id, volume_name=volume3_name, availability_zone="two") volume3_id=volume3.get("volume_id") self.tester.delete_volume_from_detail_page(volume3_id) snapshot4 = self.tester.create_snapshot_on_volumes_view_page(volume1_id) snapshot4_id = snapshot4.get("snapshot_id") image2 = self.tester.register_snapshot_as_an_image_from_snapshot_detail_page(snapshot4_id, self.id_generator()+"-image", description="Created by guitester automated snapshot test", register_as_windows_image=True) image2_id = image2.get("image_id") self.tester.remove_image_from_cloud_on_images_lp(image2_id, delete_associated_snapshot=True) self.tester.verify_snapshot_not_present_on_lp(snapshot4_id) self.tester.delete_snapshot_from_detail_page(snapshot1_id) self.tester.delete_snapshot_from_landing_page(snapshot2_id) self.tester.delete_snapshot_from_landing_page(snapshot3_id) self.tester.terminate_instance_from_view_page(instance1_id) self.tester.delete_volume_from_view_page(volume1_id) self.tester.logout() self.tester.exit_browser()
class RegionOperationsSequence(GuiOps): def __init__(self): parser = Option_parser() self.console_url = parser.parse_options()['console_url'] self.webdriver_url = parser.parse_options()['web_driver'] self.account = parser.parse_options()['account'] self.user = parser.parse_options()['user_name'] self.password = parser.parse_options()['password'] self.sauce = parser.parse_options()['sauce'] self.browser = parser.parse_options()['browser'] self.version = parser.parse_options()['version'] self.platform = parser.parse_options()['platform'] self.tester = GuiOps(console_url=self.console_url, webdriver_url=self.webdriver_url, sauce=self.sauce, browser=self.browser, version=self.version, platform=self.platform) self.tester.zoom_out() def region_ops_test(self): self.tester.login(self.account, self.user, self.password) regions = self.tester.get_region_list() self.tester.change_region(regions[0]) volume1_name = self.id_generator() + "-volume" volume1 = self.tester.create_volume_from_view_page( volume1_name, volume_size=1, availability_zone="one") volume1_id = volume1.get("volume_id") self.tester.change_region(regions[1]) volume2 = self.tester.create_volume_from_dashboard( volume_size=1, availability_zone="two") volume2_id = volume2.get("volume_id") self.tester.change_region(regions[0]) self.tester.delete_volume_from_view_page(volume1_id) self.tester.change_region(regions[1]) self.tester.delete_volume_from_detail_page(volume2_id) self.tester.logout() self.tester.exit_browser()
class Buckets_operations_sequence(GuiOps): def __init__(self): parser = Option_parser() self.console_url = parser.parse_options()['console_url'] self.webdriver_url = parser.parse_options()['web_driver'] self.account = parser.parse_options()['account'] self.user = parser.parse_options()['user_name'] self.password = parser.parse_options()['password'] self.sauce = parser.parse_options()['sauce'] self.browser = parser.parse_options()['browser'] self.version = parser.parse_options()['version'] self.platform = parser.parse_options()['platform'] self.tester = GuiOps( console_url=self.console_url, webdriver_url=self.webdriver_url, sauce=self.sauce, browser=self.browser, version=self.version, platform=self.platform) logging.basicConfig(format='%(asctime)s %(message)s') def get_bucket_name(self): return self.id_generator() + '-bucket' def bucket_ops_test(self): self.tester.login(self.account, self.user, self.password) self._create_from_dashboard() self._create_from_landing_page() self._upload_object_detail_page() self._upload_object_contents_page() self._delete_all_objects_from_contents_page() self.tester.logout() self.tester.exit_browser() def _create_from_dashboard(self): bucket_name = self.get_bucket_name() self.tester.create_bucket_from_dashboard(bucket_name) self.tester.delete_bucket_from_view_page(bucket_name) def _create_from_landing_page(self): bucket_name = self.get_bucket_name() self.tester.create_bucket_from_landing_page(bucket_name) self.tester.delete_bucket_from_detail_page(bucket_name) def _upload_object_detail_page(self): bucket_name = self.get_bucket_name() self.tester.create_bucket_from_landing_page(bucket_name) object_name = self.tester.upload_object_from_details_page(bucket_name) self.tester.delete_object_from_contents_page(bucket_name, object_name) self.tester.delete_bucket_from_detail_page(bucket_name) def _upload_object_contents_page(self): bucket_name = self.get_bucket_name() self.tester.create_bucket_from_landing_page(bucket_name) object_name = self.tester.upload_object_from_contents_page(bucket_name) self.tester.delete_object_from_contents_page(bucket_name, object_name) self.tester.delete_bucket_from_detail_page(bucket_name) def _delete_all_objects_from_contents_page(self): bucket_name = self.get_bucket_name() self.tester.create_bucket_from_landing_page(bucket_name) for _ in xrange(3): self.tester.upload_object_from_contents_page(bucket_name) self.tester.delete_all_objects_from_contents_page(bucket_name) self.tester.delete_bucket_from_detail_page(bucket_name)
class VolumeOperationsSequence(GuiOps): def __init__(self): parser = Option_parser() self.console_url = parser.parse_options()['console_url'] self.webdriver_url = parser.parse_options()['web_driver'] self.account = parser.parse_options()['account'] self.user = parser.parse_options()['user_name'] self.password = parser.parse_options()['password'] self.sauce = parser.parse_options()['sauce'] self.browser = parser.parse_options()['browser'] self.version = parser.parse_options()['version'] self.platform = parser.parse_options()['platform'] self.tester = GuiOps(console_url=self.console_url, webdriver_url=self.webdriver_url, sauce=self.sauce, browser=self.browser, version=self.version, platform=self.platform) def volume_ops_test(self): self.tester.login(self.account, self.user, self.password) volume1_name = self.id_generator() + "-volume" volume1 = self.tester.create_volume_from_view_page( volume1_name, volume_size=2, availability_zone="one") volume1_id = volume1.get("volume_id") instance1 = self.tester.launch_instance_from_dashboard( availability_zone="one", timeout_in_seconds=400) instance1_id = instance1.get("instance_id") self.tester.verify_attach_notice_on_volume_monitoring_page(volume1_id) self.tester.attach_volume_from_instance_detail_page( volume1_id, instance1_id, timeout_in_seconds=400) self.tester.verify_charts_on_volume_monitoring_page(volume1_id) self.tester.detach_volume_from_volumes_lp(volume1_id, timeout_in_seconds=800) self.tester.attach_volume_from_instance_lp(volume1_id, instance1_id, timeout_in_seconds=800) self.tester.detach_volume_from_volumes_lp(volume1_id, timeout_in_seconds=800) self.tester.attach_volume_from_volume_detail_page( instance1_id, volume1_id, device="/dev/vdd", timeout_in_seconds=800) self.tester.detach_volume_from_volumes_lp(volume1_id, timeout_in_seconds=800) self.tester.attach_volume_from_volume_lp(instance1_id, volume1_id, timeout_in_seconds=800) self.tester.terminate_instance_from_view_page(instance1_id) self.tester.delete_volume_from_view_page(volume1_id) volume2 = self.tester.create_volume_from_dashboard( volume_size=3, availability_zone="one") volume2_id = volume2.get("volume_id") self.tester.delete_volume_from_detail_page(volume2_id) self.sortable_volumes_tables_test() self.tester.logout() self.tester.exit_browser() def sortable_volumes_tables_test(self): volume1_name = "!!!!" + self.id_generator() + "-volume" volume1 = self.tester.create_volume_from_view_page( volume1_name, volume_size=1, availability_zone="one") volume1_id = volume1.get("volume_id") volume2_name = "~~~~" + self.id_generator() + "-volume" volume2 = self.tester.create_volume_from_dashboard( volume2_name, volume_size=1, availability_zone="one") volume2_id = volume2.get("volume_id") # Test ascending sort by name column self.tester.click_sortable_column_header_on_volumes_landing_page( column_name='name') self.tester.verify_sort_position_for_volume(volume1_id, position=1) # Test descending sort by name column (second click sorts descending) self.tester.click_sortable_column_header_on_volumes_landing_page( column_name='name') self.tester.verify_sort_position_for_volume(volume2_id, position=1) # Cleanup volumes self.tester.delete_volume_from_view_page(volume1_id) self.tester.delete_volume_from_view_page(volume2_id)
class Keypair_operations_sequence(GuiOps): keypair = ( "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDI1x6tEjkBQCCP0ssF69vAgP2xg+N9ScoTrqRqyl5w4qEgsV/AppfHHYRKYr0N/tTyG4/" "z1XGNrB2SaslnRpgEOsvMZldlOnqsUujL2fgoEg+/gB92+1JhZgTjU8nL5j5BFkVTh93nSHtXHdzYl7SjlXrv26ZbyuDwJmI+s6bJQk5noJ4Q4g" "7N/0y9pHRvezyhgxkyX7PQoA9WJm8SqlakyhMYa0j/baMhb/ehSI0VvwNodmcaWaS6Z2F4rZS4C2DmCUDXYy/1+0tiRTjHjlPbqRKCVKam8ImWy" "tlZD0zbdV/tpADxDpnhW2cPVpXcjy4sRzUCc8AZW+OE3LQxXild [email protected]" ) def id_generator(self, size=6, chars=string.ascii_uppercase + string.digits): return "".join(random.choice(chars) for j in range(size)) def __init__(self): parser = Option_parser() self.console_url = parser.parse_options()["console_url"] self.webdriver_url = parser.parse_options()["web_driver"] self.account = parser.parse_options()["account"] self.user = parser.parse_options()["user_name"] self.password = parser.parse_options()["password"] self.sauce = parser.parse_options()["sauce"] self.browser = parser.parse_options()["browser"] self.version = parser.parse_options()["version"] self.platform = parser.parse_options()["platform"] self.tester = GuiOps( console_url=self.console_url, webdriver_url=self.webdriver_url, sauce=self.sauce, browser=self.browser, version=self.version, platform=self.platform, ) def keypair_ops_test(self): keypair1_name = self.id_generator() + "-key" self.tester.login(self.account, self.user, self.password) self.tester.create_keypair_from_keypair_view_page(keypair1_name) self.tester.delete_keypair_from_detail_page(keypair1_name) keypair2_name = self.id_generator() + "-key" self.tester.create_keypair_from_dashboard(keypair2_name) self.tester.delete_keypair_from_view_page(keypair2_name) keypair3_name = self.id_generator() + "-key" self.tester.import_keypair(self.keypair, keypair3_name) self.tester.delete_keypair_from_detail_page(keypair3_name) self.tester.logout() self.tester.exit_browser()
class Stack_operations_sequence(GuiOps): TEMPLATE_URL = 'https://raw.githubusercontent.com/eucalyptus/eucaconsole/19b2a55ce33e0d76567bff9541319bb7b51e18d4/eucaconsole/cf-templates/Euca%20Stacks/Basic%20Instance.json' def __init__(self): parser = Option_parser() self.console_url = parser.parse_options()['console_url'] self.webdriver_url = parser.parse_options()['web_driver'] self.account = parser.parse_options()['account'] self.user = parser.parse_options()['user_name'] self.password = parser.parse_options()['password'] self.sauce = parser.parse_options()['sauce'] self.browser = parser.parse_options()['browser'] self.version = parser.parse_options()['version'] self.platform = parser.parse_options()['platform'] self.tester = GuiOps(console_url=self.console_url, webdriver_url=self.webdriver_url, sauce=self.sauce, browser=self.browser, version=self.version, platform=self.platform) def stack_ops_test(self): self.tester.login(self.account, self.user, self.password) keypair_name = self.id_generator()+"-keypair" self.tester.create_keypair_from_dashboard(keypair_name) # test stack from sample stack1_name = "test-" + self.id_generator() + "-stack" self.tester.create_stack_from_dashboard(stack1_name) stack2_name = "test-" + self.id_generator() + "-stack" self.tester.create_stack_from_lp(stack2_name) # update a stack self.tester.update_stack_from_lp(stack2_name) # delete the stacks self.tester.delete_stack_from_lp(stack1_name) self.tester.delete_stack_from_detail_page(stack2_name) #test stack from uploaded template stack3_name = "test-" + self.id_generator() + "-stack" self.tester.create_stack_from_dashboard(stack3_name, template_url=self.TEMPLATE_URL) self.tester.delete_stack_from_lp(stack3_name) self.tester.delete_keypair_from_detail_page(keypair_name) self.tester.logout() self.tester.exit_browser()
class Security_group_operations_sequence(GuiOps): s_group_description = "Security group created by security_group_sequence test" def __init__(self): parser = Option_parser() self.console_url = parser.parse_options()['console_url'] self.webdriver_url = parser.parse_options()['web_driver'] self.account = parser.parse_options()['account'] self.user = parser.parse_options()['user_name'] self.password = parser.parse_options()['password'] self.sauce = parser.parse_options()['sauce'] self.browser = parser.parse_options()['browser'] self.version = parser.parse_options()['version'] self.platform = parser.parse_options()['platform'] self.tester = GuiOps(console_url=self.console_url, webdriver_url=self.webdriver_url, sauce=self.sauce, browser=self.browser, version=self.version, platform=self.platform) def id_generator(self, size = 6, chars=string.ascii_uppercase + string.digits): return ''.join(random.choice(chars) for j in range(size)) def security_group_ops_test(self): self.tester.login(self.account, self.user, self.password) s_group_name_1 = self.id_generator() + "_test_group" group1 = self.tester.create_security_group_from_dashboard(s_group_name_1, self.s_group_description) s_group_id_1 = group1.get("s_group_id") self.tester.add_tcp_22_rule_to_s_group(s_group_name_1, s_group_id_1) self.tester.add_custom_tcp_rule_to_s_group(s_group_name_1, s_group_id_1) self.tester.delete_security_group_from_detail_page(s_group_name_1, s_group_id_1) s_group_name_2 = self.id_generator() + "_test_group" group2 = self.tester.create_security_group_from_view_page(s_group_name_2, self.s_group_description) s_group_id_2 = group2.get("s_group_id") self.tester.add_ldap_rule_to_s_group(s_group_name_2, s_group_id_2) self.tester.delete_security_group_from_view_page(s_group_name_2, s_group_id_2) s_group_name_3 = self.id_generator() + "_test_group" group3 = self.tester.create_sesecurity_group_with_rules(s_group_name_3, self.s_group_description, "RDP", "Custom TCP", "22", "1024") s_group_id_3 = group3.get("s_group_id") self.tester.delete_security_group_from_detail_page(s_group_name_3, s_group_id_3) self.tester.logout() self.tester.exit_browser()
class RegionOperationsSequence(GuiOps): def __init__(self): parser = Option_parser() self.console_url = parser.parse_options()["console_url"] self.webdriver_url = parser.parse_options()["web_driver"] self.account = parser.parse_options()["account"] self.user = parser.parse_options()["user_name"] self.password = parser.parse_options()["password"] self.sauce = parser.parse_options()["sauce"] self.browser = parser.parse_options()["browser"] self.version = parser.parse_options()["version"] self.platform = parser.parse_options()["platform"] self.tester = GuiOps( console_url=self.console_url, webdriver_url=self.webdriver_url, sauce=self.sauce, browser=self.browser, version=self.version, platform=self.platform, ) def region_ops_test(self): self.tester.login(self.account, self.user, self.password) regions = self.tester.get_region_list() self.tester.change_region(regions[0]) volume1_name = self.id_generator() + "-volume" volume1 = self.tester.create_volume_from_view_page(volume1_name, volume_size=1, availability_zone="one") volume1_id = volume1.get("volume_id") self.tester.change_region(regions[1]) volume2 = self.tester.create_volume_from_dashboard(volume_size=1, availability_zone="two") volume2_id = volume2.get("volume_id") self.tester.change_region(regions[0]) self.tester.delete_volume_from_view_page(volume1_id) self.tester.change_region(regions[1]) self.tester.delete_volume_from_detail_page(volume2_id) self.tester.logout() self.tester.exit_browser()
class ASG_operations_sequence(GuiOps): def __init__(self): parser = Option_parser() self.console_url = parser.parse_options()['console_url'] self.webdriver_url = parser.parse_options()['web_driver'] self.account = parser.parse_options()['account'] self.user = parser.parse_options()['user_name'] self.password = parser.parse_options()['password'] self.sauce = parser.parse_options()['sauce'] self.browser = parser.parse_options()['browser'] self.version = parser.parse_options()['version'] self.platform = parser.parse_options()['platform'] self.tester = GuiOps(console_url=self.console_url, webdriver_url=self.webdriver_url, sauce=self.sauce, browser=self.browser, version=self.version, platform=self.platform) logging.basicConfig(format='%(asctime)s %(message)s') def asg_ops_test(self): self.tester.login(self.account, self.user, self.password) LaunchConfig1_name = self.id_generator()+"-launch-config" ASG1_name = self.id_generator()+"-auto-scaling-group" self.tester.create_launch_config_and_asg_from_lc_lp(lc_name=LaunchConfig1_name, asg_name=ASG1_name) self.tester.delete_asg_from_lp(ASG1_name) ASG2_name = self.id_generator()+"-auto-scaling-group" self.tester.create_asg_from_asg_lp(launch_config_name=LaunchConfig1_name, asg_name=ASG2_name) self.tester.delete_asg_from_lp(ASG2_name) self.tester.delete_launch_config_from_lp(LaunchConfig1_name) LaunchConfig2_name = self.id_generator()+"-launch-config" self.tester.create_launch_config_from_lc_lp(LaunchConfig2_name) self.tester.create_asg_from_dashboard(launch_config_name=LaunchConfig2_name, asg_name=ASG2_name, min_capacity=1, desired_capacity=1, max_capacity=1) self.tester.verify_scaling_history(ASG2_name) self.tester.set_scaling_group_capacity(ASG2_name, 0, 0, 1) self.tester.delete_asg_from_lp(ASG2_name) self.tester.delete_launch_config_from_lp(LaunchConfig2_name) self.tester.logout() self.tester.exit_browser()
class AutoScalingOperationsSequence(GuiOps): def __init__(self): parser = Option_parser() self.console_url = parser.parse_options()['console_url'] self.webdriver_url = parser.parse_options()['web_driver'] self.account = parser.parse_options()['account'] self.user = parser.parse_options()['user_name'] self.password = parser.parse_options()['password'] self.sauce = parser.parse_options()['sauce'] self.browser = parser.parse_options()['browser'] self.version = parser.parse_options()['version'] self.platform = parser.parse_options()['platform'] self.tester = GuiOps(console_url=self.console_url, webdriver_url=self.webdriver_url, sauce=self.sauce, browser=self.browser, version=self.version, platform=self.platform) logging.basicConfig(format='%(asctime)s %(message)s') def asg_ops_test(self): self.tester.login(self.account, self.user, self.password) launchconfig1_name = self.id_generator() + "-launch-config" scalinggroup1_name = self.id_generator() + "-auto-scaling-group" self.tester.create_launch_config_and_asg_from_lc_lp( lc_name=launchconfig1_name, asg_name=scalinggroup1_name, max_capacity=2, desired_capacity=1, min_cpapacity=0) self.tester.delete_asg_from_lp(scalinggroup1_name) scalinggroup2_name = self.id_generator() + "-auto-scaling-group" self.tester.create_asg_from_asg_lp( launch_config_name=launchconfig1_name, asg_name=scalinggroup2_name) self.tester.delete_asg_from_lp(scalinggroup2_name) self.tester.delete_launch_config_from_lp(launchconfig1_name) launchconfig2_name = self.id_generator() + "-launch-config" self.tester.create_launch_config_from_lc_lp(launchconfig2_name) self.tester.create_asg_from_dashboard( launch_config_name=launchconfig2_name, asg_name=scalinggroup2_name, min_capacity=1, desired_capacity=1, max_capacity=1) self.tester.verify_scaling_history(scalinggroup2_name) self.tester.set_scaling_group_capacity(scalinggroup2_name, 0, 0, 1) self.tester.delete_asg_from_lp(scalinggroup2_name) self.tester.delete_launch_config_from_lp(launchconfig2_name) self.test_scaling_group_monitoring_page_with_monitoring_enabled() self.tester.logout() self.tester.exit_browser() def test_scaling_group_monitoring_page_with_monitoring_enabled(self): """Scaling group monitoring page should display charts when metrics collection is enabled and its launch config has monitoring enabled""" launchconfig3_name = self.id_generator() + "-launch-config" scalinggroup3_name = self.id_generator() + "-auto-scaling-group" self.tester.create_launch_config_and_asg_from_lc_lp( lc_name=launchconfig3_name, asg_name=scalinggroup3_name, enable_monitoring=True) self.tester.enable_metrics_collection_for_auto_scaling_group( scalinggroup3_name) self.tester.verify_charts_on_scaling_group_monitoring_page( scalinggroup3_name) self.tester.delete_asg_from_lp(scalinggroup3_name) self.tester.delete_launch_config_from_lp(launchconfig3_name)
class Snapshot_operations_sequence(GuiOps): def __init__(self): parser = Option_parser() self.console_url = parser.parse_options()['console_url'] self.webdriver_url = parser.parse_options()['web_driver'] self.account = parser.parse_options()['account'] self.user = parser.parse_options()['user_name'] self.password = parser.parse_options()['password'] self.sauce = parser.parse_options()['sauce'] self.browser = parser.parse_options()['browser'] self.version = parser.parse_options()['version'] self.platform = parser.parse_options()['platform'] self.tester = GuiOps(console_url=self.console_url, webdriver_url=self.webdriver_url, sauce=self.sauce, browser=self.browser, version=self.version, platform=self.platform) def id_generator(self, size = 6, chars=string.ascii_uppercase + string.digits): return ''.join(random.choice(chars) for j in range(size)) def snapshot_ops_test(self): self.tester.login(self.account, self.user, self.password) volume1_name = self.id_generator()+"-volume" volume1 = self.tester.create_volume_from_view_page(volume1_name, availability_zone="one") volume1_id = volume1.get("volume_id") snapshot1 = self.tester.create_snapshot_on_volumes_view_page(volume1_id, snapshot_description="Created by snapshot operations test") snapshot1_id = snapshot1.get("snapshot_id") snapshot2_name =self.id_generator()+"-snapshot" snapshot2 = self.tester.create_snapshot_from_dashboard(volume1_id, snapshot2_name, "Created by snapshot operations test") snapshot2_id = snapshot2.get("snapshot_id") instance1 = self.tester.launch_instance_from_dashboard(availability_zone="one") instance1_id = instance1.get("instance_id") self.tester.attach_volume_from_instance_lp(volume1_id, instance1_id, device= "/dev/vdg") snapshot3_name =self.id_generator()+"-snapshot" snapshot3 = self.tester.create_snapshot_on_snapshot_view_page(volume1_id, snapshot3_name,"Created by snapshot operations test") snapshot3_id = snapshot3.get("snapshot_id") image1 = self.tester.register_snapshot_as_an_image_from_snapshot_landing_page(snapshot3_id, "myimage") image1_id = image1.get("image_id") self.tester.remove_image_from_cloud_on_images_lp(image1_id) volume2=self.tester.create_volume_from_snapshot_on_snapshot_lp(snapshot3_id, availability_zone="two") volume2_id=volume2.get("volume_id") self.tester.delete_volume_from_view_page(volume2_id) volume3_name = self.id_generator()+"-volume" volume3=self.tester.create_volume_from_snapshot_on_snapshot_detail_page(snapshot3_id, volume_name=volume3_name, availability_zone="two") volume3_id=volume3.get("volume_id") self.tester.delete_volume_from_detail_page(volume3_id) snapshot4 = self.tester.create_snapshot_on_volumes_view_page(volume1_id) snapshot4_id = snapshot4.get("snapshot_id") self.tester.delete_snapshot_from_landing_page(snapshot4_id) self.tester.delete_snapshot_from_detail_page(snapshot1_id) self.tester.delete_snapshot_from_landing_page(snapshot2_id) self.tester.delete_snapshot_from_landing_page(snapshot3_id) self.tester.terminate_instance_from_view_page(instance1_id) self.tester.delete_volume_from_view_page(volume1_id) self.tester.logout() self.tester.exit_browser()
class SnapshotOperationsSequence(GuiOps): def __init__(self): parser = Option_parser() options = parser.parse_options() self.console_url = options['console_url'] self.webdriver_url = options['web_driver'] self.account = options['account'] self.user = options['user_name'] self.password = options['password'] self.sauce = options['sauce'] self.browser = options['browser'] self.version = options['version'] self.platform = options['platform'] self.zones = self.get_zones_from_options(options) self.zone1 = self.zones.get(0) self.zone2 = self.zones.get(1, self.zones.get(0)) self.tester = GuiOps(console_url=self.console_url, webdriver_url=self.webdriver_url, sauce=self.sauce, browser=self.browser, version=self.version, platform=self.platform) self.tester.zoom_out() def snapshot_ops_test(self): print "" print "Logging in ..." print "" self.tester.login(self.account, self.user, self.password) volume1_name = self.id_generator() + "-volume" print "" print "Creating volume"+volume1_name+"from view page ..." print "" volume1 = self.tester.create_volume_from_view_page(volume1_name, availability_zone=self.zone1) volume1_id = volume1.get("volume_id") print "" print "Creating snapshot without name on volume view page ..." print "" snapshot1 = self.tester.create_snapshot_on_volumes_view_page( volume1_id, snapshot_description="Created by snapshot operations test") snapshot1_id = snapshot1.get("snapshot_id") print "" print "Creates snapshot "+snapshot1_id print "" snapshot2_name = self.id_generator() + "-snapshot" print "" print "Running create_snapshot_from_dashboard with name "+snapshot2_name print "" snapshot2 = self.tester.create_snapshot_from_dashboard( volume1_id, snapshot2_name, "Created by snapshot operations test") snapshot2_id = snapshot2.get("snapshot_id") print "" print "Created snapshot named "+snapshot2_name+" id "+snapshot2_id print "" print "" print "Running launch_instance_from_dashboard..." print "" instance1 = self.tester.launch_instance_from_dashboard(availability_zone=self.zone1) instance1_id = instance1.get("instance_id") print "" print "Launched instance id "+instance1_id print "" print "" print "Running attach_volume_from_instance_lp "+volume1_id+" attaching to instance "+instance1_id print "" self.tester.attach_volume_from_instance_lp(volume1_id, instance1_id, device="/dev/vdg") snapshot3_name = self.id_generator() + "-snapshot" print "" print "Running create_snapshot_on_snapshot_view_page "+volume1_id+" snapshot by name "+snapshot3_name print "" snapshot3 = self.tester.create_snapshot_on_snapshot_view_page( volume1_id, snapshot3_name, "Created by snapshot operations test") snapshot3_id = snapshot3.get("snapshot_id") print "" print "" print "" print "" print "" print "" image1 = self.tester.register_snapshot_as_an_image_from_snapshot_landing_page( snapshot3_id, self.id_generator() + "-image") image1_id = image1.get("image_id") self.tester.remove_image_from_cloud_on_images_lp(image1_id) volume2 = self.tester.create_volume_from_snapshot_on_snapshot_lp(snapshot3_id, availability_zone=self.zone2) volume2_id = volume2.get("volume_id") self.tester.delete_volume_from_view_page(volume2_id) volume3_name = self.id_generator() + "-volume" volume3 = self.tester.create_volume_from_snapshot_on_snapshot_detail_page( snapshot3_id, volume_name=volume3_name, availability_zone=self.zone2) volume3_id = volume3.get("volume_id") self.tester.delete_volume_from_detail_page(volume3_id) snapshot4 = self.tester.create_snapshot_on_volumes_view_page(volume1_id) snapshot4_id = snapshot4.get("snapshot_id") image2 = self.tester.register_snapshot_as_an_image_from_snapshot_detail_page( snapshot4_id, self.id_generator() + "-image", description="Created by guitester automated snapshot test", register_as_windows_image=True) image2_id = image2.get("image_id") self.tester.remove_image_from_cloud_on_images_lp(image2_id, delete_associated_snapshot=True) self.tester.verify_snapshot_not_present_on_lp(snapshot4_id) self.tester.delete_snapshot_from_detail_page(snapshot1_id) self.tester.delete_snapshot_from_landing_page(snapshot2_id) self.tester.delete_snapshot_from_landing_page(snapshot3_id) self.tester.terminate_instance_from_view_page(instance1_id) self.tester.delete_volume_from_view_page(volume1_id) self.tester.logout() self.tester.exit_browser()
class SecurityGroupOperationsSequence(GuiOps): s_group_description = "Security group created by security_group_sequence test" def __init__(self): parser = Option_parser() self.console_url = parser.parse_options()['console_url'] self.webdriver_url = parser.parse_options()['web_driver'] self.account = parser.parse_options()['account'] self.user = parser.parse_options()['user_name'] self.password = parser.parse_options()['password'] self.sauce = parser.parse_options()['sauce'] self.browser = parser.parse_options()['browser'] self.version = parser.parse_options()['version'] self.platform = parser.parse_options()['platform'] self.tester = GuiOps(console_url=self.console_url, webdriver_url=self.webdriver_url, sauce=self.sauce, browser=self.browser, version=self.version, platform=self.platform) self.tester.zoom_out() def security_group_ops_test(self): self.tester.login(self.account, self.user, self.password) s_group_name_1 = self.id_generator() + "_test_group" group1 = self.tester.create_security_group_from_dashboard( s_group_name_1, self.s_group_description) s_group_id_1 = group1.get("s_group_id") self.tester.add_tcp_22_rule_to_s_group(s_group_name_1, s_group_id_1) self.tester.add_custom_tcp_rule_to_s_group(s_group_name_1, s_group_id_1) self.tester.delete_security_group_from_detail_page( s_group_name_1, s_group_id_1) s_group_name_2 = self.id_generator() + "_test_group" group2 = self.tester.create_security_group_from_view_page( s_group_name_2, self.s_group_description) s_group_id_2 = group2.get("s_group_id") self.tester.add_ldap_rule_to_s_group(s_group_name_2, s_group_id_2) self.tester.delete_security_group_from_view_page( s_group_name_2, s_group_id_2) s_group_name_3 = self.id_generator() + "_test_group" group3 = self.tester.create_sesecurity_group_with_rules( s_group_name_3, self.s_group_description, "RDP", "Custom TCP", "22", "1024") s_group_id_3 = group3.get("s_group_id") self.tester.delete_security_group_from_detail_page( s_group_name_3, s_group_id_3) self.tester.logout() self.tester.exit_browser()
class Volume_operations_sequence(GuiOps): def __init__(self): parser = Option_parser() self.console_url = parser.parse_options()['console_url'] self.webdriver_url = parser.parse_options()['web_driver'] self.account = parser.parse_options()['account'] self.user = parser.parse_options()['user_name'] self.password = parser.parse_options()['password'] self.sauce = parser.parse_options()['sauce'] self.browser = parser.parse_options()['browser'] self.version = parser.parse_options()['version'] self.platform = parser.parse_options()['platform'] self.tester = GuiOps(console_url=self.console_url, webdriver_url=self.webdriver_url, sauce=self.sauce, browser=self.browser, version=self.version, platform=self.platform) def id_generator(self, size = 6, chars=string.ascii_uppercase + string.digits): return ''.join(random.choice(chars) for j in range(size)) def volume_ops_test(self): self.tester.login(self.account, self.user, self.password) volume1_name = self.id_generator()+"-volume" volume1 = self.tester.create_volume_from_view_page(volume1_name, volume_size=2, availability_zone="one") volume1_id = volume1.get("volume_id") instance1=self.tester.launch_instance_from_dashboard(availability_zone="one", timeout_in_seconds=400) instance1_id=instance1.get("instance_id") self.tester.attach_volume_from_instance_detail_page(volume1_id, instance1_id,timeout_in_seconds=400) self.tester.detach_volume_from_volumes_lp(volume1_id,timeout_in_seconds=400) self.tester.attach_volume_from_instance_lp(volume1_id, instance1_id,timeout_in_seconds=400) self.tester.detach_volume_from_volumes_lp(volume1_id, timeout_in_seconds=400) self.tester.attach_volume_from_volume_detail_page(instance1_id, volume1_id, device="/dev/vdd", timeout_in_seconds=400) self.tester.detach_volume_from_volumes_lp(volume1_id, timeout_in_seconds=400) self.tester.attach_volume_from_volume_lp(instance1_id, volume1_id, timeout_in_seconds=400) self.tester.terminate_instance_from_view_page(instance1_id) self.tester.delete_volume_from_view_page(volume1_id) volume2=self.tester.create_volume_from_dashboard(volume_size=3, availability_zone="two") volume2_id=volume2.get("volume_id") self.tester.delete_volume_from_detail_page(volume2_id) self.tester.logout() self.tester.exit_browser()