当前位置: 首页>>代码示例>>Python>>正文


Python GuiOps.create_security_group_from_view_page方法代码示例

本文整理汇总了Python中guiops.guiops.GuiOps.create_security_group_from_view_page方法的典型用法代码示例。如果您正苦于以下问题:Python GuiOps.create_security_group_from_view_page方法的具体用法?Python GuiOps.create_security_group_from_view_page怎么用?Python GuiOps.create_security_group_from_view_page使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在guiops.guiops.GuiOps的用法示例。


在下文中一共展示了GuiOps.create_security_group_from_view_page方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: InstanceOperationsSequence

# 需要导入模块: from guiops.guiops import GuiOps [as 别名]
# 或者: from guiops.guiops.GuiOps import create_security_group_from_view_page [as 别名]
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()
开发者ID:aliceh,项目名称:eucaconsole,代码行数:55,代码来源:instances.py

示例2: Instance_operations_sequence

# 需要导入模块: from guiops.guiops import GuiOps [as 别名]
# 或者: from guiops.guiops.GuiOps import create_security_group_from_view_page [as 别名]
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()
开发者ID:mbacchi,项目名称:eucaconsole,代码行数:52,代码来源:instances.py

示例3: Security_group_operations_sequence

# 需要导入模块: from guiops.guiops import GuiOps [as 别名]
# 或者: from guiops.guiops.GuiOps import create_security_group_from_view_page [as 别名]
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()
开发者ID:mbacchi,项目名称:eucaconsole,代码行数:42,代码来源:security_groups.py


注:本文中的guiops.guiops.GuiOps.create_security_group_from_view_page方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。