<commit_before>from se34euca.testcase.testcase_base import *


class testcase_sequences(testcase_base):
    #sleep_time=30

    def instance_operations(self):
        sleep_time = 60
        print "=== runTest: Instance Operations ==="
        self.eucaUITester.base.test_ui_login()
        self.eucaUITester.security_group.test_ui_create_security_group("mywebservice",
                                                                       "Rules for my webservice. Generated by Selenium")
        self.eucaUITester.security_group.test_ui_check_security_group_count("2")
        self.eucaUITester.keypair.test_ui_import_keypair_given_name("import-key")
        self.eucaUITester.keypair.test_ui_verify_keypair_given_name("import-key")
        self.eucaUITester.keypair.test_ui_check_keypair_count("1")
        self.eucaUITester.instance.test_ui_launch_instance_given_name_security_group_keypair("testinstance",
                                                                                             "mywebservice",
                                                                                             "import-key")
        time.sleep(sleep_time)
        self.eucaUITester.instance.test_ui_check_running_instances_count("1")
        time.sleep(sleep_time)
        self.eucaUITester.instance.test_ui_launch_more_like_this()
        time.sleep(sleep_time)
        self.eucaUITester.instance.test_ui_check_running_instances_count("2")
        time.sleep(sleep_time)
        self.eucaUITester.instance.test_ui_terminate_instance_all()
        time.sleep(sleep_time)
        self.eucaUITester.instance.test_ui_check_running_instances_count("0")
        time.sleep(sleep_time)
        self.eucaUITester.instance.test_ui_launch_instance_from_instances_lp("import-key")
        time.sleep(sleep_time)
        self.eucaUITester.instance.test_ui_check_running_instances_count("1")
        time.sleep(sleep_time)
        self.eucaUITester.instance.test_ui_launch_instance_from_images_lp("import-key")
        time.sleep(sleep_time)
        self.eucaUITester.instance.test_ui_check_running_instances_count("2")
        time.sleep(sleep_time)
        self.eucaUITester.instance.test_ui_terminate_instance_all()
        time.sleep(sleep_time)
        self.eucaUITester.instance.test_ui_check_running_instances_count("0")
        time.sleep(sleep_time)
        self.eucaUITester.security_group.test_ui_delete_security_group_all()
        self.eucaUITester.keypair.test_ui_delete_keypair_all()
        time.sleep(sleep_time)
        self.eucaUITester.keypair.test_ui_check_keypair_count("0")
        self.eucaUITester.base.test_ui_logout()
        time.sleep(sleep_time)

    def keypair_operations(self):
        sleep_time = 20
        print "=== runTest: Keypair Operations ==="
        self.eucaUITester.base.test_ui_login()
        self.eucaUITester.keypair.test_ui_import_keypair_given_name("import-key")
        self.eucaUITester.keypair.test_ui_verify_keypair_given_name("import-key")
        self.eucaUITester.keypair.test_ui_check_keypair_count("1")
        self.eucaUITester.keypair.test_ui_delete_keypair_given_name("import-key")
        self.eucaUITester.keypair.test_ui_check_keypair_count("0")
        self.eucaUITester.keypair.test_ui_verify_delete_keypair_given_name("import-key")
        self.eucaUITester.keypair.test_ui_generate_keypair_given_name("my-sel-gen-key-00")
        self.eucaUITester.keypair.test_ui_verify_keypair_given_name("my-sel-gen-key-00")
        self.eucaUITester.keypair.test_ui_check_keypair_count("1")
        self.eucaUITester.keypair.test_ui_delete_keypair_all()
        self.eucaUITester.keypair.test_ui_check_keypair_count("0")
        self.eucaUITester.base.test_ui_logout()

    def security_group_operations(self):
        sleep_time = 60
        print "=== runTest: Security Group Operations ==="
        self.eucaUITester.base.test_ui_login()
        time.sleep(sleep_time)
        self.eucaUITester.security_group.test_ui_create_empty_security_group()
        time.sleep(sleep_time)
        self.eucaUITester.security_group.test_ui_check_security_group_count("2")
        time.sleep(sleep_time)
        time.sleep(sleep_time)
        self.eucaUITester.security_group.test_ui_add_rules_to_security_group("test")
        time.sleep(sleep_time)
        time.sleep(sleep_time)
        self.eucaUITester.security_group.test_ui_create_security_group("mywebservice",
                                                                       "Rules for my webservice. Generated by Selenium")
        time.sleep(sleep_time)
        self.eucaUITester.security_group.test_ui_check_security_group_count("3")
        time.sleep(sleep_time)
        self.eucaUITester.security_group.test_ui_delete_security_group_all()
        time.sleep(sleep_time)
        self.eucaUITester.security_group.test_ui_check_security_group_count("1")
        time.sleep(sleep_time)
        self.eucaUITester.base.test_ui_logout()
        time.sleep(sleep_time)

    def ip_address_operations(self):
        print "=== runTest: IP Address Operations ==="
        self.eucaUITester.base.test_ui_login()
        self.eucaUITester.keypair.test_ui_import_keypair_given_name("import-key")
        self.eucaUITester.keypair.test_ui_verify_keypair_given_name("import-key")
        self.eucaUITester.keypair.test_ui_check_keypair_count("1")
        self.eucaUITester.instance.test_ui_launch_instance_given_name_security_group_keypair("testinstance", "default", "import-key")
        self.eucaUITester.instance.test_ui_check_running_instances_count("1")
        self.eucaUITester.ip_address.test_ui_allocate_ip_address("1")
        self.eucaUITester.ip_address.test_ui_check_ip_address_count("1")
        available_ip = self.eucaUITester.ip_address.test_ui_get_available_ip_address()
        self.eucaUITester.instance.test_ui_associate_ip_given_instance_name_and_ip_address("testinstance", available_ip)
	self.eucaUITester.instance.test_ui_verify_associate_ip_given_instance_name_and_ip_address("testinstance", available_ip)
        #self.eucaUITester.instance.test_ui_associate_ip_from_inst_lp()
        self.eucaUITester.instance.test_ui_disassociate_ip_from_inst_lp()
        self.eucaUITester.instance.test_ui_associate_ip_from_ip_lp("testinstance")
        self.eucaUITester.instance.test_ui_disassociate_ip_from_ip_lp()
        self.eucaUITester.instance.test_ui_associate_ip_from_ip_lp("testinstance")
        self.eucaUITester.ip_address.test_ui_release_ip_address_all()
        self.eucaUITester.ip_address.test_ui_check_ip_address_count("0")
        self.eucaUITester.instance.test_ui_terminate_instance_all()
        self.eucaUITester.instance.test_ui_check_running_instances_count("0")
        self.eucaUITester.keypair.test_ui_delete_keypair_all()
        self.eucaUITester.keypair.test_ui_check_keypair_count("0")
        self.eucaUITester.base.test_ui_logout()

    def volume_operations(self):
        sleep_time = 60
        print "=== runTest: Volume Operations ==="
        self.eucaUITester.base.test_ui_login()
        self.eucaUITester.keypair.test_ui_import_keypair_given_name("import-key")
        self.eucaUITester.keypair.test_ui_verify_keypair_given_name("import-key")
        self.eucaUITester.keypair.test_ui_check_keypair_count("1")
        self.eucaUITester.instance.test_ui_launch_instance_given_name_security_group_keypair("testinstance", "default", "import-key")
        self.eucaUITester.volume.test_ui_create_volume()
        time.sleep(sleep_time)
        self.eucaUITester.volume.test_ui_check_volume_count("1")
        self.eucaUITester.volume.test_ui_attach_volume()
        time.sleep(sleep_time)
        self.eucaUITester.volume.test_ui_detach_volume()
        self.eucaUITester.volume.test_ui_delete_volume_all()
        time.sleep(sleep_time)
        self.eucaUITester.volume.test_ui_check_volume_count("0")
        self.eucaUITester.volume.test_ui_create_volume_given_volume_name("test-volume")
        time.sleep(sleep_time)
        self.eucaUITester.volume.test_ui_attach_volume_from_instance_lp("test-volume")
        time.sleep(sleep_time)
        self.eucaUITester.volume.detach_volume_from_instance_lp("testinstance")
        time.sleep(sleep_time)
        self.eucaUITester.volume.test_ui_attach_volume_from_instance_lp("test-volume")
        self.eucaUITester.instance.test_ui_terminate_instance_all()
        time.sleep(sleep_time)
        self.eucaUITester.instance.test_ui_check_running_instances_count("0")
        self.eucaUITester.volume.test_ui_delete_volume_all()
        time.sleep(sleep_time)
        self.eucaUITester.keypair.test_ui_delete_keypair_all()
        time.sleep(sleep_time)
        self.eucaUITester.keypair.test_ui_check_keypair_count("0")
        self.eucaUITester.volume.test_ui_check_volume_count("0")
        self.eucaUITester.base.test_ui_logout()

    def snapshot_operations(self):
        sleep_time = 60
        self.eucaUITester.base.test_ui_login()
        self.eucaUITester.volume.test_ui_create_volume_given_volume_name("test-volume")
        time.sleep(sleep_time)
        self.eucaUITester.volume.test_ui_check_volume_count("1")
        self.eucaUITester.volume.test_ui_create_snapshot_from_volume()
        time.sleep(sleep_time)
        self.eucaUITester.snapshot.test_ui_check_snapshot_count("1")
        self.eucaUITester.snapshot.test_ui_create_volume_from_snapshot()
        time.sleep(sleep_time)
        self.eucaUITester.volume.test_ui_check_volume_count("2")
        self.eucaUITester.snapshot.test_ui_register_snapshot_as_image("test-image")
        self.eucaUITester.volume.test_ui_delete_volume_all()
        time.sleep(sleep_time)
        self.eucaUITester.volume.test_ui_check_volume_count("0")
        self.eucaUITester.snapshot.test_ui_delete_all_snapshots()
        time.sleep(sleep_time)
        self.eucaUITester.snapshot.test_ui_check_snapshot_count("0")<commit_msg>Removing the second attach volume call in the volume sequence<commit_after>from se34euca.testcase.testcase_base import *


