| OLD | NEW |
| 1 AUTHOR = "Yolkfull Chow <yzhou@redhat.com>" | 1 AUTHOR = "Yolkfull Chow <yzhou@redhat.com>" |
| 2 TIME = "SHORT" | 2 TIME = "SHORT" |
| 3 NAME = "Migration across multiple hosts" | 3 NAME = "Migration across multiple hosts" |
| 4 TEST_CATEGORY = "Functional" | 4 TEST_CATEGORY = "Functional" |
| 5 TEST_CLASS = "Virtualization" | 5 TEST_CLASS = "Virtualization" |
| 6 TEST_TYPE = "Server" | 6 TEST_TYPE = "Server" |
| 7 DOC = """ | 7 DOC = """ |
| 8 Migrate KVM guest between two hosts. It parses the base config file, restricts | 8 Migrate KVM guest between two hosts. It parses the base config file, restricts |
| 9 it with appropriate parameters, generates the test dicts, modify the test_dicts | 9 it with appropriate parameters, generates the test dicts, modify the test_dicts |
| 10 so there's a distinction between the migration roles ('dest' or 'source'). | 10 so there's a distinction between the migration roles ('dest' or 'source'). |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 dest = hosts.create_host(pair[1]) | 43 dest = hosts.create_host(pair[1]) |
| 44 source_at = autotest.Autotest(source) | 44 source_at = autotest.Autotest(source) |
| 45 dest_at = autotest.Autotest(dest) | 45 dest_at = autotest.Autotest(dest) |
| 46 | 46 |
| 47 cfg_file = os.path.join(KVM_DIR, "tests_base.cfg") | 47 cfg_file = os.path.join(KVM_DIR, "tests_base.cfg") |
| 48 | 48 |
| 49 if not os.path.exists(cfg_file): | 49 if not os.path.exists(cfg_file): |
| 50 raise error.JobError("Config file %s was not found", cfg_file) | 50 raise error.JobError("Config file %s was not found", cfg_file) |
| 51 | 51 |
| 52 # Get test set (dictionary list) from the configuration file | 52 # Get test set (dictionary list) from the configuration file |
| 53 cfg = kvm_config.config() | 53 parser = kvm_config.Parser() |
| 54 test_variants = """ | 54 test_variants = """ |
| 55 image_name(_.*)? ?<= /tmp/kvm_autotest_root/images/ | 55 image_name(_.*)? ?<= /tmp/kvm_autotest_root/images/ |
| 56 cdrom(_.*)? ?<= /tmp/kvm_autotest_root/ | 56 cdrom(_.*)? ?<= /tmp/kvm_autotest_root/ |
| 57 floppy ?<= /tmp/kvm_autotest_root/ | 57 floppy ?<= /tmp/kvm_autotest_root/ |
| 58 Linux: | 58 Linux: |
| 59 unattended_install: | 59 unattended_install: |
| 60 kernel ?<= /tmp/kvm_autotest_root/ | 60 kernel ?<= /tmp/kvm_autotest_root/ |
| 61 initrd ?<= /tmp/kvm_autotest_root/ | 61 initrd ?<= /tmp/kvm_autotest_root/ |
| 62 qemu_binary = /usr/libexec/qemu-kvm | 62 qemu_binary = /usr/libexec/qemu-kvm |
| 63 qemu_img_binary = /usr/bin/qemu-img | 63 qemu_img_binary = /usr/bin/qemu-img |
| 64 only qcow2 | 64 only qcow2 |
| 65 only virtio_net | 65 only virtio_net |
| 66 only virtio_blk | 66 only virtio_blk |
| 67 only smp2 | 67 only smp2 |
| 68 only no_pci_assignable | 68 only no_pci_assignable |
| 69 only smallpages | 69 only smallpages |
| 70 only Fedora.13.64 | 70 only Fedora.14.64 |
| 71 only migrate_multi_host | 71 only migrate_multi_host |
| 72 nic_mode = tap | 72 nic_mode = tap |
| 73 nic_mac_nic1 = %s | 73 nic_mac_nic1 = %s |
| 74 """ % (generate_mac_address()) | 74 """ % (generate_mac_address()) |
| 75 cfg.fork_and_parse(cfg_file, test_variants) | 75 parser.parse_file(cfg_file) |
| 76 test_dicts = cfg.get_list() | 76 parser.parse_string(test_variants) |
| 77 test_dicts = parser.get_dicts() |
| 77 | 78 |
| 78 source_control_file = dest_control_file = """ | 79 source_control_file = dest_control_file = """ |
| 79 kvm_test_dir = os.path.join(os.environ['AUTODIR'],'tests/kvm') | 80 kvm_test_dir = os.path.join(os.environ['AUTODIR'],'tests/kvm') |
| 80 sys.path.append(kvm_test_dir)\n | 81 sys.path.append(kvm_test_dir)\n |
| 81 """ | 82 """ |
| 82 for params in test_dicts: | 83 for params in test_dicts: |
| 83 params['srchost'] = source.ip | 84 params['srchost'] = source.ip |
| 84 params['dsthost'] = dest.ip | 85 params['dsthost'] = dest.ip |
| 85 params['rootdir'] = rootdir | 86 params['rootdir'] = rootdir |
| 86 | 87 |
| (...skipping 26 matching lines...) Expand all Loading... |
| 113 | 114 |
| 114 # Grab the pairs (and failures) | 115 # Grab the pairs (and failures) |
| 115 (pairs, failures) = utils.form_ntuples_from_machines(machines, 2) | 116 (pairs, failures) = utils.form_ntuples_from_machines(machines, 2) |
| 116 | 117 |
| 117 # Log the failures | 118 # Log the failures |
| 118 for failure in failures: | 119 for failure in failures: |
| 119 job.record("FAIL", failure[0], "kvm", failure[1]) | 120 job.record("FAIL", failure[0], "kvm", failure[1]) |
| 120 | 121 |
| 121 # Now run through each pair and run | 122 # Now run through each pair and run |
| 122 job.parallel_simple(run, pairs, log=False) | 123 job.parallel_simple(run, pairs, log=False) |
| OLD | NEW |