class testcase_sequences(testcase_base):
    #sleep_time=30

    def instance_operations(self):
        sleep_time = 60
        print "=== runTest: Instance Operations ==="
        self.eucaUITester.base.test_ui_login()
        self.eucaUITester.security_group.test_ui_create_security_group("mywebservice",
                                                                       "Rules for my webservice. Generated by Selenium")
        self.eucaUITester.security_group.test_ui_check_security_group_count("2")
        self.eucaUITester.keypair.test_ui_import_keypair_given_name("import-key")
        self.eucaUITester.keypair.test_ui_verify_keypair_given_name("import-key")
        self.eucaUITester.keypair.test_ui_check_keypair_count("1")
        self.eucaUITester.instance.test_ui_launch_instance_given_name_security_group_keypair("testinstance",
                                                                                             "mywebservice",
                                                                                             "import-key")
        time.sleep(sleep_time)
        self.eucaUITester.instance.test_ui_check_running_instances_count("1")
        time.sleep(sleep_time)
        self.eucaUITester.instance.test_ui_launch_more_like_this()
        time.sleep(sleep_time)
        self.eucaUITester.instance.test_ui_check_running_instances_count("2")
        time.sleep(sleep_time)
        self.eucaUITester.instance.test_ui_terminate_instance_all()
        time.sleep(sleep_time)
        self.eucaUITester.instance.test_ui_check_running_instances_count("0")
        time.sleep(sleep_time)
        self.eucaUITester.instance.test_ui_launch_instance_from_instances_lp("import-key")
        time.sleep(sleep_time)
        self.eucaUITester.instance.test_ui_check_running_instances_count("1")
        time.sleep(sleep_time)
        self.eucaUITester.instance.test_ui_launch_instance_from_images_lp("import-key")
        time.sleep(sleep_time)
        self.eucaUITester.instance.test_ui_check_running_instances_count("2")
        time.sleep(sleep_time)
        self.eucaUITester.instance.test_ui_terminate_instance_all()
        time.sleep(sleep_time)
        self.eucaUITester.instance.test_ui_check_running_instances_count("0")
        time.sleep(sleep_time)
        self.eucaUITester.security_group.test_ui_delete_security_group_all()
        self.eucaUITester.keypair.test_ui_delete_keypair_all()
        time.sleep(sleep_time)
        self.eucaUITester.keypair.test_ui_check_keypair_count("0")
        self.eucaUITester.base.test_ui_logout()
        time.sleep(sleep_time)

    def keypair_operations(self):
        sleep_time = 20
        print "=== runTest: Keypair Operations ==="
        self.eucaUITester.base.test_ui_login()
        self.eucaUITester.keypair.test_ui_import_keypair_given_name("import-key")
        self.eucaUITester.keypair.test_ui_verify_keypair_given_name("import-key")
        self.eucaUITester.keypair.test_ui_check_keypair_count("1")
        self.eucaUITester.keypair.test_ui_delete_keypair_given_name("import-key")
        self.eucaUITester.keypair.test_ui_check_keypair_count("0")
        self.eucaUITester.keypair.test_ui_verify_delete_keypair_given_name("import-key")
        self.eucaUITester.keypair.test_ui_generate_keypair_given_name("my-sel-gen-key-00")
        self.eucaUITester.keypair.test_ui_verify_keypair_given_name("my-sel-gen-key-00")
        self.eucaUITester.keypair.test_ui_check_keypair_count("1")
        self.eucaUITester.keypair.test_ui_delete_keypair_all()
        self.eucaUITester.keypair.test_ui_check_keypair_count("0")
        self.eucaUITester.base.test_ui_logout()

    def security_group_operations(self):
        sleep_time = 60
        print "=== runTest: Security Group Operations ==="
        self.eucaUITester.base.test_ui_login()
        time.sleep(sleep_time)
        self.eucaUITester.security_group.test_ui_create_empty_security_group()
        time.sleep(sleep_time)
        self.eucaUITester.security_group.test_ui_check_security_group_count("2")
        time.sleep(sleep_time)
        time.sleep(sleep_time)
        self.eucaUITester.security_group.test_ui_add_rules_to_security_group("test")
        time.sleep(sleep_time)
        time.sleep(sleep_time)
        self.eucaUITester.security_group.test_ui_create_security_group("mywebservice",
                                                                       "Rules for my webservice. Generated by Selenium")
        time.sleep(sleep_time)
        self.eucaUITester.security_group.test_ui_check_security_group_count("3")
        time.sleep(sleep_time)
        self.eucaUITester.security_group.test_ui_delete_security_group_all()
        time.sleep(sleep_time)
        self.eucaUITester.security_group.test_ui_check_security_group_count("1")
        time.sleep(sleep_time)
        self.eucaUITester.base.test_ui_logout()
        time.sleep(sleep_time)

    def ip_address_operations(self):
        print "=== runTest: IP Address Operations ==="
        self.eucaUITester.base.test_ui_login()
        self.eucaUITester.keypair.test_ui_import_keypair_given_name("import-key")
        self.eucaUITester.keypair.test_ui_verify_keypair_given_name("import-key")
        self.eucaUITester.keypair.test_ui_check_keypair_count("1")
        self.eucaUITester.instance.test_ui_launch_instance_given_name_security_group_keypair("testinstance", "default", "import-key")
        self.eucaUITester.instance.test_ui_check_running_instances_count("1")
        self.eucaUITester.ip_address.test_ui_allocate_ip_address("1")
        self.eucaUITester.ip_address.test_ui_check_ip_address_count("1")
        available_ip = self.eucaUITester.ip_address.test_ui_get_available_ip_address()
        self.eucaUITester.instance.test_ui_associate_ip_given_instance_name_and_ip_address("testinstance", available_ip)
	self.eucaUITester.instance.test_ui_verify_associate_ip_given_instance_name_and_ip_address("testinstance", available_ip)
        #self.eucaUITester.instance.test_ui_associate_ip_from_inst_lp()
        self.eucaUITester.instance.test_ui_disassociate_ip_from_inst_lp()
        self.eucaUITester.instance.test_ui_associate_ip_from_ip_lp("testinstance")
        self.eucaUITester.instance.test_ui_disassociate_ip_from_ip_lp()
        self.eucaUITester.instance.test_ui_associate_ip_from_ip_lp("testinstance")
        self.eucaUITester.ip_address.test_ui_release_ip_address_all()
        self.eucaUITester.ip_address.test_ui_check_ip_address_count("0")
        self.eucaUITester.instance.test_ui_terminate_instance_all()
        self.eucaUITester.instance.test_ui_check_running_instances_count("0")
        self.eucaUITester.keypair.test_ui_delete_keypair_all()
        self.eucaUITester.keypair.test_ui_check_keypair_count("0")
        self.eucaUITester.base.test_ui_logout()

    def volume_operations(self):
        sleep_time = 60
        print "=== runTest: Volume Operations ==="
        self.eucaUITester.base.test_ui_login()
        self.eucaUITester.keypair.test_ui_import_keypair_given_name("import-key")
        self.eucaUITester.keypair.test_ui_verify_keypair_given_name("import-key")
        self.eucaUITester.keypair.test_ui_check_keypair_count("1")
        self.eucaUITester.instance.test_ui_launch_instance_given_name_security_group_keypair("testinstance", "default", "import-key")
        self.eucaUITester.volume.test_ui_create_volume()
        time.sleep(sleep_time)
        self.eucaUITester.volume.test_ui_check_volume_count("1")
        self.eucaUITester.volume.test_ui_attach_volume()
        time.sleep(sleep_time)
        self.eucaUITester.volume.test_ui_detach_volume()
        self.eucaUITester.volume.test_ui_delete_volume_all()
        time.sleep(sleep_time)
        self.eucaUITester.volume.test_ui_check_volume_count("0")
        self.eucaUITester.volume.test_ui_create_volume_given_volume_name("test-volume")
        time.sleep(sleep_time)
        self.eucaUITester.volume.test_ui_attach_volume_from_instance_lp("test-volume")
        time.sleep(sleep_time)
        self.eucaUITester.volume.detach_volume_from_instance_lp("testinstance")
        time.sleep(sleep_time)
        self.eucaUITester.instance.test_ui_terminate_instance_all()
        time.sleep(sleep_time)
        self.eucaUITester.instance.test_ui_check_running_instances_count("0")
        self.eucaUITester.volume.test_ui_delete_volume_all()
        time.sleep(sleep_time)
        self.eucaUITester.keypair.test_ui_delete_keypair_all()
        time.sleep(sleep_time)
        self.eucaUITester.keypair.test_ui_check_keypair_count("0")
        self.eucaUITester.volume.test_ui_check_volume_count("0")
        self.eucaUITester.base.test_ui_logout()

    def snapshot_operations(self):
        sleep_time = 60
        self.eucaUITester.base.test_ui_login()
        self.eucaUITester.volume.test_ui_create_volume_given_volume_name("test-volume")
        time.sleep(sleep_time)
        self.eucaUITester.volume.test_ui_check_volume_count("1")
        self.eucaUITester.volume.test_ui_create_snapshot_from_volume()
        time.sleep(sleep_time)
        self.eucaUITester.snapshot.test_ui_check_snapshot_count("1")
        self.eucaUITester.snapshot.test_ui_create_volume_from_snapshot()
        time.sleep(sleep_time)
        self.eucaUITester.volume.test_ui_check_volume_count("2")
        self.eucaUITester.snapshot.test_ui_register_snapshot_as_image("test-image")
        self.eucaUITester.volume.test_ui_delete_volume_all()
        time.sleep(sleep_time)
        self.eucaUITester.volume.test_ui_check_volume_count("0")
        self.eucaUITester.snapshot.test_ui_delete_all_snapshots()
        time.sleep(sleep_time)
        self.eucaUITester.snapshot.test_ui_check_snapshot_count("0")
{'fraction_non_alphanumeric': 0.08954013081174264, 'fraction_numerical': 0.005273031486082239, 'mean_word_length': 3.5689135974056057, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 28, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3733797', 'n_tokens_mistral': 7010, 'n_tokens_neox': 6409, 'n_words': 433}