diff options
Diffstat (limited to 'recipes-test/virt-test')
30 files changed, 2202 insertions, 0 deletions
diff --git a/recipes-test/virt-test/files/add_enea_linux_support.patch b/recipes-test/virt-test/files/add_enea_linux_support.patch new file mode 100644 index 0000000..0a5f2ba --- /dev/null +++ b/recipes-test/virt-test/files/add_enea_linux_support.patch | |||
| @@ -0,0 +1,78 @@ | |||
| 1 | virt-test: Add Enea Linux configuration | ||
| 2 | |||
| 3 | Upstream-Status: Inappropriate [configuration] | ||
| 4 | |||
| 5 | Signed-off-by: Petre Pircalabu <petre.pircalabu@enea.com> | ||
| 6 | Signed-off-by: Jonas Eriksson <jonas.eriksson@enea.com> | ||
| 7 | |||
| 8 | --- /dev/null | ||
| 9 | +++ b/shared/cfg/guest-os/Linux/Enea.cfg | ||
| 10 | @@ -0,0 +1,4 @@ | ||
| 11 | +- Enea: | ||
| 12 | + no setup | ||
| 13 | + shell_prompt = "^.*@.*[\#\$]\s*$" | ||
| 14 | + password = "" | ||
| 15 | --- /dev/null | ||
| 16 | +++ b/shared/cfg/guest-os/Linux/Enea/4.0_x86_64.cfg | ||
| 17 | @@ -0,0 +1,3 @@ | ||
| 18 | +- 4.0.x86_64: | ||
| 19 | + image_name = images/enea-4.0-x86_64 | ||
| 20 | + vm_arch_name = x86_64 | ||
| 21 | --- /dev/null | ||
| 22 | +++ b/shared/cfg/guest-os/Linux/Enea/4.0_ppc.cfg | ||
| 23 | @@ -0,0 +1,7 @@ | ||
| 24 | +- 4.0.ppc: | ||
| 25 | + image_name = images/enea-4.0-ppc | ||
| 26 | + only p4080ds | ||
| 27 | + kernel = images/enea-4.0-ppc.uImage | ||
| 28 | + initrd = images/enea-4.0-ppc.cpio.gz | ||
| 29 | + kernel_params = "console=ttyS0,115200n8" | ||
| 30 | + vm_arch_name = ppc | ||
| 31 | --- /dev/null | ||
| 32 | +++ b/shared/cfg/guest-os/Linux/Enea/4.0_ppc64.cfg | ||
| 33 | @@ -0,0 +1,6 @@ | ||
| 34 | +- 4.0.ppc64: | ||
| 35 | + image_name = images/enea-4.0-ppc64 | ||
| 36 | + kernel = images/enea-4.0-ppc64.uImage | ||
| 37 | + initrd = images/enea-4.0-ppc64.cpio.gz | ||
| 38 | + kernel_params = "console=ttyS0,115200n8" | ||
| 39 | + vm_arch_name = ppc64 | ||
| 40 | --- /dev/null | ||
| 41 | +++ b/shared/downloads/enea-4.0-x86_64.ini | ||
| 42 | @@ -0,0 +1,5 @@ | ||
| 43 | +[enea-4.0-x86_64] | ||
| 44 | +title = Enea Linux 4.0 x86_64 | ||
| 45 | +destination = images/enea-4.0-x86_64.qcow2.gz | ||
| 46 | +destination_uncompressed = images/enea-4.0-x86_64.qcow2 | ||
| 47 | + | ||
| 48 | --- /dev/null | ||
| 49 | +++ b/shared/downloads/enea-4.0-ppc.ini | ||
| 50 | @@ -0,0 +1,4 @@ | ||
| 51 | +[enea-4.0-ppc] | ||
| 52 | +title = Enea Linux 4.0 ppc(32) | ||
| 53 | +destination = images/enea-4.0-ppc.qcow2.gz | ||
| 54 | +destination_uncompressed = images/enea-4.0-ppc.qcow2 | ||
| 55 | --- /dev/null | ||
| 56 | +++ b/shared/downloads/enea-4.0-ppc64.ini | ||
| 57 | @@ -0,0 +1,4 @@ | ||
| 58 | +[enea-4.0-ppc64] | ||
| 59 | +title = Enea Linux 4.0 ppc64 | ||
| 60 | +destination = images/enea-4.0-ppc64.qcow2.gz | ||
| 61 | +destination_uncompressed = images/enea-4.0-ppc64.qcow2 | ||
| 62 | diff --git a/shared/cfg/machines.cfg b/shared/cfg/machines.cfg | ||
| 63 | index 0636d17..a81b81c 100644 | ||
| 64 | --- a/shared/cfg/machines.cfg | ||
| 65 | +++ b/shared/cfg/machines.cfg | ||
| 66 | @@ -15,3 +15,12 @@ variants: | ||
| 67 | - @pseries: | ||
| 68 | only ppc64 | ||
| 69 | machine_type = pseries | ||
| 70 | + - @p4080ds: | ||
| 71 | + only ppc | ||
| 72 | + machine_type = ppce500 | ||
| 73 | + display = nographic | ||
| 74 | + take_regular_screendumps = no | ||
| 75 | + direct_serials = "serial0" | ||
| 76 | + isa_serials = "" | ||
| 77 | + cpu_model = e500mc | ||
| 78 | + auto_cpu_model = no | ||
diff --git a/recipes-test/virt-test/files/allow_bootstrap_3rd_party_image.patch b/recipes-test/virt-test/files/allow_bootstrap_3rd_party_image.patch new file mode 100644 index 0000000..7e53f59 --- /dev/null +++ b/recipes-test/virt-test/files/allow_bootstrap_3rd_party_image.patch | |||
| @@ -0,0 +1,233 @@ | |||
| 1 | virt-test: Bootstrap using other OS images. | ||
| 2 | |||
| 3 | Upstream-Status: Accepted | ||
| 4 | |||
| 5 | Signed-off-by: Petre Pircalabu <petre.pircalabu@enea.com> | ||
| 6 | |||
| 7 | --- a/run | ||
| 8 | +++ b/run | ||
| 9 | @@ -10,6 +10,7 @@ import traceback | ||
| 10 | import signal | ||
| 11 | import optparse | ||
| 12 | import logging | ||
| 13 | +import virttest.defaults | ||
| 14 | |||
| 15 | |||
| 16 | class StreamProxy(object): | ||
| 17 | @@ -173,9 +174,8 @@ class VirtTestRunParser(optparse.OptionP | ||
| 18 | def __init__(self): | ||
| 19 | optparse.OptionParser.__init__(self, usage='Usage: %prog [options]') | ||
| 20 | from virttest import data_dir | ||
| 21 | - from virttest import bootstrap | ||
| 22 | - jeos_info = bootstrap.get_jeos_info() | ||
| 23 | - self.default_guest_os = jeos_info['variant'] | ||
| 24 | + os_info = virttest.defaults.get_default_guest_os_info() | ||
| 25 | + self.default_guest_os = os_info['variant'] | ||
| 26 | |||
| 27 | try: | ||
| 28 | qemu_bin_path = _find_default_qemu_paths()[0] | ||
| 29 | @@ -267,7 +267,7 @@ class VirtTestRunParser(optparse.OptionP | ||
| 30 | help=("Machine type under test. " | ||
| 31 | "If -c is provided, this will be ignored. " | ||
| 32 | "Default: all for the chosen guests, %s if " | ||
| 33 | - "--guest-os not given." % DEFAULT_MACHINE_TYPE)) | ||
| 34 | + "--guest-os not given." % virttest.defaults.DEFAULT_MACHINE_TYPE)) | ||
| 35 | general.add_option("--tests", action="store", dest="tests", | ||
| 36 | default="", | ||
| 37 | help=('List of space separated tests to be ' | ||
| 38 | @@ -415,7 +415,6 @@ def variant_only_file(filename): | ||
| 39 | return ", ".join(result) | ||
| 40 | |||
| 41 | |||
| 42 | -DEFAULT_MACHINE_TYPE = "i440fx" | ||
| 43 | QEMU_DEFAULT_SET = "migrate..tcp, migrate..unix, migrate..exec, migrate..fd" | ||
| 44 | LIBVIRT_DEFAULT_SET = variant_only_file('backends/libvirt/cfg/default_tests') | ||
| 45 | LVSB_DEFAULT_SET = ("lvsb_date") | ||
| 46 | @@ -546,7 +545,7 @@ class VirtTestApp(object): | ||
| 47 | # TODO: this is x86-specific, instead we can get the default | ||
| 48 | # arch from qemu binary and run on all supported machine types | ||
| 49 | if self.options.arch is None and self.options.guest_os is None: | ||
| 50 | - self.cartesian_parser.only_filter(DEFAULT_MACHINE_TYPE) | ||
| 51 | + self.cartesian_parser.only_filter(virttest.defaults.DEFAULT_MACHINE_TYPE) | ||
| 52 | else: | ||
| 53 | self.cartesian_parser.only_filter(self.options.machine_type) | ||
| 54 | else: | ||
| 55 | @@ -827,7 +826,9 @@ class VirtTestApp(object): | ||
| 56 | selinux=self.options.selinux_setup, | ||
| 57 | restore_image=keep_image, | ||
| 58 | verbose=self.options.verbose, | ||
| 59 | - update_providers=self.options.update_providers) | ||
| 60 | + update_providers=self.options.update_providers, | ||
| 61 | + guest_os=(self.options.guest_os or | ||
| 62 | + self.option_parser.default_guest_os)) | ||
| 63 | sys.exit(0) | ||
| 64 | |||
| 65 | if self.options.type: | ||
| 66 | --- a/virttest/bootstrap.py | ||
| 67 | +++ b/virttest/bootstrap.py | ||
| 68 | @@ -9,6 +9,7 @@ import data_dir | ||
| 69 | import asset | ||
| 70 | import cartesian_config | ||
| 71 | import utils_selinux | ||
| 72 | +import defaults | ||
| 73 | |||
| 74 | basic_program_requirements = ['tcpdump', 'nc', 'ip', 'arping'] | ||
| 75 | |||
| 76 | @@ -53,15 +54,30 @@ last_subtest = {'qemu': ['shutdown'], | ||
| 77 | test_filter = ['__init__', 'cfg', 'dropin.py'] | ||
| 78 | |||
| 79 | |||
| 80 | -def get_jeos_info(): | ||
| 81 | +def get_guest_os_info_list(test_name, guest_os): | ||
| 82 | """ | ||
| 83 | - Gets the correct asset and variant information depending on host OS. | ||
| 84 | + Returns a list of matching assets compatible with the specified test name | ||
| 85 | + and guest OS | ||
| 86 | """ | ||
| 87 | - jeos_info = {'asset': 'jeos-19-64', 'variant': 'JeOS.19'} | ||
| 88 | - issue_contents = utils.read_file('/etc/issue') | ||
| 89 | - if 'Fedora' in issue_contents and '20' in issue_contents: | ||
| 90 | - jeos_info = {'asset': 'jeos-20-64', 'variant': 'JeOS.20'} | ||
| 91 | - return jeos_info | ||
| 92 | + | ||
| 93 | + os_info_list = [] | ||
| 94 | + | ||
| 95 | + cartesian_parser = cartesian_config.Parser() | ||
| 96 | + cartesian_parser.parse_file(data_dir.get_backend_cfg_path(test_name, 'guest-os.cfg')) | ||
| 97 | + cartesian_parser.only_filter(guest_os) | ||
| 98 | + dicts = cartesian_parser.get_dicts(); | ||
| 99 | + | ||
| 100 | + for params in dicts: | ||
| 101 | + image_name = params.get('image_name', 'image').split('/')[-1] | ||
| 102 | + shortname = params.get('shortname', guest_os) | ||
| 103 | + os_info_list.append({'asset': image_name, 'variant': shortname}) | ||
| 104 | + | ||
| 105 | + if not os_info_list: | ||
| 106 | + logging.error("Could not find any assets compatible with %s for %s", | ||
| 107 | + guest_os, test_name) | ||
| 108 | + raise ValueError("Missing compatible assets for %s", guest_os) | ||
| 109 | + | ||
| 110 | + return os_info_list | ||
| 111 | |||
| 112 | |||
| 113 | def _get_config_filter(): | ||
| 114 | @@ -704,7 +720,8 @@ def verify_selinux(datadir, imagesdir, i | ||
| 115 | def bootstrap(test_name, test_dir, base_dir, default_userspace_paths, | ||
| 116 | check_modules, online_docs_url, restore_image=False, | ||
| 117 | download_image=True, interactive=True, selinux=False, | ||
| 118 | - verbose=False, update_providers=False): | ||
| 119 | + verbose=False, update_providers=False, | ||
| 120 | + guest_os=defaults.DEFAULT_GUEST_OS): | ||
| 121 | """ | ||
| 122 | Common virt test assistant module. | ||
| 123 | |||
| 124 | @@ -723,6 +740,8 @@ def bootstrap(test_name, test_dir, base_ | ||
| 125 | :param selinux: Whether setup SELinux contexts for shared/data. | ||
| 126 | :param update_providers: Whether to update test providers if they are already | ||
| 127 | downloaded. | ||
| 128 | + :param guest_os: Specify the guest image used for bootstrapping. By default | ||
| 129 | + the JeOS image is used. | ||
| 130 | |||
| 131 | :raise error.CmdError: If JeOS image failed to uncompress | ||
| 132 | :raise ValueError: If 7za was not found | ||
| 133 | @@ -790,10 +809,10 @@ def bootstrap(test_name, test_dir, base_ | ||
| 134 | step += 2 | ||
| 135 | logging.info("%s - Verifying (and possibly downloading) guest image", | ||
| 136 | step) | ||
| 137 | - jeos_info = get_jeos_info() | ||
| 138 | - jeos_asset = jeos_info['asset'] | ||
| 139 | - asset.download_asset(jeos_asset, interactive=interactive, | ||
| 140 | - restore_image=restore_image) | ||
| 141 | + for os_info in get_guest_os_info_list(test_name, guest_os): | ||
| 142 | + os_asset = os_info['asset'] | ||
| 143 | + asset.download_asset(os_asset, interactive=interactive, | ||
| 144 | + restore_image=restore_image) | ||
| 145 | |||
| 146 | if check_modules: | ||
| 147 | logging.info("") | ||
| 148 | --- /dev/null | ||
| 149 | +++ b/virttest/defaults.py | ||
| 150 | @@ -0,0 +1,18 @@ | ||
| 151 | +DEFAULT_MACHINE_TYPE = "i440fx" | ||
| 152 | +DEFAULT_GUEST_OS = "JeOS.19" | ||
| 153 | + | ||
| 154 | + | ||
| 155 | +def get_default_guest_os_info(): | ||
| 156 | + """ | ||
| 157 | + Gets the default asset and variant information depending on host OS | ||
| 158 | + """ | ||
| 159 | + os_info = {'asset': 'jeos-19-64', 'variant': DEFAULT_GUEST_OS} | ||
| 160 | + | ||
| 161 | + from autotest.client import utils | ||
| 162 | + | ||
| 163 | + issue_contents = utils.read_file('/etc/issue') | ||
| 164 | + | ||
| 165 | + if 'Fedora' in issue_contents and '20' in issue_contents: | ||
| 166 | + os_info = {'asset': 'jeos-20-64', 'variant': 'JeOS.20'} | ||
| 167 | + | ||
| 168 | + return os_info | ||
| 169 | --- a/virttest/standalone_test.py | ||
| 170 | +++ b/virttest/standalone_test.py | ||
| 171 | @@ -24,6 +24,7 @@ import arch | ||
| 172 | import funcatexit | ||
| 173 | import version | ||
| 174 | import qemu_vm | ||
| 175 | +import defaults | ||
| 176 | |||
| 177 | global GUEST_NAME_LIST | ||
| 178 | GUEST_NAME_LIST = None | ||
| 179 | @@ -226,7 +227,7 @@ class Test(object): | ||
| 180 | % error_message) | ||
| 181 | |||
| 182 | except Exception, e: | ||
| 183 | - if (not t_type is None): | ||
| 184 | + if (t_type is not None): | ||
| 185 | error_message = funcatexit.run_exitfuncs(env, t_type) | ||
| 186 | if error_message: | ||
| 187 | logging.error(error_message) | ||
| 188 | @@ -306,7 +307,7 @@ class Bcolors(object): | ||
| 189 | allowed_terms = ['linux', 'xterm', 'xterm-256color', 'vt100', | ||
| 190 | 'screen', 'screen-256color'] | ||
| 191 | term = os.environ.get("TERM") | ||
| 192 | - if (not os.isatty(1)) or (not term in allowed_terms): | ||
| 193 | + if (not os.isatty(1)) or (term not in allowed_terms): | ||
| 194 | self.disable() | ||
| 195 | |||
| 196 | def disable(self): | ||
| 197 | @@ -392,7 +393,7 @@ def print_fail(t_elapsed, open_fd=False) | ||
| 198 | bcolors.ENDC + " (%.2f s)" % t_elapsed) | ||
| 199 | fd_fail_msg = (bcolors.FAIL + "FAIL" + | ||
| 200 | bcolors.ENDC + " (%.2f s) (%s fd)" % | ||
| 201 | - (t_elapsed, utils_misc.get_virt_test_open_fds())) | ||
| 202 | + (t_elapsed, utils_misc.get_virt_test_open_fds())) | ||
| 203 | if open_fd: | ||
| 204 | msg = fd_fail_msg | ||
| 205 | else: | ||
| 206 | @@ -667,6 +668,8 @@ def bootstrap_tests(options): | ||
| 207 | else: | ||
| 208 | restore_image = False | ||
| 209 | |||
| 210 | + os_info = defaults.get_default_guest_os_info() | ||
| 211 | + | ||
| 212 | kwargs = {'test_name': options.type, | ||
| 213 | 'test_dir': test_dir, | ||
| 214 | 'base_dir': data_dir.get_data_dir(), | ||
| 215 | @@ -677,7 +680,8 @@ def bootstrap_tests(options): | ||
| 216 | 'selinux': options.selinux_setup, | ||
| 217 | 'restore_image': restore_image, | ||
| 218 | 'interactive': False, | ||
| 219 | - 'update_providers': options.update_providers} | ||
| 220 | + 'update_providers': options.update_providers, | ||
| 221 | + 'guest_os': options.guest_os or os_info['variant']} | ||
| 222 | |||
| 223 | # Tolerance we have without printing a message for the user to wait (3 s) | ||
| 224 | tolerance = 3 | ||
| 225 | @@ -909,7 +913,7 @@ def run_tests(parser, options): | ||
| 226 | dependencies_satisfied = True | ||
| 227 | for dep in dct.get("dep"): | ||
| 228 | for test_name in status_dct.keys(): | ||
| 229 | - if not dep in test_name: | ||
| 230 | + if dep not in test_name: | ||
| 231 | continue | ||
| 232 | |||
| 233 | if not status_dct[test_name]: | ||
diff --git a/recipes-test/virt-test/files/clear_mandatory_header_list.patch b/recipes-test/virt-test/files/clear_mandatory_header_list.patch new file mode 100644 index 0000000..3627b7e --- /dev/null +++ b/recipes-test/virt-test/files/clear_mandatory_header_list.patch | |||
| @@ -0,0 +1,13 @@ | |||
| 1 | diff --git a/virttest/bootstrap.py b/virttest/bootstrap.py | ||
| 2 | index c4e2623..76e3f34 100644 | ||
| 3 | --- a/virttest/bootstrap.py | ||
| 4 | +++ b/virttest/bootstrap.py | ||
| 5 | @@ -29,7 +29,7 @@ mandatory_programs = {'qemu': basic_program_requirements, | ||
| 6 | 'v2v': basic_program_requirements, | ||
| 7 | 'libguestfs': basic_program_requirements} | ||
| 8 | |||
| 9 | -mandatory_headers = {'qemu': ['Python.h', 'types.h', 'socket.h', 'unistd.h'], | ||
| 10 | +mandatory_headers = {'qemu': [], | ||
| 11 | 'libvirt': [], | ||
| 12 | 'openvswitch': [], | ||
| 13 | 'v2v': [], | ||
diff --git a/recipes-test/virt-test/files/dnsmasq-virt-test b/recipes-test/virt-test/files/dnsmasq-virt-test new file mode 100644 index 0000000..dc87fea --- /dev/null +++ b/recipes-test/virt-test/files/dnsmasq-virt-test | |||
| @@ -0,0 +1,2 @@ | |||
| 1 | interface=virbr0 | ||
| 2 | dhcp-range=10.99.99.10,10.99.99.254,24 | ||
diff --git a/recipes-test/virt-test/files/do_not_upgrade_test_providers.patch b/recipes-test/virt-test/files/do_not_upgrade_test_providers.patch new file mode 100644 index 0000000..1a92622 --- /dev/null +++ b/recipes-test/virt-test/files/do_not_upgrade_test_providers.patch | |||
| @@ -0,0 +1,27 @@ | |||
| 1 | commit 7e3029cf20a653170522bcb70d5cf8a98605b466 | ||
| 2 | Author: Jonas Eriksson <jonas.eriksson@enea.com> | ||
| 3 | Date: Tue Mar 25 15:10:01 2014 +0100 | ||
| 4 | |||
| 5 | Don't try to upgrade test providers | ||
| 6 | |||
| 7 | This works bad with embedded systems that does not have git installed. | ||
| 8 | |||
| 9 | Signed-off-by: Jonas Eriksson <jonas.eriksson@enea.com> | ||
| 10 | Upstream-Status: Inappropriate [disable feature] | ||
| 11 | |||
| 12 | diff --git a/virttest/bootstrap.py b/virttest/bootstrap.py | ||
| 13 | index 7a5d716..d85679f 100644 | ||
| 14 | --- a/virttest/bootstrap.py | ||
| 15 | +++ b/virttest/bootstrap.py | ||
| 16 | @@ -724,11 +724,6 @@ def bootstrap(test_name, test_dir, base_dir, default_userspace_paths, | ||
| 17 | |||
| 18 | logging.info("") | ||
| 19 | step += 1 | ||
| 20 | - logging.info("%d - Updating all test providers", step) | ||
| 21 | - asset.download_all_test_providers(update_providers) | ||
| 22 | - | ||
| 23 | - logging.info("") | ||
| 24 | - step += 1 | ||
| 25 | logging.info("%d - Checking the mandatory programs and headers", step) | ||
| 26 | verify_mandatory_programs(test_name) | ||
| 27 | |||
diff --git a/recipes-test/virt-test/files/enea-image-virt-test-guest.wks b/recipes-test/virt-test/files/enea-image-virt-test-guest.wks new file mode 100644 index 0000000..ae07199 --- /dev/null +++ b/recipes-test/virt-test/files/enea-image-virt-test-guest.wks | |||
| @@ -0,0 +1,10 @@ | |||
| 1 | # short-description: Create a 'pcbios' direct disk image | ||
| 2 | # long-description: Creates a partitioned legacy BIOS disk image that the user | ||
| 3 | # can directly dd to boot media. | ||
| 4 | |||
| 5 | |||
| 6 | part /boot --source bootimg-pcbios --ondisk vda --fstype=msdos --label boot --active --align 1024 | ||
| 7 | part / --source rootfs --ondisk vda --fstype=ext3 --label platform --align 1024 | ||
| 8 | |||
| 9 | bootloader --timeout=0 --append="rootwait rootfstype=ext3 console=ttyS0" | ||
| 10 | |||
diff --git a/recipes-test/virt-test/files/fix_asset_uncompress.patch b/recipes-test/virt-test/files/fix_asset_uncompress.patch new file mode 100644 index 0000000..9b2b05c --- /dev/null +++ b/recipes-test/virt-test/files/fix_asset_uncompress.patch | |||
| @@ -0,0 +1,29 @@ | |||
| 1 | virt-test: Fixed asset uncompression | ||
| 2 | |||
| 3 | Fix a mismatch in the uncompress command to allow it to work also with | ||
| 4 | the other compression types. | ||
| 5 | |||
| 6 | Upstream-Status: Accepted | ||
| 7 | https://github.com/autotest/virt-test/commit/a4f4b89b0bf3adffb0188f4091b5c66d41f7eba7 | ||
| 8 | |||
| 9 | Signed-off-by: Petre Pircalabu <petre.pircalabu@enea.com> | ||
| 10 | |||
| 11 | --- a/virttest/asset.py | ||
| 12 | +++ b/virttest/asset.py | ||
| 13 | @@ -91,13 +91,13 @@ def uncompress_asset(asset_info, force=F | ||
| 14 | if match: | ||
| 15 | if match.group(1) == 'gz': | ||
| 16 | uncompress_cmd = ('gzip -cd %s > %s' % | ||
| 17 | - (destination_uncompressed, destination)) | ||
| 18 | + (destination, destination_uncompressed)) | ||
| 19 | elif match.group(1) == 'xz': | ||
| 20 | uncompress_cmd = ('xz -cd %s > %s' % | ||
| 21 | - (destination_uncompressed, destination)) | ||
| 22 | + (destination, destination_uncompressed)) | ||
| 23 | elif match.group(1) == 'bz2': | ||
| 24 | uncompress_cmd = ('bzip2 -cd %s > %s' % | ||
| 25 | - (destination_uncompressed, destination)) | ||
| 26 | + (destination, destination_uncompressed)) | ||
| 27 | elif match.group(1) == '7z': | ||
| 28 | uncompress_cmd = '7za -y e %s' % destination | ||
| 29 | else: | ||
diff --git a/recipes-test/virt-test/files/qemu-tests-clock-getres-config.patch b/recipes-test/virt-test/files/qemu-tests-clock-getres-config.patch new file mode 100644 index 0000000..5319df3 --- /dev/null +++ b/recipes-test/virt-test/files/qemu-tests-clock-getres-config.patch | |||
| @@ -0,0 +1,20 @@ | |||
| 1 | commit 99efd456e7bb88c39a036e391a7f05dbc7a38039 | ||
| 2 | Author: Jonas Eriksson <jonas.eriksson@enea.com> | ||
| 3 | Date: Thu Mar 27 17:47:21 2014 +0100 | ||
| 4 | |||
| 5 | clock_getres: Add configuration | ||
| 6 | |||
| 7 | Signed-off-by: Jonas Eriksson <jonas.eriksson@enea.com> | ||
| 8 | Upstream-Status: Inappropriate [configuration] | ||
| 9 | |||
| 10 | diff --git a/generic/tests/cfg/clock_getres.cfg b/generic/tests/cfg/clock_getres.cfg | ||
| 11 | index b0ae0c1..c9ec791 100644 | ||
| 12 | --- a/generic/tests/cfg/clock_getres.cfg | ||
| 13 | +++ b/generic/tests/cfg/clock_getres.cfg | ||
| 14 | @@ -1,5 +1,5 @@ | ||
| 15 | - clock_getres: install setup image_copy unattended_install.cdrom | ||
| 16 | virt_test_type = qemu libvirt | ||
| 17 | - no JeOS | ||
| 18 | only Linux | ||
| 19 | type = clock_getres | ||
| 20 | + getres_cmd = "/opt/virt-test/test-providers.d/downloads/io-github-autotest-qemu/generic/deps/clock_getres/clock_getres" | ||
diff --git a/recipes-test/virt-test/files/qemu-tests-cpuflags-build-avoidance.patch b/recipes-test/virt-test/files/qemu-tests-cpuflags-build-avoidance.patch new file mode 100644 index 0000000..2a082cc --- /dev/null +++ b/recipes-test/virt-test/files/qemu-tests-cpuflags-build-avoidance.patch | |||
| @@ -0,0 +1,516 @@ | |||
| 1 | commit 4f271849224b5a5b3ca93c78e4b5ca8aee350bc6 | ||
| 2 | Author: Jonas Eriksson <jonas.eriksson@enea.com> | ||
| 3 | Date: Wed Mar 26 17:29:36 2014 +0100 | ||
| 4 | |||
| 5 | cpuflags: Avoid building on test target | ||
| 6 | |||
| 7 | The cpuflags-test utility is built with different compiler flags | ||
| 8 | depending on the callee, meaning that pre-building is tricky. By | ||
| 9 | separating the builds from each other using a suffix based on the | ||
| 10 | extra flags, we can pre-build multiple versions of the application. | ||
| 11 | |||
| 12 | Signed-off-by: Jonas Eriksson <jonas.eriksson@enea.com> | ||
| 13 | Upstream-Status: Pending | ||
| 14 | |||
| 15 | diff --git a/provider/cpuflags.py b/provider/cpuflags.py | ||
| 16 | index 70255cf..ea2031c 100644 | ||
| 17 | --- a/provider/cpuflags.py | ||
| 18 | +++ b/provider/cpuflags.py | ||
| 19 | @@ -2,6 +2,7 @@ | ||
| 20 | Shared code for tests that make use of cpuflags | ||
| 21 | """ | ||
| 22 | import os | ||
| 23 | +import md5 | ||
| 24 | from virttest import data_dir | ||
| 25 | |||
| 26 | |||
| 27 | @@ -12,19 +13,36 @@ def install_cpuflags_util_on_vm(test, vm, dst_dir, extra_flags=None): | ||
| 28 | :param vm: virtual machine. | ||
| 29 | :param dst_dir: Installation path. | ||
| 30 | :param extra_flags: Extraflags for gcc compiler. | ||
| 31 | + :return: The full path to the cpu_flags command built with the supplied | ||
| 32 | + extra_flags | ||
| 33 | """ | ||
| 34 | if not extra_flags: | ||
| 35 | extra_flags = "" | ||
| 36 | |||
| 37 | - cpuflags_src = data_dir.get_deps_dir("cpu_flags") | ||
| 38 | + # The suffix is the first 8 chars of the hex representation of the md5sum | ||
| 39 | + # of the extra flags | ||
| 40 | + extra_flags_hash = md5.new() | ||
| 41 | + extra_flags_hash.update(extra_flags) | ||
| 42 | + suffix = (extra_flags_hash.hexdigest())[:8] | ||
| 43 | + | ||
| 44 | cpuflags_dst = os.path.join(dst_dir, "cpu_flags") | ||
| 45 | + cpuflags_cmd = os.path.join(dst_dir, "cpuflags-test-%s" % suffix) | ||
| 46 | session = vm.wait_for_login() | ||
| 47 | - session.cmd("rm -rf %s" % | ||
| 48 | - (cpuflags_dst)) | ||
| 49 | - session.cmd("sync") | ||
| 50 | - vm.copy_files_to(cpuflags_src, dst_dir) | ||
| 51 | - session.cmd("sync") | ||
| 52 | - session.cmd("cd %s; cd src; make EXTRA_FLAGS='%s';" % | ||
| 53 | - (cpuflags_dst, extra_flags)) | ||
| 54 | - session.cmd("sync") | ||
| 55 | + | ||
| 56 | + if session.cmd_status("test -x '%s'" % cpuflags_cmd): | ||
| 57 | + cpuflags_cmd = os.path.join(cpuflags_dst, "cpuflags-test-%s" % suffix) | ||
| 58 | + if session.cmd_status("test -x '%s'" % cpuflags_cmd): | ||
| 59 | + cpuflags_src = os.path.join(data_dir.get_deps_dir(), "cpu_flags") | ||
| 60 | + | ||
| 61 | + session.cmd("rm -rf %s" % (cpuflags_dst)) | ||
| 62 | + session.cmd("mkdir -p %s" % (dst_dir)) | ||
| 63 | + session.cmd("sync") | ||
| 64 | + vm.copy_files_to(cpuflags_src, dst_dir) | ||
| 65 | + session.cmd("sync") | ||
| 66 | + session.cmd("make -C %s EXTRA_FLAGS='%s';" % | ||
| 67 | + (cpuflags_dst, extra_flags)) | ||
| 68 | + session.cmd("sync") | ||
| 69 | + | ||
| 70 | session.close() | ||
| 71 | + | ||
| 72 | + return cpuflags_cmd | ||
| 73 | diff --git a/deps/cpu_flags/src/.gitignore b/deps/cpu_flags/src/.gitignore | ||
| 74 | new file mode 100644 | ||
| 75 | index 0000000..1d04e1f | ||
| 76 | --- /dev/null | ||
| 77 | +++ b/qemu/deps/cpu_flags/src/.gitignore | ||
| 78 | @@ -0,0 +1,2 @@ | ||
| 79 | +build-*/ | ||
| 80 | +cpuflags-test-* | ||
| 81 | diff --git a/deps/cpu_flags/src/Makefile b/deps/cpu_flags/src/Makefile | ||
| 82 | index 1513649..3be1920 100644 | ||
| 83 | --- a/deps/cpu_flags/src/Makefile | ||
| 84 | +++ b/deps/cpu_flags/src/Makefile | ||
| 85 | @@ -45,63 +45,77 @@ CC=gcc | ||
| 86 | |||
| 87 | LIBS=-lgomp | ||
| 88 | |||
| 89 | -.PHONY: default all cpuflags-test clean | ||
| 90 | +# Use the first 8 characters of the md5sum of the extra flags as suffix | ||
| 91 | +SUFFIX=$(shell echo -n '$(EXTRA_FLAGS)' | md5sum | cut -c 1-8) | ||
| 92 | +BUILDDIR=build-$(SUFFIX) | ||
| 93 | +BUILDDIR_IND=build-$(SUFFIX)/.created | ||
| 94 | |||
| 95 | -default:cpuflags-test | ||
| 96 | +.PHONY: default all clean suffix | ||
| 97 | |||
| 98 | -all:cpuflags-test | ||
| 99 | +default: cpuflags-test-$(SUFFIX) | ||
| 100 | |||
| 101 | -cpuflags-test: avx.o fma4.o xop.o sse4a.o sse4.o ssse3.o sse3.o aes.o pclmul.o rdrand.o stress.o stressmem.o | ||
| 102 | - $(CC) $(CFLAGS) $(LIBS) cpuflags-test.c -o cpuflags-test \ | ||
| 103 | - aes.o \ | ||
| 104 | - pclmul.o \ | ||
| 105 | - rdrand.o \ | ||
| 106 | - avx.o \ | ||
| 107 | - fma4.o \ | ||
| 108 | - xop.o \ | ||
| 109 | - sse4a.o \ | ||
| 110 | - sse4.o \ | ||
| 111 | - ssse3.o \ | ||
| 112 | - sse3.o \ | ||
| 113 | - stress.o \ | ||
| 114 | - stressmem.o \ | ||
| 115 | +all: cpuflags-test-$(SUFFIX) | ||
| 116 | |||
| 117 | -aes.o: aes.c tests.h | ||
| 118 | - $(CC) $(CFLAGSAES) $(LIBS) -c aes.c | ||
| 119 | +suffix: | ||
| 120 | + @echo $(SUFFIX) | ||
| 121 | |||
| 122 | -pclmul.o: pclmul.c tests.h | ||
| 123 | - $(CC) $(CFLAGSPCLMUL) $(LIBS) -c pclmul.c | ||
| 124 | +# The timestamp of builddir will be updated as we write files, so let the | ||
| 125 | +# creation of .o files depend on a file (builddir indicator) inside builddir to | ||
| 126 | +# make sure that builddir is created. | ||
| 127 | +$(BUILDDIR_IND): | ||
| 128 | + $(MKDIR) $(BUILDDIR) | ||
| 129 | + touch $(BUILDDIR_IND) | ||
| 130 | |||
| 131 | -rdrand.o: rdrand.c tests.h | ||
| 132 | - $(CC) $(CFLAGSRDRAND) $(LIBS) -c rdrand.c | ||
| 133 | +cpuflags-test-$(SUFFIX): cpuflags-test.c \ | ||
| 134 | + $(BUILDDIR)/avx.o \ | ||
| 135 | + $(BUILDDIR)/fma4.o \ | ||
| 136 | + $(BUILDDIR)/xop.o \ | ||
| 137 | + $(BUILDDIR)/sse4a.o \ | ||
| 138 | + $(BUILDDIR)/sse4.o \ | ||
| 139 | + $(BUILDDIR)/ssse3.o \ | ||
| 140 | + $(BUILDDIR)/sse3.o \ | ||
| 141 | + $(BUILDDIR)/aes.o \ | ||
| 142 | + $(BUILDDIR)/pclmul.o \ | ||
| 143 | + $(BUILDDIR)/rdrand.o \ | ||
| 144 | + $(BUILDDIR)/stress.o \ | ||
| 145 | + $(BUILDDIR)/stressmem.o | ||
| 146 | + $(CC) $(CFLAGS) $^ $(LIBS) -o $@ | ||
| 147 | |||
| 148 | -fma4.o: fma4.c tests.h | ||
| 149 | - $(CC) $(CFLAGSFMA4) $(LIBS) -c fma4.c | ||
| 150 | +$(BUILDDIR)/aes.o: aes.c tests.h $(BUILDDIR_IND) | ||
| 151 | + $(CC) -o $@ $(CFLAGSAES) $(LIBS) -c aes.c | ||
| 152 | |||
| 153 | -xop.o: xop.c tests.h | ||
| 154 | - $(CC) $(CFLAGSXOP) $(LIBS) -c xop.c | ||
| 155 | +$(BUILDDIR)/pclmul.o: pclmul.c tests.h $(BUILDDIR_IND) | ||
| 156 | + $(CC) -o $@ $(CFLAGSPCLMUL) $(LIBS) -c pclmul.c | ||
| 157 | |||
| 158 | -avx.o: avx.c tests.h | ||
| 159 | - $(CC) $(CFLAGSAVX) $(LIBS) -c avx.c | ||
| 160 | +$(BUILDDIR)/rdrand.o: rdrand.c tests.h $(BUILDDIR_IND) | ||
| 161 | + $(CC) -o $@ $(CFLAGSRDRAND) $(LIBS) -c rdrand.c | ||
| 162 | |||
| 163 | -sse4a.o: sse4a.c tests.h | ||
| 164 | - $(CC) $(CFLAGSSSE4A) $(LIBS) -c sse4a.c | ||
| 165 | +$(BUILDDIR)/fma4.o: fma4.c tests.h $(BUILDDIR_IND) | ||
| 166 | + $(CC) -o $@ $(CFLAGSFMA4) $(LIBS) -c fma4.c | ||
| 167 | |||
| 168 | -sse4.o: sse4.c tests.h | ||
| 169 | - $(CC) $(CFLAGSSSE4) $(LIBS) -c sse4.c | ||
| 170 | +$(BUILDDIR)/xop.o: xop.c tests.h $(BUILDDIR_IND) | ||
| 171 | + $(CC) -o $@ $(CFLAGSXOP) $(LIBS) -c xop.c | ||
| 172 | |||
| 173 | -ssse3.o: ssse3.c tests.h | ||
| 174 | - $(CC) $(CFLAGSSSSE3) $(LIBS) -c ssse3.c | ||
| 175 | +$(BUILDDIR)/avx.o: avx.c tests.h $(BUILDDIR_IND) | ||
| 176 | + $(CC) -o $@ $(CFLAGSAVX) $(LIBS) -c avx.c | ||
| 177 | |||
| 178 | -sse3.o: sse3.c tests.h | ||
| 179 | - $(CC) $(CFLAGSSSE3) $(LIBS) -c sse3.c | ||
| 180 | +$(BUILDDIR)/sse4a.o: sse4a.c tests.h $(BUILDDIR_IND) | ||
| 181 | + $(CC) -o $@ $(CFLAGSSSE4A) $(LIBS) -c sse4a.c | ||
| 182 | |||
| 183 | -stress.o: stress.c tests.h | ||
| 184 | - $(CC) $(CFLAGSSTRESS) $(LIBS) -c stress.c | ||
| 185 | +$(BUILDDIR)/sse4.o: sse4.c tests.h $(BUILDDIR_IND) | ||
| 186 | + $(CC) -o $@ $(CFLAGSSSE4) $(LIBS) -c sse4.c | ||
| 187 | |||
| 188 | -stressmem.o: stressmem.c tests.h | ||
| 189 | - $(CC) $(CFLAGSSTRESS) $(LIBS) -c stressmem.c | ||
| 190 | +$(BUILDDIR)/ssse3.o: ssse3.c tests.h $(BUILDDIR_IND) | ||
| 191 | + $(CC) -o $@ $(CFLAGSSSSE3) $(LIBS) -c ssse3.c | ||
| 192 | |||
| 193 | +$(BUILDDIR)/sse3.o: sse3.c tests.h $(BUILDDIR_IND) | ||
| 194 | + $(CC) -o $@ $(CFLAGSSSE3) $(LIBS) -c sse3.c | ||
| 195 | + | ||
| 196 | +$(BUILDDIR)/stress.o: stress.c tests.h $(BUILDDIR_IND) | ||
| 197 | + $(CC) -o $@ $(CFLAGSSTRESS) $(LIBS) -c stress.c | ||
| 198 | + | ||
| 199 | +$(BUILDDIR)/stressmem.o: stressmem.c tests.h $(BUILDDIR_IND) | ||
| 200 | + $(CC) -o $@ $(CFLAGSSTRESS) $(LIBS) -c stressmem.c | ||
| 201 | |||
| 202 | ARCHIVE= cpuflags-test | ||
| 203 | |||
| 204 | @@ -110,5 +124,7 @@ tar: clean | ||
| 205 | |||
| 206 | clean: | ||
| 207 | rm -f *~ | ||
| 208 | - rm -f *.o | ||
| 209 | - rm -f cpuflags-test | ||
| 210 | + rm -f build-*/*.o | ||
| 211 | + rm -f cpuflags-test-* | ||
| 212 | + rm -f build-*/.created | ||
| 213 | + rmdir build-* || true | ||
| 214 | diff --git a/qemu/tests/cpuflags.py b/qemu/tests/cpuflags.py | ||
| 215 | index 75a03bb..cab4f5a 100644 | ||
| 216 | --- a/qemu/tests/cpuflags.py | ||
| 217 | +++ b/qemu/tests/cpuflags.py | ||
| 218 | @@ -24,8 +24,8 @@ def run(test, params, env): | ||
| 219 | utils_misc.Flag.aliases = utils_misc.kvm_map_flags_aliases | ||
| 220 | qemu_binary = utils_misc.get_qemu_binary(params) | ||
| 221 | |||
| 222 | - cpuflags_src = os.path.join(data_dir.get_deps_dir("cpu_flags"), "src") | ||
| 223 | - cpuflags_def = os.path.join(data_dir.get_deps_dir("cpu_flags"), | ||
| 224 | + cpuflags_src = os.path.join(qemudir, "deps", "cpu_flags", "src") | ||
| 225 | + cpuflags_def = os.path.join(qemudir, "deps", "cpu_flags", | ||
| 226 | "cpu_map.xml") | ||
| 227 | smp = int(params.get("smp", 1)) | ||
| 228 | |||
| 229 | @@ -188,9 +188,12 @@ def run(test, params, env): | ||
| 230 | """ | ||
| 231 | p = ParseCpuFlags() | ||
| 232 | cpus = p.parse_file(cpuflags_def) | ||
| 233 | + flags = None | ||
| 234 | for arch in cpus.values(): | ||
| 235 | if cpumodel in arch.keys(): | ||
| 236 | flags = arch[cpumodel] | ||
| 237 | + if not flags: | ||
| 238 | + raise NameError, "Could not resolve flags for cpumodel '%s'" % cpumodel | ||
| 239 | return set(map(utils_misc.Flag, flags)) | ||
| 240 | |||
| 241 | get_guest_host_cpuflags_BAD = get_guest_host_cpuflags_1350 | ||
| 242 | @@ -253,7 +256,9 @@ def run(test, params, env): | ||
| 243 | output = utils.run(cmd).stdout | ||
| 244 | |||
| 245 | cpu_re = re.compile(r"x86\s+\[?(\w+)\]?") | ||
| 246 | - return cpu_re.findall(output) | ||
| 247 | + cpus = cpu_re.findall(output) | ||
| 248 | + | ||
| 249 | + return [c for c in cpus if not c == 'host'] | ||
| 250 | |||
| 251 | get_cpu_models_BAD = get_cpu_models_1350 | ||
| 252 | |||
| 253 | @@ -432,16 +437,16 @@ def run(test, params, env): | ||
| 254 | Run stress on vm for timeout time. | ||
| 255 | """ | ||
| 256 | ret = False | ||
| 257 | - install_path = "/tmp" | ||
| 258 | - cpuflags.install_cpuflags_util_on_vm(test, vm, install_path) | ||
| 259 | - flags = check_cpuflags_work(vm, install_path, guest_flags) | ||
| 260 | + install_path = params.get("cpuflags_install_path", "/tmp") | ||
| 261 | + cpuflags_cmd = cpuflags.install_cpuflags_util_on_vm(test, vm, install_path) | ||
| 262 | + flags = check_cpuflags_work(vm, cpuflags_cmd, guest_flags) | ||
| 263 | dd_session = vm.wait_for_login() | ||
| 264 | stress_session = vm.wait_for_login() | ||
| 265 | dd_session.sendline("dd if=/dev/[svh]da of=/tmp/stressblock" | ||
| 266 | " bs=10MB count=100 &") | ||
| 267 | try: | ||
| 268 | - stress_session.cmd("%s/cpuflags-test --stress %s%s" % | ||
| 269 | - (os.path.join(install_path, "cpu_flags"), smp, | ||
| 270 | + stress_session.cmd("%s --stress %s%s" % | ||
| 271 | + (cpuflags_cmd, smp, | ||
| 272 | utils_misc.kvm_flags_to_stresstests(flags[0])), | ||
| 273 | timeout=timeout) | ||
| 274 | except aexpect.ShellTimeoutError: | ||
| 275 | @@ -613,10 +618,10 @@ def run(test, params, env): | ||
| 276 | "on guest: %s", str(not_enable_flags)) | ||
| 277 | logging.info("Check main instruction sets.") | ||
| 278 | |||
| 279 | - install_path = "/tmp" | ||
| 280 | - cpuflags.install_cpuflags_util_on_vm(test, self.vm, install_path) | ||
| 281 | + install_path = params.get("cpuflags_install_path", "/tmp") | ||
| 282 | + cpuflags_cmd = cpuflags.install_cpuflags_util_on_vm(test, vm, install_path) | ||
| 283 | |||
| 284 | - Flags = check_cpuflags_work(self.vm, install_path, | ||
| 285 | + Flags = check_cpuflags_work(self.vm, cpuflags_cmd, | ||
| 286 | flags.all_possible_guest_flags) | ||
| 287 | logging.info("Woking CPU flags: %s", str(Flags[0])) | ||
| 288 | logging.info("Not working CPU flags: %s", str(Flags[1])) | ||
| 289 | @@ -814,18 +819,17 @@ def run(test, params, env): | ||
| 290 | |||
| 291 | (self.vm, _) = start_guest_with_cpuflags(cpuf_model, smp) | ||
| 292 | |||
| 293 | - install_path = "/tmp" | ||
| 294 | - cpuflags.install_cpuflags_util_on_vm(test, self.vm, install_path) | ||
| 295 | - flags = check_cpuflags_work(self.vm, install_path, | ||
| 296 | + install_path = params.get("cpuflags_install_path", "/tmp") | ||
| 297 | + cpuflags_cmd = cpuflags.install_cpuflags_util_on_vm(test, self.vm, install_path) | ||
| 298 | + flags = check_cpuflags_work(self.vm, cpuflags_cmd, | ||
| 299 | flags.guest_flags) | ||
| 300 | dd_session = self.vm.wait_for_login() | ||
| 301 | stress_session = self.vm.wait_for_login() | ||
| 302 | |||
| 303 | dd_session.sendline("nohup dd if=/dev/[svh]da of=/tmp/" | ||
| 304 | "stressblock bs=10MB count=100 &") | ||
| 305 | - cmd = ("nohup %s/cpuflags-test --stress %s%s &" % | ||
| 306 | - (os.path.join(install_path, "cpu_flags"), smp, | ||
| 307 | - utils_misc.kvm_flags_to_stresstests(flags[0]))) | ||
| 308 | + cmd = "nohup %s --stress %s%s &" % (cpuflags_cmd, smp, | ||
| 309 | + utils_misc.kvm_flags_to_stresstests(flags[0])) | ||
| 310 | stress_session.sendline(cmd) | ||
| 311 | |||
| 312 | time.sleep(5) | ||
| 313 | @@ -915,7 +919,7 @@ def run(test, params, env): | ||
| 314 | for fdel in flags.host_unsupported_flags: | ||
| 315 | cpuf_model += ",-" + str(fdel) | ||
| 316 | |||
| 317 | - install_path = "/tmp" | ||
| 318 | + install_path = params.get("cpuflags_install_path", "/tmp") | ||
| 319 | |||
| 320 | class testMultihostMigration(utils_test.qemu.MultihostMigration): | ||
| 321 | |||
| 322 | @@ -931,9 +935,10 @@ def run(test, params, env): | ||
| 323 | vm = env.get_vm("vm1") | ||
| 324 | session = vm.wait_for_login(timeout=self.login_timeout) | ||
| 325 | |||
| 326 | - cpuflags.install_cpuflags_util_on_vm(test, vm, install_path) | ||
| 327 | + cpuflags_cmd = cpuflags.install_cpuflags_util_on_vm(test, vm, install_path) | ||
| 328 | + mig_data.params.update([('cpuflags_cmd', cpuflags_cmd)]) | ||
| 329 | |||
| 330 | - Flags = check_cpuflags_work(vm, install_path, | ||
| 331 | + Flags = check_cpuflags_work(vm, cpuflags_cmd, | ||
| 332 | flags.all_possible_guest_flags) | ||
| 333 | logging.info("Woking CPU flags: %s", str(Flags[0])) | ||
| 334 | logging.info("Not working CPU flags: %s", | ||
| 335 | @@ -946,9 +951,8 @@ def run(test, params, env): | ||
| 336 | session.sendline("nohup dd if=/dev/[svh]da of=/tmp/" | ||
| 337 | "stressblock bs=10MB count=100 &") | ||
| 338 | |||
| 339 | - cmd = ("nohup %s/cpuflags-test --stress %s%s &" % | ||
| 340 | - (os.path.join(install_path, "cpu_flags"), | ||
| 341 | - smp, | ||
| 342 | + cmd = ("nohup %s --stress %s%s &" % | ||
| 343 | + (cpuflags_cmd, smp, | ||
| 344 | utils_misc.kvm_flags_to_stresstests(Flags[0] & | ||
| 345 | flags.guest_flags))) | ||
| 346 | logging.debug("Guest_flags: %s", | ||
| 347 | @@ -971,7 +975,8 @@ def run(test, params, env): | ||
| 348 | " should be active after" | ||
| 349 | " migration and it's not.") | ||
| 350 | |||
| 351 | - Flags = check_cpuflags_work(vm, install_path, | ||
| 352 | + cpuflags_cmd = mig_data.params.get('cpuflags_cmd') | ||
| 353 | + Flags = check_cpuflags_work(vm, cpuflags_cmd, | ||
| 354 | flags.all_possible_guest_flags) | ||
| 355 | logging.info("Woking CPU flags: %s", | ||
| 356 | str(Flags[0])) | ||
| 357 | @@ -1017,7 +1022,7 @@ def run(test, params, env): | ||
| 358 | disable_cpus = map(lambda cpu: int(cpu), | ||
| 359 | params.get("disable_cpus", "").split()) | ||
| 360 | |||
| 361 | - install_path = "/tmp" | ||
| 362 | + install_path = params.get("cpuflags_install_path", "/tmp") | ||
| 363 | |||
| 364 | class testMultihostMigration(utils_test.qemu.MultihostMigration): | ||
| 365 | |||
| 366 | @@ -1060,9 +1065,10 @@ def run(test, params, env): | ||
| 367 | vm = env.get_vm("vm1") | ||
| 368 | session = vm.wait_for_login(timeout=self.login_timeout) | ||
| 369 | |||
| 370 | - cpuflags.install_cpuflags_util_on_vm(test, vm, install_path) | ||
| 371 | + cpuflags_cmd = cpuflags.install_cpuflags_util_on_vm(test, vm, install_path) | ||
| 372 | + mig_data.params.update([('cpuflags_cmd', cpuflags_cmd)]) | ||
| 373 | |||
| 374 | - Flags = check_cpuflags_work(vm, install_path, | ||
| 375 | + Flags = check_cpuflags_work(vm, cpuflags_cmd, | ||
| 376 | flags.all_possible_guest_flags) | ||
| 377 | logging.info("Woking CPU flags: %s", str(Flags[0])) | ||
| 378 | logging.info("Not working CPU flags: %s", | ||
| 379 | @@ -1103,7 +1109,8 @@ def run(test, params, env): | ||
| 380 | "disabled on dsthost:%s" % | ||
| 381 | (disable_cpus, not_disabled)) | ||
| 382 | |||
| 383 | - Flags = check_cpuflags_work(vm, install_path, | ||
| 384 | + cpuflags_cmd = mig_data.params.get('cpuflags_cmd') | ||
| 385 | + Flags = check_cpuflags_work(vm, cpuflags_cmd, | ||
| 386 | flags.all_possible_guest_flags) | ||
| 387 | logging.info("Woking CPU flags: %s", | ||
| 388 | str(Flags[0])) | ||
| 389 | diff --git a/qemu/tests/migration_multi_host_cancel.py b/qemu/tests/migration_multi_host_cancel.py | ||
| 390 | index 89765dd..a4ed11b 100644 | ||
| 391 | --- a/qemu/tests/migration_multi_host_cancel.py | ||
| 392 | +++ b/qemu/tests/migration_multi_host_cancel.py | ||
| 393 | @@ -64,13 +64,12 @@ def run(test, params, env): | ||
| 394 | vm = mig_data.vms[0] | ||
| 395 | session = vm.wait_for_login(timeout=self.login_timeout) | ||
| 396 | |||
| 397 | - cpuflags.install_cpuflags_util_on_vm(test, vm, | ||
| 398 | + cpuflags_cmd = cpuflags.install_cpuflags_util_on_vm(test, vm, | ||
| 399 | self.install_path, | ||
| 400 | extra_flags="-msse3 -msse2") | ||
| 401 | |||
| 402 | - cmd = ("%s/cpuflags-test --stressmem %d,%d %%" % | ||
| 403 | - (os.path.join(self.install_path, "cpu_flags"), | ||
| 404 | - self.vm_mem * 10, self.vm_mem / 2)) | ||
| 405 | + cmd = ("%s --stressmem %d,%d %%" % | ||
| 406 | + (cpuflags_cmd, self.vm_mem * 10, self.vm_mem / 2)) | ||
| 407 | logging.debug("Sending command: %s" % (cmd)) | ||
| 408 | session.sendline(cmd) | ||
| 409 | |||
| 410 | diff --git a/qemu/tests/migration_multi_host_downtime_and_speed.py b/qemu/tests/migration_multi_host_downtime_and_speed.py | ||
| 411 | index 4a06b69..549d1fd 100644 | ||
| 412 | --- a/qemu/tests/migration_multi_host_downtime_and_speed.py | ||
| 413 | +++ b/qemu/tests/migration_multi_host_downtime_and_speed.py | ||
| 414 | @@ -164,13 +164,12 @@ def run(test, params, env): | ||
| 415 | vm = mig_data.vms[0] | ||
| 416 | session = vm.wait_for_login(timeout=self.login_timeout) | ||
| 417 | |||
| 418 | - cpuflags.install_cpuflags_util_on_vm(test, vm, | ||
| 419 | + cpuflags_cmd = cpuflags.install_cpuflags_util_on_vm(test, vm, | ||
| 420 | self.install_path, | ||
| 421 | extra_flags="-msse3 -msse2") | ||
| 422 | |||
| 423 | - cmd = ("nohup %s/cpuflags-test --stressmem %d,%d &" % | ||
| 424 | - (os.path.join(self.install_path, "cpu_flags"), | ||
| 425 | - self.vm_mem * 100, self.vm_mem / 2)) | ||
| 426 | + cmd = ("nohup %s --stressmem %d,%d &" % | ||
| 427 | + (cpuflags_cmd, self.vm_mem * 100, self.vm_mem / 2)) | ||
| 428 | logging.debug("Sending command: %s" % (cmd)) | ||
| 429 | session.sendline(cmd) | ||
| 430 | time.sleep(3) | ||
| 431 | diff --git a/qemu/tests/migration_multi_host_firewall_block.py b/qemu/tests/migration_multi_host_firewall_block.py | ||
| 432 | index 3db1dc5..dc70a6b 100644 | ||
| 433 | --- a/qemu/tests/migration_multi_host_firewall_block.py | ||
| 434 | +++ b/qemu/tests/migration_multi_host_firewall_block.py | ||
| 435 | @@ -175,13 +175,12 @@ def run(test, params, env): | ||
| 436 | vm = mig_data.vms[0] | ||
| 437 | session = vm.wait_for_login(timeout=self.login_timeout) | ||
| 438 | |||
| 439 | - cpuflags.install_cpuflags_util_on_vm(test, vm, | ||
| 440 | + cpuflags_cmd = cpuflags.install_cpuflags_util_on_vm(test, vm, | ||
| 441 | self.install_path, | ||
| 442 | extra_flags="-msse3 -msse2") | ||
| 443 | |||
| 444 | - cmd = ("nohup %s/cpuflags-test --stressmem %d,%d &" % | ||
| 445 | - (os.path.join(self.install_path, "cpu_flags"), | ||
| 446 | - self.vm_mem * 100, self.vm_mem / 2)) | ||
| 447 | + cmd = ("nohup %s --stressmem %d,%d &" % | ||
| 448 | + (cpuflags_cmd, self.vm_mem * 100, self.vm_mem / 2)) | ||
| 449 | logging.debug("Sending command: %s" % (cmd)) | ||
| 450 | session.sendline(cmd) | ||
| 451 | time.sleep(3) | ||
| 452 | diff --git a/qemu/tests/migration_multi_host_ping_pong.py b/qemu/tests/migration_multi_host_ping_pong.py | ||
| 453 | index 7f7b64e..c6d0d3c 100644 | ||
| 454 | --- a/qemu/tests/migration_multi_host_ping_pong.py | ||
| 455 | +++ b/qemu/tests/migration_multi_host_ping_pong.py | ||
| 456 | @@ -155,15 +155,14 @@ def run(test, params, env): | ||
| 457 | vm = mig_data.vms[0] | ||
| 458 | session = vm.wait_for_login(timeout=self.login_timeout) | ||
| 459 | |||
| 460 | - cpuflags.install_cpuflags_util_on_vm(test, vm, | ||
| 461 | + cpuflags_cmd = cpuflags.install_cpuflags_util_on_vm(test, vm, | ||
| 462 | self.install_path, | ||
| 463 | extra_flags="-msse3 -msse2") | ||
| 464 | |||
| 465 | cmd = ("nohup %s/cpuflags-test --stressmem %d,32" | ||
| 466 | " > %s &" % | ||
| 467 | - (os.path.join(self.install_path, "cpu_flags"), | ||
| 468 | - self.stress_memory, | ||
| 469 | - self.cpuflags_test_out)) | ||
| 470 | + (cpuflags_cmd, self.stress_memory, | ||
| 471 | + self.cpuflags_test_out)) | ||
| 472 | logging.debug("Sending command: %s" % (cmd)) | ||
| 473 | session.sendline(cmd) | ||
| 474 | if session.cmd_status("killall -s 0 cpuflags-test") != 0: | ||
| 475 | diff --git a/qemu/tests/migration_multi_host_with_speed_measurement.py b/qemu/tests/migration_multi_host_with_speed_measurement.py | ||
| 476 | index e845b90..dbddbf4 100644 | ||
| 477 | --- a/qemu/tests/migration_multi_host_with_speed_measurement.py | ||
| 478 | +++ b/qemu/tests/migration_multi_host_with_speed_measurement.py | ||
| 479 | @@ -128,12 +128,11 @@ def run(test, params, env): | ||
| 480 | vm = mig_data.vms[0] | ||
| 481 | session = vm.wait_for_login(timeout=self.login_timeout) | ||
| 482 | |||
| 483 | - cpuflags.install_cpuflags_util_on_vm(test, vm, install_path, | ||
| 484 | + cpuflags_cmd = cpuflags.install_cpuflags_util_on_vm(test, vm, install_path, | ||
| 485 | extra_flags="-msse3 -msse2") | ||
| 486 | |||
| 487 | - cmd = ("%s/cpuflags-test --stressmem %d,%d" % | ||
| 488 | - (os.path.join(install_path, "cpu_flags"), | ||
| 489 | - vm_mem * 4, vm_mem / 2)) | ||
| 490 | + cmd = ("%s --stressmem %d,%d" % | ||
| 491 | + (cpuflags_cmd, vm_mem * 4, vm_mem / 2)) | ||
| 492 | logging.debug("Sending command: %s" % (cmd)) | ||
| 493 | session.sendline(cmd) | ||
| 494 | |||
| 495 | diff --git a/qemu/tests/migration_with_speed_measurement.py b/qemu/tests/migration_with_speed_measurement.py | ||
| 496 | index 47c4231..a88d648 100644 | ||
| 497 | --- a/qemu/tests/migration_with_speed_measurement.py | ||
| 498 | +++ b/qemu/tests/migration_with_speed_measurement.py | ||
| 499 | @@ -82,14 +82,13 @@ def run(test, params, env): | ||
| 500 | |||
| 501 | try: | ||
| 502 | # Reboot the VM in the background | ||
| 503 | - cpuflags.install_cpuflags_util_on_vm(test, vm, install_path, | ||
| 504 | + cpuflags_cmd = cpuflags.install_cpuflags_util_on_vm(test, vm, install_path, | ||
| 505 | extra_flags="-msse3 -msse2") | ||
| 506 | |||
| 507 | vm.monitor.migrate_set_speed(mig_speed) | ||
| 508 | |||
| 509 | - cmd = ("%s/cpuflags-test --stressmem %d,%d" % | ||
| 510 | - (os.path.join(install_path, "cpu_flags"), | ||
| 511 | - vm_mem * 4, vm_mem / 2)) | ||
| 512 | + cmd = ("%s --stressmem %d,%d" % | ||
| 513 | + (cpuflags_cmd, vm_mem * 4, vm_mem / 2)) | ||
| 514 | logging.debug("Sending command: %s" % (cmd)) | ||
| 515 | session.sendline(cmd) | ||
| 516 | |||
diff --git a/recipes-test/virt-test/files/qemu-tests-cpuflags-conf.patch b/recipes-test/virt-test/files/qemu-tests-cpuflags-conf.patch new file mode 100644 index 0000000..3bc2f27 --- /dev/null +++ b/recipes-test/virt-test/files/qemu-tests-cpuflags-conf.patch | |||
| @@ -0,0 +1,41 @@ | |||
| 1 | commit e56958858553975f7d5fc13441fc0d0a2a94bbc7 | ||
| 2 | Author: Jonas Eriksson <jonas.eriksson@enea.com> | ||
| 3 | Date: Wed Mar 26 17:41:15 2014 +0100 | ||
| 4 | |||
| 5 | cpuflags test: Add tool path configuration | ||
| 6 | |||
| 7 | Signed-off-by: Jonas Eriksson <jonas.eriksson@enea.com> | ||
| 8 | Upstream-Status: Inappropriate [configuration] | ||
| 9 | |||
| 10 | diff --git a/qemu/tests/cfg/cpuflags.cfg b/qemu/tests/cfg/cpuflags.cfg | ||
| 11 | index 7d99a4c..15d805f 100644 | ||
| 12 | --- a/qemu/tests/cfg/cpuflags.cfg | ||
| 13 | +++ b/qemu/tests/cfg/cpuflags.cfg | ||
| 14 | @@ -1,5 +1,4 @@ | ||
| 15 | - cpuflags: install setup image_copy unattended_install.cdrom | ||
| 16 | - no JeOS | ||
| 17 | type = cpuflags | ||
| 18 | extra_params += " -snapshot" | ||
| 19 | auto_cpu_model = no | ||
| 20 | @@ -20,6 +19,8 @@ | ||
| 21 | cpu_model_blacklist += " pentium3 coreduo n270" | ||
| 22 | guest_spec_flags = "fxsr_opt hypervisor ds pdpe1gb osxsave svm tsc-deadline" | ||
| 23 | host_spec_flags = "pbe tm ds_cpl monitor acpi dtes64 ht tm2 xtpr est pdcm smx" | ||
| 24 | + | ||
| 25 | + cpuflags_install_path = "/opt/virt-test/test-providers.d/downloads/io-github-autotest-qemu/qemu/deps/cpu_flags/src" | ||
| 26 | variants: | ||
| 27 | - interface: | ||
| 28 | variants: | ||
| 29 | diff --git a/qemu/tests/cfg/multi_host.cfg b/qemu/tests/cfg/multi_host.cfg | ||
| 30 | index 549b102..96eee60 100644 | ||
| 31 | --- a/qemu/tests/cfg/multi_host.cfg | ||
| 32 | +++ b/qemu/tests/cfg/multi_host.cfg | ||
| 33 | @@ -7,7 +7,7 @@ | ||
| 34 | remove_image_on_check_error = yes | ||
| 35 | force_image_clone = no | ||
| 36 | virt_test_type = qemu | ||
| 37 | - no JeOS | ||
| 38 | + cpuflags_install_path = "/opt/virt-test/test-providers.d/downloads/io-github-autotest-qemu/qemu/deps/cpu_flags/src" | ||
| 39 | variants multi_host_tests: | ||
| 40 | - migrate_multi_host: install setup image_copy unattended_install.cdrom | ||
| 41 | type = migration_multi_host | ||
diff --git a/recipes-test/virt-test/files/qemu-tests-cpuflags-migrate-to-provider.patch b/recipes-test/virt-test/files/qemu-tests-cpuflags-migrate-to-provider.patch new file mode 100644 index 0000000..1b948f6 --- /dev/null +++ b/recipes-test/virt-test/files/qemu-tests-cpuflags-migrate-to-provider.patch | |||
| @@ -0,0 +1,91 @@ | |||
| 1 | commit a1aa54ba8adbf2e12043b7d91161ee6302e7584c | ||
| 2 | Author: Jonas Eriksson <jonas.eriksson@enea.com> | ||
| 3 | Date: Wed Mar 26 14:08:54 2014 +0100 | ||
| 4 | |||
| 5 | cpuflags: Migrate cpuflags test case to provider | ||
| 6 | |||
| 7 | The provider module has a install_cpuflags_util_on_vm function that does | ||
| 8 | the very same thing as the internal implementation: Use that instead. | ||
| 9 | |||
| 10 | Signed-off-by: Jonas Eriksson <jonas.eriksson@enea.com> | ||
| 11 | Upstream-Status: Pending | ||
| 12 | |||
| 13 | diff --git a/qemu/tests/cpuflags.py b/qemu/tests/cpuflags.py | ||
| 14 | index 7b2dca6..eecbf16 100644 | ||
| 15 | --- a/qemu/tests/cpuflags.py | ||
| 16 | +++ b/qemu/tests/cpuflags.py | ||
| 17 | @@ -11,6 +11,7 @@ from autotest.client.shared import error, utils | ||
| 18 | from virttest import qemu_vm, virt_vm | ||
| 19 | from virttest import utils_misc, utils_test, aexpect | ||
| 20 | from autotest.client.shared.syncdata import SyncData | ||
| 21 | +from provider import cpuflags | ||
| 22 | |||
| 23 | |||
| 24 | def run(test, params, env): | ||
| 25 | @@ -385,21 +386,6 @@ def run(test, params, env): | ||
| 26 | |||
| 27 | return set(online) - set(disabled_cpu) | ||
| 28 | |||
| 29 | - def install_cpuflags_test_on_vm(vm, dst_dir): | ||
| 30 | - """ | ||
| 31 | - Install stress to vm. | ||
| 32 | - | ||
| 33 | - :param vm: virtual machine. | ||
| 34 | - :param dst_dir: Installation path. | ||
| 35 | - """ | ||
| 36 | - session = vm.wait_for_login() | ||
| 37 | - vm.copy_files_to(cpuflags_src, dst_dir) | ||
| 38 | - session.cmd("sync") | ||
| 39 | - session.cmd("cd %s; make EXTRA_FLAGS='';" % | ||
| 40 | - os.path.join(dst_dir, "cpu_flags")) | ||
| 41 | - session.cmd("sync") | ||
| 42 | - session.close() | ||
| 43 | - | ||
| 44 | def check_cpuflags_work(vm, path, flags): | ||
| 45 | """ | ||
| 46 | Check which flags work. | ||
| 47 | @@ -433,7 +419,7 @@ def run(test, params, env): | ||
| 48 | """ | ||
| 49 | ret = False | ||
| 50 | install_path = "/tmp" | ||
| 51 | - install_cpuflags_test_on_vm(vm, install_path) | ||
| 52 | + cpuflags.install_cpuflags_util_on_vm(test, vm, install_path) | ||
| 53 | flags = check_cpuflags_work(vm, install_path, guest_flags) | ||
| 54 | dd_session = vm.wait_for_login() | ||
| 55 | stress_session = vm.wait_for_login() | ||
| 56 | @@ -614,7 +600,7 @@ def run(test, params, env): | ||
| 57 | logging.info("Check main instruction sets.") | ||
| 58 | |||
| 59 | install_path = "/tmp" | ||
| 60 | - install_cpuflags_test_on_vm(self.vm, install_path) | ||
| 61 | + cpuflags.install_cpuflags_util_on_vm(test, self.vm, install_path) | ||
| 62 | |||
| 63 | Flags = check_cpuflags_work(self.vm, install_path, | ||
| 64 | flags.all_possible_guest_flags) | ||
| 65 | @@ -815,7 +801,7 @@ def run(test, params, env): | ||
| 66 | (self.vm, _) = start_guest_with_cpuflags(cpuf_model, smp) | ||
| 67 | |||
| 68 | install_path = "/tmp" | ||
| 69 | - install_cpuflags_test_on_vm(self.vm, install_path) | ||
| 70 | + cpuflags.install_cpuflags_util_on_vm(test, self.vm, install_path) | ||
| 71 | flags = check_cpuflags_work(self.vm, install_path, | ||
| 72 | flags.guest_flags) | ||
| 73 | dd_session = self.vm.wait_for_login() | ||
| 74 | @@ -931,7 +917,7 @@ def run(test, params, env): | ||
| 75 | vm = env.get_vm("vm1") | ||
| 76 | session = vm.wait_for_login(timeout=self.login_timeout) | ||
| 77 | |||
| 78 | - install_cpuflags_test_on_vm(vm, install_path) | ||
| 79 | + cpuflags.install_cpuflags_util_on_vm(test, vm, install_path) | ||
| 80 | |||
| 81 | Flags = check_cpuflags_work(vm, install_path, | ||
| 82 | flags.all_possible_guest_flags) | ||
| 83 | @@ -1060,7 +1046,7 @@ def run(test, params, env): | ||
| 84 | vm = env.get_vm("vm1") | ||
| 85 | session = vm.wait_for_login(timeout=self.login_timeout) | ||
| 86 | |||
| 87 | - install_cpuflags_test_on_vm(vm, install_path) | ||
| 88 | + cpuflags.install_cpuflags_util_on_vm(test, vm, install_path) | ||
| 89 | |||
| 90 | Flags = check_cpuflags_work(vm, install_path, | ||
| 91 | flags.all_possible_guest_flags) | ||
diff --git a/recipes-test/virt-test/files/qemu-tests-cyclictest.patch b/recipes-test/virt-test/files/qemu-tests-cyclictest.patch new file mode 100644 index 0000000..f9ee831 --- /dev/null +++ b/recipes-test/virt-test/files/qemu-tests-cyclictest.patch | |||
| @@ -0,0 +1,217 @@ | |||
| 1 | commit 61c087a0386ad04fd5579ad170b9d7933ed90c8c | ||
| 2 | Author: Jonas Eriksson <jonas.eriksson@enea.com> | ||
| 3 | Date: Fri Apr 25 16:00:12 2014 +0200 | ||
| 4 | |||
| 5 | Add cyclictest test case | ||
| 6 | |||
| 7 | Cyclictest is a part of rt-tests used to test the responsiveness of a | ||
| 8 | system. While not developed for non-realtime systems, it can be used to | ||
| 9 | detect unexpected spikes in latencies within virtual machines. | ||
| 10 | |||
| 11 | Signed-off-by: Jonas Eriksson <jonas.eriksson@enea.com> | ||
| 12 | Upstream-Status: Pending | ||
| 13 | |||
| 14 | diff --git a/qemu/tests/cfg/cyclictest.cfg b/qemu/tests/cfg/cyclictest.cfg | ||
| 15 | new file mode 100644 | ||
| 16 | index 0000000..d142b7d | ||
| 17 | --- /dev/null | ||
| 18 | +++ b/qemu/tests/cfg/cyclictest.cfg | ||
| 19 | @@ -0,0 +1,25 @@ | ||
| 20 | +- cyclictest: | ||
| 21 | + virt_test_type = qemu | ||
| 22 | + only Linux | ||
| 23 | + type = cyclictest | ||
| 24 | + kill_vm = yes | ||
| 25 | + kill_vm_gracefully = no | ||
| 26 | + backup_image_before_testing = yes | ||
| 27 | + | ||
| 28 | + # It is possible to tune the arguments to cyclictest using the | ||
| 29 | + # cyclictest_args variable. | ||
| 30 | + #cyclictest_args = "-D 30m --smp" | ||
| 31 | + # It is formatted using a dictionary where a number of properties of the | ||
| 32 | + # target is available, for example 'num_cpus' which is the number of cpus, | ||
| 33 | + # and 'mask_all_cpus', which is the string "0-[num_cpus - 1]". See | ||
| 34 | + # cyclictest.py for all available values. The following is for example | ||
| 35 | + # equivalent to "-D 30m --smp": | ||
| 36 | + #cyclictest_args = "-D 30m -t %(num_cpus)s -a %(mask_all_cpus)s" | ||
| 37 | + # Default timeout is 35 min | ||
| 38 | + #cyclictest_timeout_s = 2100 | ||
| 39 | + | ||
| 40 | + # After the run, the test case will check all values against the below | ||
| 41 | + # allowed maximum values of each result. | ||
| 42 | + #allowed_max = 50 | ||
| 43 | + #allowed_avg = 30 | ||
| 44 | + #allowed_act = | ||
| 45 | diff --git a/qemu/tests/cyclictest.py b/qemu/tests/cyclictest.py | ||
| 46 | new file mode 100644 | ||
| 47 | index 0000000..0ad447f | ||
| 48 | --- /dev/null | ||
| 49 | +++ b/qemu/tests/cyclictest.py | ||
| 50 | @@ -0,0 +1,167 @@ | ||
| 51 | +import logging | ||
| 52 | +import re | ||
| 53 | +from autotest.client import utils | ||
| 54 | +from autotest.client.shared import error | ||
| 55 | +from virttest import remote, utils_misc, utils_test | ||
| 56 | + | ||
| 57 | + | ||
| 58 | +# Information about cyclictest is available here: | ||
| 59 | +# https://rt.wiki.kernel.org/index.php/Cyclictest | ||
| 60 | +@error.context_aware | ||
| 61 | +def run(test, params, env): | ||
| 62 | + """ | ||
| 63 | + Test Steps: | ||
| 64 | + | ||
| 65 | + 1. Check availability of cyclictest | ||
| 66 | + 2. Get information about the target | ||
| 67 | + 3. Run cyclictest | ||
| 68 | + 4. Parse and check result | ||
| 69 | + | ||
| 70 | + Params: | ||
| 71 | + :param test: QEMU test object. | ||
| 72 | + :param params: Dictionary with the test parameters. | ||
| 73 | + :param env: Dictionary with test environment. | ||
| 74 | + """ | ||
| 75 | + | ||
| 76 | + def parse_cyclictest(output_string): | ||
| 77 | + """ | ||
| 78 | + Parses the output from a cyclictest run into a nested dictionary. | ||
| 79 | + | ||
| 80 | + Example input: | ||
| 81 | + # /dev/cpu_dma_latency set to 0us | ||
| 82 | + T: 0 ( 7064) P: 0 I:1000 C: 2000 Min: 1 Act: 2 Avg: 3 Max: 751 | ||
| 83 | + T: 1 ( 7065) P: 0 I:1500 C: 1334 Min: 1 Act: 3 Avg: 2 Max: 167 | ||
| 84 | + Example output: | ||
| 85 | + { '0': { 'Act': '2', | ||
| 86 | + 'Avg': '3', | ||
| 87 | + 'C': '2000', | ||
| 88 | + 'I': '1000', | ||
| 89 | + 'Max': '751', | ||
| 90 | + 'Min': '1', | ||
| 91 | + 'P': '0', | ||
| 92 | + 'T': '0 ( 7064)'}, | ||
| 93 | + '1': { 'Act': '3', | ||
| 94 | + 'Avg': '2', | ||
| 95 | + 'C': '1334', | ||
| 96 | + 'I': '1500', | ||
| 97 | + 'Max': '167', | ||
| 98 | + 'Min': '1', | ||
| 99 | + 'P': '0', | ||
| 100 | + 'T': '1 ( 7065)'} | ||
| 101 | + } | ||
| 102 | + | ||
| 103 | + Params: | ||
| 104 | + :param output_string: Output data from cyclictest | ||
| 105 | + :returns: Nested dict of parsed output | ||
| 106 | + """ | ||
| 107 | + output = output_string.split("\n") | ||
| 108 | + result = {} | ||
| 109 | + for row_string in output: | ||
| 110 | + # Only process lines beginning with "T:" | ||
| 111 | + if re.match("^T:", row_string): | ||
| 112 | + # Since the different segments of a line are not comma | ||
| 113 | + # separated (or similar), it is tricky to split them right | ||
| 114 | + # away. Instead, match the "header" of an entry (e.g. "P:"), | ||
| 115 | + # and add a line break before them. Then split the string using | ||
| 116 | + # the added line breaks. | ||
| 117 | + row_list = re.sub("\S+:", "\n\g<0>", row_string).split("\n") | ||
| 118 | + sub_result = {} | ||
| 119 | + for part in row_list: | ||
| 120 | + part = re.sub("\s+$", "", part) | ||
| 121 | + if not part == "": | ||
| 122 | + # The strings are now on the form "P: 0" (for example) | ||
| 123 | + kv = re.split(":\s*", part) | ||
| 124 | + sub_result[kv[0]] = kv[1] | ||
| 125 | + # Use the thread as an index in the outer result dict. Avoid | ||
| 126 | + # using an array to be able to process results in any order and | ||
| 127 | + # with gaps. | ||
| 128 | + thread = (sub_result['T'].split(" "))[0] | ||
| 129 | + result[thread] = sub_result | ||
| 130 | + return result | ||
| 131 | + | ||
| 132 | + def check_val_ceiling(allowed_ceil, val, name, cpu): | ||
| 133 | + """ | ||
| 134 | + Check that the value :val: is not larger than :allowed_ceil:, and if so | ||
| 135 | + log the error using :name: as the name of the value. | ||
| 136 | + | ||
| 137 | + Params: | ||
| 138 | + :allowed_ceil: Maximum allowed vaule of :val:. If None, "" or 0, | ||
| 139 | + just return 0. | ||
| 140 | + :val: The value to be tested | ||
| 141 | + :name: The name of the value, for logging | ||
| 142 | + :cpu: CPU number for error reporting | ||
| 143 | + :returns: Number of errors; 0 if successful. | ||
| 144 | + """ | ||
| 145 | + if allowed_ceil > 0 and val > allowed_ceil: | ||
| 146 | + logging.error("%s value too large: %d for CPU %d" % (name, | ||
| 147 | + val, | ||
| 148 | + cpu)) | ||
| 149 | + return 1 | ||
| 150 | + return 0 | ||
| 151 | + | ||
| 152 | + # Get/setup VM and session | ||
| 153 | + vm_name = params.get("vm_name", "main_vm") | ||
| 154 | + vm = env.get_vm(params[vm_name]) | ||
| 155 | + vm.verify_alive() | ||
| 156 | + timeout = int(params.get("timeout", 2400)) | ||
| 157 | + session = vm.wait_for_login(timeout=timeout) | ||
| 158 | + | ||
| 159 | + try: | ||
| 160 | + error.context("Check availability of cyclictest") | ||
| 161 | + if session.cmd_status("which cyclictest"): | ||
| 162 | + raise error.TestFail("Test application not available") | ||
| 163 | + | ||
| 164 | + error.context("Get information about the target") | ||
| 165 | + # Get the number of CPUs on target | ||
| 166 | + cmd = "grep -c '^processor[[:space:]]*:' /proc/cpuinfo" | ||
| 167 | + output = session.cmd_output(cmd) | ||
| 168 | + num_cpus = int(output) | ||
| 169 | + if num_cpus == 0: | ||
| 170 | + raise error.TestFail("Unable to get number of CPUs on target") | ||
| 171 | + | ||
| 172 | + # Get arguments from the configuration | ||
| 173 | + default_args = "-D 30m --smp" | ||
| 174 | + cyclictest_args = params.get("cyclictest_args", default_args) | ||
| 175 | + fmt_dict = { | ||
| 176 | + 'num_cpus': num_cpus, | ||
| 177 | + 'last_cpu': num_cpus - 1, | ||
| 178 | + 'mask_all_cpus': "0-%d" % (num_cpus - 1), | ||
| 179 | + } | ||
| 180 | + formatted_args = cyclictest_args % fmt_dict | ||
| 181 | + | ||
| 182 | + error.context("Run cyclictest") | ||
| 183 | + timeout_s = params.get("cyclictest_timeout_s", 60*35) | ||
| 184 | + cmd = "cyclictest -q %s" % formatted_args | ||
| 185 | + status, ct_output = session.cmd_status_output(cmd, | ||
| 186 | + timeout=timeout_s) | ||
| 187 | + if status: | ||
| 188 | + logging.error("Cyclic test output: %s" % ct_output) | ||
| 189 | + raise error.TestFail("Cyclictest returned %d" % status) | ||
| 190 | + | ||
| 191 | + error.context("Parse and check result") | ||
| 192 | + results = parse_cyclictest(ct_output) | ||
| 193 | + if not results: | ||
| 194 | + logging.error("Cyclic test output: %s" % ct_output) | ||
| 195 | + raise error.TestFail("Parsing of cyclictest output failed") | ||
| 196 | + | ||
| 197 | + # Get check values. By default, don't check Act. | ||
| 198 | + allowed_max = int(params.get("allowed_max", 50)) | ||
| 199 | + allowed_avg = int(params.get("allowed_avg", 30)) | ||
| 200 | + allowed_act = int(params.get("allowed_act", 0)) | ||
| 201 | + | ||
| 202 | + fails = 0 | ||
| 203 | + for key, result in results.iteritems(): | ||
| 204 | + cpu = int(key) | ||
| 205 | + max_val = int(result['Max']) | ||
| 206 | + avg_val = int(result['Avg']) | ||
| 207 | + act_val = int(result['Act']) | ||
| 208 | + fails += check_val_ceiling(allowed_max, max_val, "Max", cpu) | ||
| 209 | + fails += check_val_ceiling(allowed_avg, avg_val, "Avg", cpu) | ||
| 210 | + fails += check_val_ceiling(allowed_act, act_val, "Act", cpu) | ||
| 211 | + | ||
| 212 | + if fails > 0: | ||
| 213 | + logging.error("Cyclic test output: %s" % ct_output) | ||
| 214 | + raise error.TestFail("Values out of bounds, see log") | ||
| 215 | + | ||
| 216 | + finally: | ||
| 217 | + session.close() | ||
diff --git a/recipes-test/virt-test/files/qemu-tests-multi-nic-stress.patch b/recipes-test/virt-test/files/qemu-tests-multi-nic-stress.patch new file mode 100644 index 0000000..9c916f5 --- /dev/null +++ b/recipes-test/virt-test/files/qemu-tests-multi-nic-stress.patch | |||
| @@ -0,0 +1,102 @@ | |||
| 1 | commit df8666dfa327670b680ff05d5c43fff715c62ff9 | ||
| 2 | Author: Jonas Eriksson <jonas.eriksson@enea.com> | ||
| 3 | Date: Tue Mar 18 16:11:50 2014 +0100 | ||
| 4 | |||
| 5 | multi_nic_stress: Check if netperf is installed | ||
| 6 | |||
| 7 | To avoid an unnecessary download and build of netperf, check if the | ||
| 8 | application is present before building. | ||
| 9 | |||
| 10 | Signed-off-by: Jonas Eriksson <jonas.eriksson@enea.com> | ||
| 11 | Upstream-Status: Pending | ||
| 12 | |||
| 13 | diff --git a/qemu/tests/cfg/multi_nic_stress.cfg b/qemu/tests/cfg/multi_nic_stress.cfg | ||
| 14 | index 2ec6cb6..36a073e 100644 | ||
| 15 | --- a/qemu/tests/cfg/multi_nic_stress.cfg | ||
| 16 | +++ b/qemu/tests/cfg/multi_nic_stress.cfg | ||
| 17 | @@ -15,6 +15,9 @@ | ||
| 18 | pkg_md5sum = 9654ffdfd4c4f2c93ce3733cd9ed9236 | ||
| 19 | remote_dir = /var/tmp | ||
| 20 | setup_cmd = "cd ${remote_dir} && rm -rf netperf-2.6.0 && tar xvfj netperf-2.6.0.tar.bz2 && cd netperf-2.6.0 && ./configure --enable-burst --enable-demo=yes && make" | ||
| 21 | + app_check_cmd = "netperf -V" | ||
| 22 | + client_cmd = netperf | ||
| 23 | + server_cmd = netserver | ||
| 24 | l = 30 | ||
| 25 | protocols = "TCP_STREAM TCP_MAERTS TCP_RR TCP_CRR" | ||
| 26 | sessions = "1" | ||
| 27 | diff --git a/qemu/tests/multi_nic_stress.py b/qemu/tests/multi_nic_stress.py | ||
| 28 | index 698bc99..aaf6d21 100644 | ||
| 29 | --- a/qemu/tests/multi_nic_stress.py | ||
| 30 | +++ b/qemu/tests/multi_nic_stress.py | ||
| 31 | @@ -41,20 +41,24 @@ def run(test, params, env): | ||
| 32 | """ | ||
| 33 | error.context("Setup env for %s" % ip_addr) | ||
| 34 | ssh_cmd(session, "service iptables stop; true") | ||
| 35 | - netperf_links = params["netperf_links"].split() | ||
| 36 | - remote_dir = params.get("remote_dir", "/var/tmp") | ||
| 37 | - for netperf_link in netperf_links: | ||
| 38 | - if utils.is_url(netperf_link): | ||
| 39 | - download_dir = data_dir.get_download_dir() | ||
| 40 | - md5sum = params.get("pkg_md5sum") | ||
| 41 | - netperf_dir = utils.unmap_url_cache(download_dir, | ||
| 42 | - netperf_link, md5sum) | ||
| 43 | - elif netperf_link: | ||
| 44 | - netperf_dir = os.path.join(data_dir.get_root_dir(), | ||
| 45 | - "shared/%s" % netperf_link) | ||
| 46 | - remote.scp_to_remote(ip_addr, shell_port, username, password, | ||
| 47 | - netperf_dir, remote_dir) | ||
| 48 | - ssh_cmd(session, params.get("setup_cmd")) | ||
| 49 | + app_check_cmd = params.get("app_check_cmd", "") | ||
| 50 | + | ||
| 51 | + # Install netperf in guest if not already available | ||
| 52 | + if not (app_check_cmd and session.cmd_status(app_check_cmd) == 0): | ||
| 53 | + netperf_links = params["netperf_links"].split() | ||
| 54 | + remote_dir = params.get("remote_dir", "/var/tmp") | ||
| 55 | + for netperf_link in netperf_links: | ||
| 56 | + if utils.is_url(netperf_link): | ||
| 57 | + download_dir = data_dir.get_download_dir() | ||
| 58 | + md5sum = params.get("pkg_md5sum") | ||
| 59 | + netperf_dir = utils.unmap_url_cache(download_dir, | ||
| 60 | + netperf_link, md5sum) | ||
| 61 | + elif netperf_link: | ||
| 62 | + netperf_dir = os.path.join(data_dir.get_root_dir(), | ||
| 63 | + "shared/%s" % netperf_link) | ||
| 64 | + remote.scp_to_remote(ip_addr, shell_port, username, password, | ||
| 65 | + netperf_dir, remote_dir) | ||
| 66 | + ssh_cmd(session, params.get("setup_cmd")) | ||
| 67 | |||
| 68 | vm = env.get_vm(params["main_vm"]) | ||
| 69 | vm.verify_alive() | ||
| 70 | @@ -202,8 +206,10 @@ def launch_client(sessions, servers, server_ctl, clients, | ||
| 71 | # Start netserver | ||
| 72 | error.context("Start Netserver on guest", logging.info) | ||
| 73 | remote_dir = params.get("remote_dir", "/var/tmp") | ||
| 74 | - client_path = os.path.join(remote_dir, "netperf-2.6.0/src/netperf") | ||
| 75 | - server_path = os.path.join(remote_dir, "netperf-2.6.0/src/netserver") | ||
| 76 | + client_path_default = os.path.join(remote_dir, "netperf-2.6.0/src/netperf") | ||
| 77 | + client_cmd = params.get("client_cmd", client_path_default) | ||
| 78 | + server_path_default = os.path.join(remote_dir, "netperf-2.6.0/src/netserver") | ||
| 79 | + server_cmd = params.get("server_cmd", server_path_default) | ||
| 80 | |||
| 81 | if params.get("os_type") == "windows": | ||
| 82 | winutils_vol = utils_misc.get_winutils_vol(server_ctl) | ||
| 83 | @@ -219,8 +225,8 @@ def launch_client(sessions, servers, server_ctl, clients, | ||
| 84 | raise error.TestError(msg) | ||
| 85 | |||
| 86 | else: | ||
| 87 | - logging.info("Netserver start cmd is '%s'" % server_path) | ||
| 88 | - ssh_cmd(server_ctl, "pidof netserver || %s" % server_path) | ||
| 89 | + logging.info("Netserver start cmd is '%s'" % server_cmd) | ||
| 90 | + ssh_cmd(server_ctl, "pidof netserver || %s" % server_cmd) | ||
| 91 | logging.info("Netserver start successfully") | ||
| 92 | |||
| 93 | # start netperf | ||
| 94 | @@ -230,7 +236,7 @@ def launch_client(sessions, servers, server_ctl, clients, | ||
| 95 | for client in clients: | ||
| 96 | test_timeout = len(clients) * l | ||
| 97 | server = servers[clients.index(client) % len(servers)] | ||
| 98 | - netperf_cmd = "%s -H %s -l %s %s" % (client_path, server, | ||
| 99 | + netperf_cmd = "%s -H %s -l %s %s" % (client_cmd, server, | ||
| 100 | int(l), nf_args) | ||
| 101 | client_threads.append([ssh_cmd, (client, netperf_cmd, test_timeout)]) | ||
| 102 | |||
diff --git a/recipes-test/virt-test/files/qemu-tests-nx-exploit-config.patch b/recipes-test/virt-test/files/qemu-tests-nx-exploit-config.patch new file mode 100644 index 0000000..92b918a --- /dev/null +++ b/recipes-test/virt-test/files/qemu-tests-nx-exploit-config.patch | |||
| @@ -0,0 +1,21 @@ | |||
| 1 | commit 155bcc2cba379d7eda2b8dbff0e54951bf682ad6 | ||
| 2 | Author: Jonas Eriksson <jonas.eriksson@enea.com> | ||
| 3 | Date: Thu Mar 27 17:10:29 2014 +0100 | ||
| 4 | |||
| 5 | nx exploit test: Add configuration | ||
| 6 | |||
| 7 | Signed-off-by: Jonas Eriksson <jonas.eriksson@enea.com> | ||
| 8 | Upstream-Status: Inappropriate [configuration] | ||
| 9 | |||
| 10 | diff --git a/qemu/tests/cfg/nx.cfg b/qemu/tests/cfg/nx.cfg | ||
| 11 | index 280df32..cbd7803 100644 | ||
| 12 | --- a/qemu/tests/cfg/nx.cfg | ||
| 13 | +++ b/qemu/tests/cfg/nx.cfg | ||
| 14 | @@ -6,6 +6,7 @@ | ||
| 15 | virt_test_type = qemu | ||
| 16 | image_snapshot = yes | ||
| 17 | kill_vm = yes | ||
| 18 | + exploit_cmd = "/opt/virt-test/test-providers.d/downloads/io-github-autotest-qemu/qemu/deps/nx/nx_exploit" | ||
| 19 | variants: | ||
| 20 | - noexec_on: | ||
| 21 | nx_on = yes | ||
diff --git a/recipes-test/virt-test/files/qemu-tests-pipetest-config.patch b/recipes-test/virt-test/files/qemu-tests-pipetest-config.patch new file mode 100644 index 0000000..3f592ce --- /dev/null +++ b/recipes-test/virt-test/files/qemu-tests-pipetest-config.patch | |||
| @@ -0,0 +1,26 @@ | |||
| 1 | commit 6a2f0e98999abb7b4be8a3ea29a5dfd23fffb154 | ||
| 2 | Author: Jonas Eriksson <jonas.eriksson@enea.com> | ||
| 3 | Date: Thu Mar 27 10:14:20 2014 +0100 | ||
| 4 | |||
| 5 | pipetest application: Add configuration | ||
| 6 | |||
| 7 | Signed-off-by: Jonas Eriksson <jonas.eriksson@enea.com> | ||
| 8 | Upstream-Status: Inappropriate [configuration] | ||
| 9 | |||
| 10 | diff --git a/qemu/tests/cfg/ipi_x2apic.cfg b/qemu/tests/cfg/ipi_x2apic.cfg | ||
| 11 | index f65f2c8..22e8dc3 100644 | ||
| 12 | --- a/qemu/tests/cfg/ipi_x2apic.cfg | ||
| 13 | +++ b/qemu/tests/cfg/ipi_x2apic.cfg | ||
| 14 | @@ -1,10 +1,10 @@ | ||
| 15 | - ipi_x2apic: | ||
| 16 | no Host_RHEL.5 | ||
| 17 | - only RHEL.6 | ||
| 18 | + only RHEL.6, JeOS | ||
| 19 | type = ipi_x2apic | ||
| 20 | vms = "" | ||
| 21 | check_x2apic_cmd = dmesg |grep x2apic | ||
| 22 | - pipetest_cmd = "/tmp/pipetest" | ||
| 23 | + pipetest_cmd = "/opt/virt-test/shared/scripts/pipetest" | ||
| 24 | build_pipetest_cmd = "cd /tmp/ && gcc -o pipetest pipetest.c" | ||
| 25 | x2apic_check_string = Enabling x2apic, Enabled x2apic, Setting APIC routing to physical x2apic | ||
| 26 | pre_command += " grep 'flags' /proc/cpuinfo|grep 'ept' && modprobe -r kvm_intel && modprobe kvm_intel ept=1 || echo ok;" | ||
diff --git a/recipes-test/virt-test/files/qemu-tests-stress-config.patch b/recipes-test/virt-test/files/qemu-tests-stress-config.patch new file mode 100644 index 0000000..6a2cd0e --- /dev/null +++ b/recipes-test/virt-test/files/qemu-tests-stress-config.patch | |||
| @@ -0,0 +1,28 @@ | |||
| 1 | commit 270cc35ea5c0379df1502f2a83af992db4d65439 | ||
| 2 | Author: Jonas Eriksson <jonas.eriksson@enea.com> | ||
| 3 | Date: Fri Mar 28 08:46:49 2014 +0100 | ||
| 4 | |||
| 5 | stress: Add configuration | ||
| 6 | |||
| 7 | Signed-off-by: Jonas Eriksson <jonas.eriksson@enea.com> | ||
| 8 | Upstream-Status: Inappropriate [configuration] | ||
| 9 | |||
| 10 | diff --git a/qemu/tests/cfg/softlockup.cfg b/qemu/tests/cfg/softlockup.cfg | ||
| 11 | index 28e4057..1588b6a 100644 | ||
| 12 | --- a/qemu/tests/cfg/softlockup.cfg | ||
| 13 | +++ b/qemu/tests/cfg/softlockup.cfg | ||
| 14 | @@ -1,12 +1,11 @@ | ||
| 15 | - softlockup: install setup unattended_install.cdrom | ||
| 16 | - no JeOS | ||
| 17 | only Linux | ||
| 18 | type = softlockup | ||
| 19 | stress_source = stress-1.0.4.tar.gz | ||
| 20 | - stress_setup_cmd = "cd %s && tar xvf stress-1.0.4.tar.gz && cd stress-1.0.4 && ./configure && make && cd src" | ||
| 21 | + monitor_dir = "/opt/virt-test/test-providers.d/downloads/io-github-autotest-qemu/qemu/deps/softlockup/" | ||
| 22 | server_setup_cmd = "%s/heartbeat_slu.py --server --threshold %s --file %s --port %s --verbose --check-drift" | ||
| 23 | client_setup_cmd = "%s/heartbeat_slu.py --client --address %s --file %s --port %s --interval 1" | ||
| 24 | - stress_cmd = "cd %s && cd stress-1.0.4 && cd src && nohup ./stress -c %s > /dev/null 2>&1&" | ||
| 25 | + stress_cmd = "sh -ec 'export dir=%s/stress-run; mkdir -p $dir; cd $dir' && nohup stress -c %s > /dev/null 2>&1 &" | ||
| 26 | kill_monitor_cmd = "ps aux | grep heart | grep -v grep | awk '{print$2}' | xargs kill -9 > /dev/null 2>&1" | ||
| 27 | kill_stress_cmd = "pkill -f stress > /dev/null 2>&1" | ||
| 28 | drift_cmd = "tail -1 %s | awk '{print $7}'" | ||
diff --git a/recipes-test/virt-test/files/qemu-tests-time-drift-config.patch b/recipes-test/virt-test/files/qemu-tests-time-drift-config.patch new file mode 100644 index 0000000..16bec8d --- /dev/null +++ b/recipes-test/virt-test/files/qemu-tests-time-drift-config.patch | |||
| @@ -0,0 +1,37 @@ | |||
| 1 | commit 7ce64e2e13a302e3675718aef6238dd649dba5b3 | ||
| 2 | Author: Jonas Eriksson <jonas.eriksson@enea.com> | ||
| 3 | Date: Thu Mar 27 10:08:44 2014 +0100 | ||
| 4 | |||
| 5 | time drift test: Add configuration | ||
| 6 | |||
| 7 | Signed-off-by: Jonas Eriksson <jonas.eriksson@enea.com> | ||
| 8 | Upstream-Status: Inappropriate [configuration] | ||
| 9 | |||
| 10 | diff --git a/qemu/tests/cfg/timedrift_check_clock_offset.cfg b/qemu/tests/cfg/timedrift_check_clock_offset.cfg | ||
| 11 | index 3395ede..460435d 100644 | ||
| 12 | --- a/qemu/tests/cfg/timedrift_check_clock_offset.cfg | ||
| 13 | +++ b/qemu/tests/cfg/timedrift_check_clock_offset.cfg | ||
| 14 | @@ -8,11 +8,10 @@ | ||
| 15 | type = timedrift_check_with_syscall | ||
| 16 | start_vm = yes | ||
| 17 | only Linux | ||
| 18 | - no JeOS | ||
| 19 | tmp_dir = "/tmp" | ||
| 20 | result_file = "clktest.log" | ||
| 21 | build_cmd = "gcc -lrt ${tmp_dir}/clktest.c -o clktest" | ||
| 22 | - test_cmd = "./clktest" | ||
| 23 | + test_cmd = "/opt/virt-test/test-providers.d/downloads/io-github-autotest-qemu/qemu/deps/timedrift/clktest" | ||
| 24 | check_timeout = 300 | ||
| 25 | - when_crash: | ||
| 26 | type = timedrift_check_when_crash | ||
| 27 | diff --git a/qemu/tests/cfg/tsc_drift.cfg b/qemu/tests/cfg/tsc_drift.cfg | ||
| 28 | index 26f0cef..a55385c 100644 | ||
| 29 | --- a/qemu/tests/cfg/tsc_drift.cfg | ||
| 30 | +++ b/qemu/tests/cfg/tsc_drift.cfg | ||
| 31 | @@ -6,4 +6,6 @@ | ||
| 32 | interval = 30 | ||
| 33 | required_cpu_flags = "constant_tsc" | ||
| 34 | pre_command = "/usr/bin/python shared/scripts/check_cpu_flag.py" | ||
| 35 | + tsc_cmd_host = "/opt/virt-test/test-providers.d/downloads/io-github-autotest-qemu/qemu/deps/timedrift/get_tsc" | ||
| 36 | + tsc_cmd_guest = "/opt/virt-test/test-providers.d/downloads/io-github-autotest-qemu/qemu/deps/timedrift/get_tsc" | ||
| 37 | smp_min = 2 | ||
diff --git a/recipes-test/virt-test/files/qemu-tests-tsc-sync-build-avoidance.patch b/recipes-test/virt-test/files/qemu-tests-tsc-sync-build-avoidance.patch new file mode 100644 index 0000000..2e078ff --- /dev/null +++ b/recipes-test/virt-test/files/qemu-tests-tsc-sync-build-avoidance.patch | |||
| @@ -0,0 +1,194 @@ | |||
| 1 | commit 58b79263adaaee08a7a913268f36e2f957b330db | ||
| 2 | Author: Jonas Eriksson <jonas.eriksson@enea.com> | ||
| 3 | Date: Fri Mar 21 15:21:18 2014 +0100 | ||
| 4 | |||
| 5 | tsc_sync tests: Avoid build and parameterize | ||
| 6 | |||
| 7 | Signed-off-by: Jonas Eriksson <jonas.eriksson@enea.com> | ||
| 8 | Upstream-Status: Pending | ||
| 9 | |||
| 10 | diff --git a/qemu/tests/timerdevice_clock_drift_with_ntp.py b/qemu/tests/timerdevice_clock_drift_with_ntp.py | ||
| 11 | index 4498519..28f22c0 100644 | ||
| 12 | --- a/qemu/tests/timerdevice_clock_drift_with_ntp.py | ||
| 13 | +++ b/qemu/tests/timerdevice_clock_drift_with_ntp.py | ||
| 14 | @@ -26,9 +26,11 @@ def run(test, params, env): | ||
| 15 | :param params: Dictionary with test parameters. | ||
| 16 | :param env: Dictionary with the test environment. | ||
| 17 | """ | ||
| 18 | + drift_filename = params.get("drift_filename", "/var/lib/ntp/drift") | ||
| 19 | + | ||
| 20 | def _drift_file_exist(): | ||
| 21 | try: | ||
| 22 | - session.cmd("test -f /var/lib/ntp/drift") | ||
| 23 | + session.cmd("test -f %s" % drift_filename) | ||
| 24 | return True | ||
| 25 | except Exception: | ||
| 26 | return False | ||
| 27 | @@ -46,20 +48,25 @@ def run(test, params, env): | ||
| 28 | timeout = int(params.get("login_timeout", 360)) | ||
| 29 | sess_guest_load = vm.wait_for_login(timeout=timeout) | ||
| 30 | |||
| 31 | - error.context("Copy time-warp-test.c to guest", logging.info) | ||
| 32 | - src_file_name = os.path.join(data_dir.get_deps_dir(), "time_warp", | ||
| 33 | - "time-warp-test.c") | ||
| 34 | - vm.copy_files_to(src_file_name, "/tmp") | ||
| 35 | + time_warp_test_cmd = params.get("time_warp_test_cmd", "/tmp/time-warp-test") | ||
| 36 | + | ||
| 37 | + if sess_guest_load.get_command_status("test -x %s" % time_warp_test_cmd): | ||
| 38 | + error.context("Copy time-warp-test.c to guest", logging.info) | ||
| 39 | + src_file_name = os.path.join(data_dir.get_deps_dir(), "time_warp", | ||
| 40 | + "time-warp-test.c") | ||
| 41 | + vm.copy_files_to(src_file_name, "/tmp") | ||
| 42 | |||
| 43 | - error.context("Compile the time-warp-test.c", logging.info) | ||
| 44 | - cmd = "cd /tmp/;" | ||
| 45 | - cmd += " yum install -y popt-devel;" | ||
| 46 | - cmd += " rm -f time-warp-test;" | ||
| 47 | - cmd += " gcc -Wall -o time-warp-test time-warp-test.c -lrt" | ||
| 48 | - sess_guest_load.cmd(cmd) | ||
| 49 | + error.context("Compile the time-warp-test.c", logging.info) | ||
| 50 | + cmd = "cd /tmp/;" | ||
| 51 | + cmd += " yum install -y popt-devel;" | ||
| 52 | + cmd += " rm -f time-warp-test;" | ||
| 53 | + cmd += " gcc -Wall -o time-warp-test time-warp-test.c -lrt" | ||
| 54 | + sess_guest_load.cmd(cmd) | ||
| 55 | |||
| 56 | error.context("Stop ntpd and apply load on guest", logging.info) | ||
| 57 | - sess_guest_load.cmd("yum install -y ntp; service ntpd stop") | ||
| 58 | + default_ntp_stop_cmd = "yum install -y ntp; service ntpd stop; rm -f %s" % drift_filename | ||
| 59 | + ntp_stop_cmd = params.get("ntp_stop_cmd", default_ntp_stop_cmd) | ||
| 60 | + sess_guest_load.cmd(ntp_stop_cmd) | ||
| 61 | load_cmd = "for ((I=0; I<`grep 'processor id' /proc/cpuinfo| wc -l`; I++));" | ||
| 62 | load_cmd += " do taskset -c $I /bin/bash -c 'for ((;;)); do X=1; done &';" | ||
| 63 | load_cmd += " done" | ||
| 64 | @@ -80,12 +87,12 @@ def run(test, params, env): | ||
| 65 | |||
| 66 | error.context("Run time-warp-test", logging.info) | ||
| 67 | session = vm.wait_for_login(timeout=timeout) | ||
| 68 | - cmd = "/tmp/time-warp-test > /dev/null &" | ||
| 69 | + cmd = "%s > /dev/null &" % time_warp_test_cmd | ||
| 70 | session.sendline(cmd) | ||
| 71 | |||
| 72 | error.context("Start ntpd on guest", logging.info) | ||
| 73 | - cmd = "service ntpd start; sleep 1; echo" | ||
| 74 | - session.cmd(cmd) | ||
| 75 | + ntp_start_cmd = params.get("ntp_start_cmd", "service ntpd start; sleep 1; echo") | ||
| 76 | + session.cmd(ntp_start_cmd) | ||
| 77 | |||
| 78 | error.context("Check if the drift file exists on guest", logging.info) | ||
| 79 | test_run_timeout = float(params["test_run_timeout"]) | ||
| 80 | @@ -93,10 +100,12 @@ def run(test, params, env): | ||
| 81 | utils_misc.wait_for(_drift_file_exist, test_run_timeout, step=5) | ||
| 82 | except aexpect.ShellCmdError, detail: | ||
| 83 | raise error.TestError("Failed to wait for the creation of" | ||
| 84 | - " /var/lib/ntp/drift file. Detail: '%s'" % detail) | ||
| 85 | + " %s file. Detail: '%s'" % | ||
| 86 | + (drift_filename, detail)) | ||
| 87 | |||
| 88 | error.context("Verify the drift file content on guest", logging.info) | ||
| 89 | - output = session.cmd("cat /var/lib/ntp/drift") | ||
| 90 | + output = session.cmd("cat %s" % drift_filename) | ||
| 91 | if int(abs(float(output))) > 20: | ||
| 92 | raise error.TestFail("Failed to check the ntp drift." | ||
| 93 | - " Output: '%s'" % output) | ||
| 94 | + " Output from 'cat %s': '%s'" % | ||
| 95 | + (drift_filename, output)) | ||
| 96 | diff --git a/qemu/tests/timerdevice_tscsync_change_host_clksource.py b/qemu/tests/timerdevice_tscsync_change_host_clksource.py | ||
| 97 | index 5339fce..3ea6cb2 100644 | ||
| 98 | --- a/qemu/tests/timerdevice_tscsync_change_host_clksource.py | ||
| 99 | +++ b/qemu/tests/timerdevice_tscsync_change_host_clksource.py | ||
| 100 | @@ -43,23 +43,27 @@ def run(test, params, env): | ||
| 101 | if not '0' in output: | ||
| 102 | raise error.TestFail("Failed to check vsyscall. Output: '%s'" % output) | ||
| 103 | |||
| 104 | - error.context("Copy time-warp-test.c to guest", logging.info) | ||
| 105 | - src_file_name = os.path.join(data_dir.get_deps_dir(), "tsc_sync", | ||
| 106 | - "time-warp-test.c") | ||
| 107 | - vm.copy_files_to(src_file_name, "/tmp") | ||
| 108 | - | ||
| 109 | - error.context("Compile the time-warp-test.c", logging.info) | ||
| 110 | - cmd = "cd /tmp/;" | ||
| 111 | - cmd += " yum install -y popt-devel;" | ||
| 112 | - cmd += " rm -f time-warp-test;" | ||
| 113 | - cmd += " gcc -Wall -o time-warp-test time-warp-test.c -lrt" | ||
| 114 | - session.cmd(cmd) | ||
| 115 | - | ||
| 116 | - error.context("Run time-warp-test", logging.info) | ||
| 117 | + time_warp_test_cmd = params.get("time_warp_test_cmd", "/tmp/time-warp-test") | ||
| 118 | + | ||
| 119 | + if session.get_command_status("test -x %s" % time_warp_test_cmd): | ||
| 120 | + error.context("Copy time-warp-test.c to guest", logging.info) | ||
| 121 | + src_file_name = os.path.join(data_dir.get_deps_dir(), "tsc_sync", | ||
| 122 | + "time-warp-test.c") | ||
| 123 | + vm.copy_files_to(src_file_name, "/tmp") | ||
| 124 | + | ||
| 125 | + error.context("Compile the time-warp-test.c", logging.info) | ||
| 126 | + cmd = "cd /tmp/;" | ||
| 127 | + cmd += " yum install -y popt-devel;" | ||
| 128 | + cmd += " rm -f time-warp-test;" | ||
| 129 | + cmd += " gcc -Wall -o time-warp-test time-warp-test.c -lrt" | ||
| 130 | + session.cmd(cmd) | ||
| 131 | + | ||
| 132 | + time_warp_test_cmd = "/tmp/time-warp-test" | ||
| 133 | + | ||
| 134 | + error.context("Run %s" % time_warp_test_cmd, logging.info) | ||
| 135 | test_run_timeout = int(params.get("test_run_timeout", 10)) | ||
| 136 | session.sendline("$(sleep %d; pkill time-warp-test) &" % test_run_timeout) | ||
| 137 | - cmd = "/tmp/time-warp-test" | ||
| 138 | - _, output = session.cmd_status_output(cmd, timeout=(test_run_timeout + 60)) | ||
| 139 | + _, output = session.cmd_status_output(time_warp_test_cmd, timeout=(test_run_timeout + 60)) | ||
| 140 | |||
| 141 | re_str = "fail:(\d+).*?fail:(\d+).*fail:(\d+)" | ||
| 142 | fail_cnt = re.findall(re_str, output) | ||
| 143 | @@ -83,8 +87,7 @@ def run(test, params, env): | ||
| 144 | logging.info) | ||
| 145 | cmd = "$(sleep %d; pkill time-warp-test) &" | ||
| 146 | session.sendline(cmd % test_run_timeout) | ||
| 147 | - cmd = "/tmp/time-warp-test" | ||
| 148 | - _, output = session.cmd_status_output(cmd, | ||
| 149 | + _, output = session.cmd_status_output(time_warp_test_cmd, | ||
| 150 | timeout=(test_run_timeout + 60)) | ||
| 151 | |||
| 152 | fail_cnt = re.findall(re_str, output) | ||
| 153 | diff --git a/qemu/tests/timerdevice_tscsync_longtime.py b/qemu/tests/timerdevice_tscsync_longtime.py | ||
| 154 | index 47cc659..841be62 100644 | ||
| 155 | --- a/qemu/tests/timerdevice_tscsync_longtime.py | ||
| 156 | +++ b/qemu/tests/timerdevice_tscsync_longtime.py | ||
| 157 | @@ -40,23 +40,25 @@ def run(test, params, env): | ||
| 158 | timeout = int(params.get("login_timeout", 360)) | ||
| 159 | session = vm.wait_for_login(timeout=timeout) | ||
| 160 | |||
| 161 | - error.context("Copy time-warp-test.c to guest", logging.info) | ||
| 162 | - src_file_name = os.path.join(data_dir.get_root_dir(), "shared", "deps", | ||
| 163 | - "time-warp-test.c") | ||
| 164 | - vm.copy_files_to(src_file_name, "/tmp") | ||
| 165 | + time_warp_test_cmd = params.get("time_warp_test_cmd", "/tmp/time-warp-test") | ||
| 166 | |||
| 167 | - error.context("Compile the time-warp-test.c", logging.info) | ||
| 168 | - cmd = "cd /tmp/;" | ||
| 169 | - cmd += " yum install -y popt-devel;" | ||
| 170 | - cmd += " rm -f time-warp-test;" | ||
| 171 | - cmd += " gcc -Wall -o time-warp-test time-warp-test.c -lrt" | ||
| 172 | - session.cmd(cmd) | ||
| 173 | + if sess_guest_load.get_command_status("test -x %s", time_warp_test_cmd): | ||
| 174 | + error.context("Copy time-warp-test.c to guest", logging.info) | ||
| 175 | + src_file_name = os.path.join(data_dir.get_root_dir(), "shared", "deps", | ||
| 176 | + "time-warp-test.c") | ||
| 177 | + vm.copy_files_to(src_file_name, "/tmp") | ||
| 178 | + | ||
| 179 | + error.context("Compile the time-warp-test.c", logging.info) | ||
| 180 | + cmd = "cd /tmp/;" | ||
| 181 | + cmd += " yum install -y popt-devel;" | ||
| 182 | + cmd += " rm -f time-warp-test;" | ||
| 183 | + cmd += " gcc -Wall -o time-warp-test time-warp-test.c -lrt" | ||
| 184 | + session.cmd(cmd) | ||
| 185 | |||
| 186 | error.context("Run time-warp-test for minimum 4 hours", logging.info) | ||
| 187 | test_run_timeout = int(params.get("test_run_timeout", 14400)) | ||
| 188 | session.sendline("$(sleep %d; pkill time-warp-test) &" % test_run_timeout) | ||
| 189 | - cmd = "/tmp/time-warp-test" | ||
| 190 | - _, output = session.cmd_status_output(cmd, timeout=(test_run_timeout + 60)) | ||
| 191 | + _, output = session.cmd_status_output(time_warp_test_cmd, timeout=(test_run_timeout + 60)) | ||
| 192 | |||
| 193 | re_str = "fail:(\d+).*?fail:(\d+).*fail:(\d+)" | ||
| 194 | fail_cnt = re.findall(re_str, output) | ||
diff --git a/recipes-test/virt-test/files/qemu-tests-tsc-sync-config.patch b/recipes-test/virt-test/files/qemu-tests-tsc-sync-config.patch new file mode 100644 index 0000000..8f45b5e --- /dev/null +++ b/recipes-test/virt-test/files/qemu-tests-tsc-sync-config.patch | |||
| @@ -0,0 +1,21 @@ | |||
| 1 | commit ee71d759a8133bf9af53e430eaa2b8fe47cbd283 | ||
| 2 | Author: Jonas Eriksson <jonas.eriksson@enea.com> | ||
| 3 | Date: Thu Mar 27 10:11:25 2014 +0100 | ||
| 4 | |||
| 5 | tsc_sync tests: Add configuration | ||
| 6 | |||
| 7 | Signed-off-by: Jonas Eriksson <jonas.eriksson@enea.com> | ||
| 8 | Upstream-Status: Inappropriate [configuration] | ||
| 9 | |||
| 10 | diff --git a/qemu/tests/cfg/timerdevice.cfg b/qemu/tests/cfg/timerdevice.cfg | ||
| 11 | index 9ef38c6..02d653c 100644 | ||
| 12 | --- a/qemu/tests/cfg/timerdevice.cfg | ||
| 13 | +++ b/qemu/tests/cfg/timerdevice.cfg | ||
| 14 | @@ -1,6 +1,7 @@ | ||
| 15 | - timerdevice: | ||
| 16 | no Host_RHEL.5, Host_RHEL.6 | ||
| 17 | restart_vm = yes | ||
| 18 | + time_warp_test_cmd = "/opt/virt-test/test-providers.d/downloads/io-github-autotest-qemu/qemu/deps/tsc_sync/time-warp-test" | ||
| 19 | variants: | ||
| 20 | - tscwrite: | ||
| 21 | only Fedora.19, RHEL.7 | ||
diff --git a/recipes-test/virt-test/files/qemu-tests-virtual-nic-send-buffer-config.patch b/recipes-test/virt-test/files/qemu-tests-virtual-nic-send-buffer-config.patch new file mode 100644 index 0000000..ee93236 --- /dev/null +++ b/recipes-test/virt-test/files/qemu-tests-virtual-nic-send-buffer-config.patch | |||
| @@ -0,0 +1,26 @@ | |||
| 1 | commit ec85c479019a50724d78e41c1820c89b9e1af88a | ||
| 2 | Author: Jonas Eriksson <jonas.eriksson@enea.com> | ||
| 3 | Date: Fri Mar 28 13:11:52 2014 +0100 | ||
| 4 | |||
| 5 | virtual_nic_send_buffer test: Add configuration | ||
| 6 | |||
| 7 | Signed-off-by: Jonas Eriksson <jonas.eriksson@enea.com> | ||
| 8 | Upstream-Status: Inappropriate [configuration] | ||
| 9 | |||
| 10 | diff --git a/qemu/tests/cfg/virtual_nic_send_buffer.cfg b/qemu/tests/cfg/virtual_nic_send_buffer.cfg | ||
| 11 | index c11715c..d6fc3b8 100644 | ||
| 12 | --- a/qemu/tests/cfg/virtual_nic_send_buffer.cfg | ||
| 13 | +++ b/qemu/tests/cfg/virtual_nic_send_buffer.cfg | ||
| 14 | @@ -8,11 +8,10 @@ | ||
| 15 | mem = 1024 | ||
| 16 | copy_protocol = tcp | ||
| 17 | # Params for sub_test netperf_udp | ||
| 18 | - hostpasswd = redhat | ||
| 19 | + hostpasswd = 123456 | ||
| 20 | message_size_range = 580 590 1 | ||
| 21 | sub_test_name = netperf_udp | ||
| 22 | dsthost = localhost | ||
| 23 | - netperf_download_link = netperf/netperf-2.6.0.tar.bz2 | ||
| 24 | test_protocol = UDP_STREAM | ||
| 25 | Windows: | ||
| 26 | vm_as_server = yes | ||
diff --git a/recipes-test/virt-test/files/remove_7za_dependency.patch b/recipes-test/virt-test/files/remove_7za_dependency.patch new file mode 100644 index 0000000..4eeca94 --- /dev/null +++ b/recipes-test/virt-test/files/remove_7za_dependency.patch | |||
| @@ -0,0 +1,13 @@ | |||
| 1 | diff --git a/virttest/bootstrap.py b/virttest/bootstrap.py | ||
| 2 | index e7644a6..73c103a 100644 | ||
| 3 | --- a/virttest/bootstrap.py | ||
| 4 | +++ b/virttest/bootstrap.py | ||
| 5 | @@ -10,7 +10,7 @@ import asset | ||
| 6 | import cartesian_config | ||
| 7 | import utils_selinux | ||
| 8 | |||
| 9 | -basic_program_requirements = ['7za', 'tcpdump', 'nc', 'ip', 'arping'] | ||
| 10 | +basic_program_requirements = ['tcpdump', 'nc', 'ip', 'arping'] | ||
| 11 | |||
| 12 | recommended_programs = {'qemu': [('qemu-kvm', 'kvm'), ('qemu-img',), | ||
| 13 | ('qemu-io',)], | ||
diff --git a/recipes-test/virt-test/files/remove_gcc_dependency.patch b/recipes-test/virt-test/files/remove_gcc_dependency.patch new file mode 100644 index 0000000..fc4aa04 --- /dev/null +++ b/recipes-test/virt-test/files/remove_gcc_dependency.patch | |||
| @@ -0,0 +1,13 @@ | |||
| 1 | diff --git a/virttest/bootstrap.py b/virttest/bootstrap.py | ||
| 2 | index 73c103a..c4e2623 100644 | ||
| 3 | --- a/virttest/bootstrap.py | ||
| 4 | +++ b/virttest/bootstrap.py | ||
| 5 | @@ -22,7 +22,7 @@ recommended_programs = {'qemu': [('qemu-kvm', 'kvm'), ('qemu-img',), | ||
| 6 | 'v2v': [], | ||
| 7 | 'libguestfs': [('perl',)]} | ||
| 8 | |||
| 9 | -mandatory_programs = {'qemu': basic_program_requirements + ['gcc'], | ||
| 10 | +mandatory_programs = {'qemu': basic_program_requirements, | ||
| 11 | 'libvirt': basic_program_requirements, | ||
| 12 | 'openvswitch': basic_program_requirements, | ||
| 13 | 'lvsb': ['virt-sandbox', 'virt-sandbox-service', 'virsh'], | ||
diff --git a/recipes-test/virt-test/files/virt-test-ppc.patch b/recipes-test/virt-test/files/virt-test-ppc.patch new file mode 100644 index 0000000..865f42d --- /dev/null +++ b/recipes-test/virt-test/files/virt-test-ppc.patch | |||
| @@ -0,0 +1,121 @@ | |||
| 1 | Enable ppc support in virt-test | ||
| 2 | |||
| 3 | Signed-off-by: Jonas Eriksson <jonas.eriksson@enea.com> | ||
| 4 | Upstream-Status: Pending | ||
| 5 | diff --git a/virttest/arch.py b/virttest/arch.py | ||
| 6 | index d5e92f6..b1f0084 100644 | ||
| 7 | --- a/virttest/arch.py | ||
| 8 | +++ b/virttest/arch.py | ||
| 9 | @@ -3,7 +3,7 @@ from virttest import utils_misc | ||
| 10 | |||
| 11 | ARCH = platform.machine() | ||
| 12 | |||
| 13 | -if ARCH == "ppc64": | ||
| 14 | +if ARCH == "ppc64" or ARCH == "ppc": | ||
| 15 | # From include/linux/sockios.h | ||
| 16 | SIOCSIFHWADDR = 0x8924 | ||
| 17 | SIOCGIFHWADDR = 0x8927 | ||
| 18 | @@ -58,5 +58,5 @@ def get_kvm_module_list(): | ||
| 19 | arch_convert = {'GenuineIntel': 'intel', 'AuthenticAMD': 'amd'} | ||
| 20 | host_cpu_type = utils_misc.get_cpu_vendor(verbose=False) | ||
| 21 | return ["kvm", "kvm-%s" % arch_convert[host_cpu_type]] | ||
| 22 | - elif ARCH == 'ppc64': | ||
| 23 | + elif ARCH == 'ppc64' or ARCH == 'ppc': | ||
| 24 | return ["kvm"] | ||
| 25 | diff --git a/virttest/utils_misc.py b/virttest/utils_misc.py | ||
| 26 | index c6a3104..a5098be 100644 | ||
| 27 | --- a/virttest/utils_misc.py | ||
| 28 | +++ b/virttest/utils_misc.py | ||
| 29 | @@ -1589,6 +1590,8 @@ def get_host_cpu_models(): | ||
| 30 | |||
| 31 | if ARCH == 'ppc64': | ||
| 32 | return ['POWER7'] | ||
| 33 | + if ARCH == 'ppc': | ||
| 34 | + return ['e500mc'] | ||
| 35 | |||
| 36 | cpu_types = {"AuthenticAMD": ["Opteron_G5", "Opteron_G4", "Opteron_G3", | ||
| 37 | "Opteron_G2", "Opteron_G1"], | ||
| 38 | diff --git a/virttest/qemu_vm.py b/virttest/qemu_vm.py | ||
| 39 | index 27a6025..3e982bb 100644 | ||
| 40 | --- a/virttest/qemu_vm.py | ||
| 41 | +++ b/virttest/qemu_vm.py | ||
| 42 | @@ -421,20 +421,33 @@ class VM(virt_vm.BaseVM): | ||
| 43 | cmd += _add_option("mode", "control") | ||
| 44 | return cmd | ||
| 45 | |||
| 46 | - def add_serial(devices, name, filename): | ||
| 47 | - if not devices.has_option("chardev"): | ||
| 48 | - return " -serial unix:'%s',server,nowait" % filename | ||
| 49 | - | ||
| 50 | - serial_id = "serial_id_%s" % name | ||
| 51 | + def add_serial_chardev(serial_id, filename): | ||
| 52 | cmd = " -chardev socket" | ||
| 53 | cmd += _add_option("id", serial_id) | ||
| 54 | cmd += _add_option("path", filename) | ||
| 55 | cmd += _add_option("server", "NO_EQUAL_STRING") | ||
| 56 | cmd += _add_option("nowait", "NO_EQUAL_STRING") | ||
| 57 | + return cmd | ||
| 58 | + | ||
| 59 | + def add_isa_serial(devices, name, filename): | ||
| 60 | + if not devices.has_option("chardev"): | ||
| 61 | + return " -serial unix:'%s',server,nowait" % filename | ||
| 62 | + | ||
| 63 | + serial_id = "serial_id_%s" % name | ||
| 64 | + cmd = add_serial_chardev(serial_id, filename) | ||
| 65 | cmd += " -device isa-serial" | ||
| 66 | cmd += _add_option("chardev", serial_id) | ||
| 67 | return cmd | ||
| 68 | |||
| 69 | + def add_direct_serial(devices, name, filename): | ||
| 70 | + if not devices.has_option("chardev"): | ||
| 71 | + return " -serial unix:'%s',server,nowait" % filename | ||
| 72 | + | ||
| 73 | + serial_id = "serial_id_%s" % name | ||
| 74 | + cmd = add_serial_chardev(serial_id, filename) | ||
| 75 | + cmd += " -serial chardev:%s" % serial_id | ||
| 76 | + return cmd | ||
| 77 | + | ||
| 78 | def add_virtio_port(devices, name, bus, filename, porttype, chardev, | ||
| 79 | name_prefix=None, index=None, extra_params=""): | ||
| 80 | """ | ||
| 81 | @@ -1190,7 +1203,11 @@ class VM(virt_vm.BaseVM): | ||
| 82 | # Add serial console redirection | ||
| 83 | for serial in params.objects("isa_serials"): | ||
| 84 | serial_filename = vm.get_serial_console_filename(serial) | ||
| 85 | - cmd = add_serial(devices, serial, serial_filename) | ||
| 86 | + cmd = add_isa_serial(devices, serial, serial_filename) | ||
| 87 | + devices.insert(StrDev('SER-%s' % serial, cmdline=cmd)) | ||
| 88 | + for serial in params.objects("direct_serials"): | ||
| 89 | + serial_filename = vm.get_serial_console_filename(serial) | ||
| 90 | + cmd = add_direct_serial(devices, serial, serial_filename) | ||
| 91 | devices.insert(StrDev('SER-%s' % serial, cmdline=cmd)) | ||
| 92 | |||
| 93 | # Add virtio_serial ports | ||
| 94 | @@ -1473,10 +1490,10 @@ class VM(virt_vm.BaseVM): | ||
| 95 | continue | ||
| 96 | cpu_model = model | ||
| 97 | break | ||
| 98 | - else: | ||
| 99 | - cpu_model = model | ||
| 100 | - logging.error("Non existing CPU model %s will be passed " | ||
| 101 | - "to qemu (wrong config or negative test)", model) | ||
| 102 | + else: | ||
| 103 | + cpu_model = model | ||
| 104 | + logging.error("Non existing CPU model %s will be passed " | ||
| 105 | + "to qemu (wrong config or negative test)", model) | ||
| 106 | |||
| 107 | if use_default_cpu_model: | ||
| 108 | cpu_model = params.get("default_cpu_model") | ||
| 109 | @@ -2230,9 +2247,11 @@ class VM(virt_vm.BaseVM): | ||
| 110 | # Add this monitor to the list | ||
| 111 | self.monitors += [monitor] | ||
| 112 | |||
| 113 | - # Create isa serial ports. | ||
| 114 | + # Create serial ports. | ||
| 115 | for serial in params.objects("isa_serials"): | ||
| 116 | self.serial_ports.append(serial) | ||
| 117 | + for serial in params.objects("direct_serials"): | ||
| 118 | + self.serial_ports.append(serial) | ||
| 119 | |||
| 120 | # Create virtio_ports (virtio_serialports and virtio_consoles) | ||
| 121 | i = 0 | ||
diff --git a/recipes-test/virt-test/files/virt-test-qemu_vm-add-monotonic-start-time.patch b/recipes-test/virt-test/files/virt-test-qemu_vm-add-monotonic-start-time.patch new file mode 100644 index 0000000..016a6d2 --- /dev/null +++ b/recipes-test/virt-test/files/virt-test-qemu_vm-add-monotonic-start-time.patch | |||
| @@ -0,0 +1,32 @@ | |||
| 1 | commit 00c37654013d216243383453de309a639f2599f3 | ||
| 2 | Author: Jonas Eriksson <jonas.eriksson@enea.com> | ||
| 3 | Date: Mon Apr 14 08:41:33 2014 +0200 | ||
| 4 | |||
| 5 | qemu_vm: Add monotonic start time | ||
| 6 | |||
| 7 | For tests that would like to fetch the monotonic start time, expose it | ||
| 8 | through the start_monotonic_time member. | ||
| 9 | |||
| 10 | Signed-off-by: Jonas Eriksson <jonas.eriksson@enea.com> | ||
| 11 | Upstream-Status: Backport | ||
| 12 | |||
| 13 | diff --git a/virttest/qemu_vm.py b/virttest/qemu_vm.py | ||
| 14 | index 0a58362..6ed2736 100644 | ||
| 15 | --- a/virttest/qemu_vm.py | ||
| 16 | +++ b/virttest/qemu_vm.py | ||
| 17 | @@ -150,6 +150,7 @@ class VM(virt_vm.BaseVM): | ||
| 18 | self.instance = state['instance'] | ||
| 19 | self.qemu_command = '' | ||
| 20 | self.start_time = 0.0 | ||
| 21 | + self.start_monotonic_time = 0.0 | ||
| 22 | self.last_boot_index = 0 | ||
| 23 | self.last_driver_index = 0 | ||
| 24 | |||
| 25 | @@ -2169,6 +2170,7 @@ class VM(virt_vm.BaseVM): | ||
| 26 | logging.info("Created qemu process with parent PID %d", | ||
| 27 | self.process.get_pid()) | ||
| 28 | self.start_time = time.time() | ||
| 29 | + self.start_monotonic_time = utils_misc.monotonic_time() | ||
| 30 | |||
| 31 | # test doesn't need to hold tapfd's open | ||
| 32 | for nic in self.virtnet: | ||
diff --git a/recipes-test/virt-test/files/virt-test-search-qemu-system-arch.patch b/recipes-test/virt-test/files/virt-test-search-qemu-system-arch.patch new file mode 100644 index 0000000..2199317 --- /dev/null +++ b/recipes-test/virt-test/files/virt-test-search-qemu-system-arch.patch | |||
| @@ -0,0 +1,21 @@ | |||
| 1 | diff --git a/virttest/utils_misc.py b/virttest/utils_misc.py | ||
| 2 | index c6a3104..61ffb23 100644 | ||
| 3 | --- a/virttest/utils_misc.py | ||
| 4 | +++ b/virttest/utils_misc.py | ||
| 5 | @@ -21,6 +21,7 @@ import tarfile | ||
| 6 | import shutil | ||
| 7 | import getpass | ||
| 8 | import ctypes | ||
| 9 | +import platform | ||
| 10 | from autotest.client import utils, os_dep | ||
| 11 | from autotest.client.shared import error, logging_config | ||
| 12 | from autotest.client.shared import git | ||
| 13 | @@ -1697,7 +1698,7 @@ def get_qemu_binary(params): | ||
| 14 | qemu_binary = find_command('qemu-kvm') | ||
| 15 | logging.debug('Found %s', qemu_binary) | ||
| 16 | except ValueError: | ||
| 17 | - qemu_binary = find_command('kvm') | ||
| 18 | + qemu_binary = find_command('qemu-system-%s' % platform.machine()) | ||
| 19 | logging.debug('Found %s', qemu_binary) | ||
| 20 | else: | ||
| 21 | library_path = os.path.join(_get_backend_dir(params), 'install_root', 'lib') | ||
diff --git a/recipes-test/virt-test/files/virttest-passfd-compiler-fix.patch b/recipes-test/virt-test/files/virttest-passfd-compiler-fix.patch new file mode 100644 index 0000000..cdbb8ef --- /dev/null +++ b/recipes-test/virt-test/files/virttest-passfd-compiler-fix.patch | |||
| @@ -0,0 +1,24 @@ | |||
| 1 | commit f97e66a1308b41fa70d662643de03d0e8a7c71cb | ||
| 2 | Author: Jonas Eriksson <jonas.eriksson@enea.com> | ||
| 3 | Date: Tue Apr 1 10:53:31 2014 +0200 | ||
| 4 | |||
| 5 | passfd_setup: Configure the compiler | ||
| 6 | |||
| 7 | In order to pull cross-compilation information from the environment, the | ||
| 8 | compiler needs to be customized. | ||
| 9 | |||
| 10 | Signed-off-by: Jonas Eriksson <jonas.eriksson@enea.com> | ||
| 11 | Upstream-Status: Pending | ||
| 12 | |||
| 13 | diff --git a/virttest/passfd_setup.py b/virttest/passfd_setup.py | ||
| 14 | index d6fe590..9dc7750 100644 | ||
| 15 | --- a/virttest/passfd_setup.py | ||
| 16 | +++ b/virttest/passfd_setup.py | ||
| 17 | @@ -26,6 +26,7 @@ def passfd_setup(output_dir=OUTPUT_DIR): | ||
| 18 | output_file = os.path.join(output_dir, SHARED_OBJECT) | ||
| 19 | |||
| 20 | c = distutils.ccompiler.new_compiler() | ||
| 21 | + distutils.sysconfig.customize_compiler(c) | ||
| 22 | objects = c.compile(SOURCES, include_dirs=[PYTHON_HEADERS], | ||
| 23 | output_dir=data_dir.get_tmp_dir(), | ||
| 24 | extra_postargs=['-fPIC']) | ||
diff --git a/recipes-test/virt-test/files/virttest-utils-misc-cpu-flags-fix.patch b/recipes-test/virt-test/files/virttest-utils-misc-cpu-flags-fix.patch new file mode 100644 index 0000000..68b59ba --- /dev/null +++ b/recipes-test/virt-test/files/virttest-utils-misc-cpu-flags-fix.patch | |||
| @@ -0,0 +1,25 @@ | |||
| 1 | commit 6a22985e22876351874d9d9687a0e44b3488f055 | ||
| 2 | Author: Jonas Eriksson <jonas.eriksson@enea.com> | ||
| 3 | Date: Tue Apr 1 13:30:50 2014 +0200 | ||
| 4 | |||
| 5 | utils_misc: Use re.split to do regexp split | ||
| 6 | |||
| 7 | The .split() method of python's standard string type does not take a | ||
| 8 | regexp as an argument, only another string. Switch to re.split(). | ||
| 9 | |||
| 10 | Signed-off-by: Jonas Eriksson <jonas.eriksson@enea.com> | ||
| 11 | Upstream-Status: Pending | ||
| 12 | |||
| 13 | diff --git a/virttest/utils_misc.py b/virttest/utils_misc.py | ||
| 14 | index d63aaef..2396be8 100644 | ||
| 15 | --- a/virttest/utils_misc.py | ||
| 16 | +++ b/virttest/utils_misc.py | ||
| 17 | @@ -1495,7 +1495,7 @@ def get_cpu_flags(cpu_info=""): | ||
| 18 | if not cpu_flag_lists: | ||
| 19 | return [] | ||
| 20 | cpu_flags = cpu_flag_lists[0] | ||
| 21 | - return cpu_flags.strip().split('\s+') | ||
| 22 | + return re.split("\s+", cpu_flags.strip()) | ||
| 23 | |||
| 24 | |||
| 25 | def get_cpu_vendor(cpu_info="", verbose=True): | ||
diff --git a/recipes-test/virt-test/virt-test-libvirt_git.bb b/recipes-test/virt-test/virt-test-libvirt_git.bb new file mode 100644 index 0000000..c14a242 --- /dev/null +++ b/recipes-test/virt-test/virt-test-libvirt_git.bb | |||
| @@ -0,0 +1,26 @@ | |||
| 1 | SUMMARY = "Linux Virtualization Tests - libvirt tests" | ||
| 2 | DESCRIPTION = "Libvirt tests for the virt-test test framework" | ||
| 3 | HOMEPAGE = "https://github.com/autotest/tp-libvirt" | ||
| 4 | SECTION = "console/tests" | ||
| 5 | LICENSE = "GPLv2" | ||
| 6 | LIC_FILES_CHKSUM = "file://LICENSE;md5=17f870b05bb22b9c31f4d593711edf58" | ||
| 7 | |||
| 8 | RDEPENDS_${PN} = "virt-test" | ||
| 9 | |||
| 10 | # Use date of commit pointed to by SRCREV | ||
| 11 | PV = "2014.03.07" | ||
| 12 | SRCREV = "9d4c278ed36e8bd4104cf94e77dc7e89f4ccb917" | ||
| 13 | |||
| 14 | SRC_URI = "git://github.com/autotest/tp-libvirt" | ||
| 15 | |||
| 16 | S = "${WORKDIR}/git" | ||
| 17 | B = "${S}" | ||
| 18 | |||
| 19 | DESTDIR = "/opt/virt-test/test-providers.d/downloads/io-github-autotest-libvirt/" | ||
| 20 | |||
| 21 | FILES_${PN} += "${DESTDIR}" | ||
| 22 | |||
| 23 | do_install() { | ||
| 24 | install -d ${D}/${DESTDIR} | ||
| 25 | cp -r --preserve=mode,links ${B}/* ${D}/${DESTDIR} | ||
| 26 | } | ||
diff --git a/recipes-test/virt-test/virt-test-qemu_git.bb b/recipes-test/virt-test/virt-test-qemu_git.bb new file mode 100644 index 0000000..40f4e56 --- /dev/null +++ b/recipes-test/virt-test/virt-test-qemu_git.bb | |||
| @@ -0,0 +1,118 @@ | |||
| 1 | SUMMARY = "Linux Virtualization Tests - qemu tests" | ||
| 2 | DESCRIPTION = "Qemu tests for the virt-test test framework" | ||
| 3 | HOMEPAGE = "https://github.com/autotest/tp-qemu" | ||
| 4 | SECTION = "console/tests" | ||
| 5 | LICENSE = "GPLv2" | ||
| 6 | LIC_FILES_CHKSUM = "file://LICENSE;md5=575f01e0b7a35e73c8e52ca65fd72bdc" | ||
| 7 | |||
| 8 | def if_arch_re(regexp, trueval, falseval, d): | ||
| 9 | import re | ||
| 10 | target_arch = bb.data.getVar('TARGET_ARCH', d, 1) | ||
| 11 | return trueval if re.match(regexp, target_arch) else falseval | ||
| 12 | |||
| 13 | RDEPENDS_${PN} = "virt-test iperf ntpdate stress python-netserver \ | ||
| 14 | ${@if_arch_re("^(i[3-9]86|x86_64)", "virt-test-qemu-guest-timedrift virt-test-qemu-guest-cpuflags", "", d)} \ | ||
| 15 | " | ||
| 16 | DEPENDS += "popt" | ||
| 17 | |||
| 18 | # Use date of commit pointed to by SRCREV | ||
| 19 | PV = "2014.04.16" | ||
| 20 | SRCREV = "3e15869b4b838c47ce9ea0d4916e1edb89ccc58e" | ||
| 21 | |||
| 22 | SRC_URI = "git://github.com/autotest/tp-qemu \ | ||
| 23 | file://qemu-tests-multi-nic-stress.patch \ | ||
| 24 | file://qemu-tests-time-drift-config.patch \ | ||
| 25 | file://qemu-tests-tsc-sync-build-avoidance.patch \ | ||
| 26 | file://qemu-tests-tsc-sync-config.patch \ | ||
| 27 | file://qemu-tests-pipetest-config.patch \ | ||
| 28 | file://qemu-tests-nx-exploit-config.patch \ | ||
| 29 | file://qemu-tests-clock-getres-config.patch \ | ||
| 30 | file://qemu-tests-stress-config.patch \ | ||
| 31 | file://qemu-tests-virtual-nic-send-buffer-config.patch \ | ||
| 32 | file://qemu-tests-cpuflags-migrate-to-provider.patch \ | ||
| 33 | file://qemu-tests-cpuflags-build-avoidance.patch \ | ||
| 34 | file://qemu-tests-cpuflags-conf.patch \ | ||
| 35 | file://qemu-tests-cyclictest.patch \ | ||
| 36 | " | ||
| 37 | |||
| 38 | S = "${WORKDIR}/git" | ||
| 39 | B = "${S}" | ||
| 40 | |||
| 41 | DESTDIR = "/opt/virt-test/test-providers.d/downloads/io-github-autotest-qemu" | ||
| 42 | |||
| 43 | FILES_${PN} += "${DESTDIR}" | ||
| 44 | |||
| 45 | FILES_${PN}-dbg = " \ | ||
| 46 | ${DESTDIR}/qemu/deps/timedrift/.debug/* \ | ||
| 47 | ${DESTDIR}/qemu/deps/tsc_sync/.debug/* \ | ||
| 48 | ${DESTDIR}/qemu/deps/nx/.debug/* \ | ||
| 49 | ${DESTDIR}/generic/deps/clock_getres/.debug/clock_getres \ | ||
| 50 | ${DESTDIR}/deps/cpu_flags/src/.debug/cpuflags-test-* \ | ||
| 51 | " | ||
| 52 | |||
| 53 | PACKAGES =+ "${PN}-guest-timedrift ${PN}-guest-tsc-sync ${PN}-guest-nx \ | ||
| 54 | ${PN}-guest-clock-getres ${PN}-guest-cpuflags" | ||
| 55 | |||
| 56 | DESCRIPTION_${PN}-guest-timedrift= "Clock test application for time drift test case" | ||
| 57 | FILES_${PN}-guest-timedrift = "${DESTDIR}/qemu/deps/timedrift/clktest \ | ||
| 58 | ${DESTDIR}/qemu/deps/timedrift/get_tsc" | ||
| 59 | |||
| 60 | DESCRIPTION_${PN}-guest-tsc-sync = "Clock test application for time warp test case" | ||
| 61 | FILES_${PN}-guest-tsc-sync = "${DESTDIR}/qemu/deps/tsc_sync/time-warp-test" | ||
| 62 | |||
| 63 | DESCRIPTION_${PN}-guest-nx = "Test application for the NX (no execution) flag" | ||
| 64 | FILES_${PN}-guest-nx = "${DESTDIR}/qemu/deps/nx/nx_exploit" | ||
| 65 | |||
| 66 | DESCRIPTION_${PN}-guest-clock-getres = "Clock resolution test application" | ||
| 67 | FILES_${PN}-guest-clock-getres = "${DESTDIR}/generic/deps/clock_getres/clock_getres" | ||
| 68 | |||
| 69 | DESCRIPTION_${PN}-guest-cpuflags = "CPU flag test application" | ||
| 70 | FILES_${PN}-guest-cpuflags = "${DESTDIR}/deps/cpu_flags/src/cpuflags-test-*" | ||
| 71 | RDEPENDS_${PN}-guest-cpuflags =+ "libgomp" | ||
| 72 | |||
| 73 | do_compile_x86() { | ||
| 74 | # guest-timedrift | ||
| 75 | cd ${S}/qemu/deps/timedrift/ | ||
| 76 | ${CC} get_tsc.c -o get_tsc | ||
| 77 | |||
| 78 | # guest-tsc-sync | ||
| 79 | cd ${S}/qemu/deps/tsc_sync/ | ||
| 80 | ${CC} -I${STAGING_DIR_TARGET}/usr/include -Wall -o time-warp-test time-warp-test.c -lrt | ||
| 81 | |||
| 82 | # guest-nx | ||
| 83 | cd ${S}/qemu/deps/nx/ | ||
| 84 | ${CC} -o nx_exploit x64_sc_rdo.c | ||
| 85 | |||
| 86 | # guest-cpuflags | ||
| 87 | # Note: The $GCC_INCLUDEDIR should be searched for include files according to | ||
| 88 | # http://gcc.gnu.org/onlinedocs/cpp/Search-Path.html. However, it seems that | ||
| 89 | # gcc-cross searches in e.g. | ||
| 90 | # .../sysroots/x86_64-linux/usr/lib/corei7-64-enea-linux/gcc/x86_64-enea-linux/4.8.2/include/ | ||
| 91 | # instead of | ||
| 92 | # .../sysroots/chiefriver/usr/lib/gcc/x86_64-enea-linux/4.8.2/include, | ||
| 93 | # despite --sysroot= pointing to the latter (.../sysroots/chiefriver). | ||
| 94 | export TARGET=`${CC} -v 2>&1 | grep ^Target | cut -d' ' -f2` | ||
| 95 | export GCC_VERSION=`${CC} -v 2>&1 | grep '^gcc version' | cut -d' ' -f3` | ||
| 96 | export GCC_INCLUDEDIR=$PKG_CONFIG_SYSROOT_DIR$libdir/gcc/$TARGET/$GCC_VERSION/include | ||
| 97 | make -C ${S}/deps/cpu_flags/src/ CFLAGS="-I$GCC_INCLUDEDIR" EXTRA_FLAGS='' | ||
| 98 | make -C ${S}/deps/cpu_flags/src/ CFLAGS="-I$GCC_INCLUDEDIR" EXTRA_FLAGS='-msse3 -msse2' | ||
| 99 | # Avoid .o files in the package | ||
| 100 | rm -rf ${S}/qemu/deps/cpu_flags/src/build-* | ||
| 101 | } | ||
| 102 | |||
| 103 | do_compile() { | ||
| 104 | # guest-timedrift | ||
| 105 | cd ${S}/qemu/deps/timedrift/ | ||
| 106 | ${CC} clktest.c -o clktest -lrt | ||
| 107 | |||
| 108 | # guest-clock-getres | ||
| 109 | make -C ${S}/generic/deps/clock_getres/ | ||
| 110 | |||
| 111 | # Architecture-specific applications | ||
| 112 | ${@if_arch_re("^(i[3-9]86|x86_64)", "do_compile_x86", "", d)} | ||
| 113 | } | ||
| 114 | |||
| 115 | do_install() { | ||
| 116 | install -d ${D}/${DESTDIR} | ||
| 117 | cp -r --preserve=mode,links ${B}/* ${D}/${DESTDIR} | ||
| 118 | } | ||
diff --git a/recipes-test/virt-test/virt-test_git.bb b/recipes-test/virt-test/virt-test_git.bb new file mode 100644 index 0000000..ea588f0 --- /dev/null +++ b/recipes-test/virt-test/virt-test_git.bb | |||
| @@ -0,0 +1,77 @@ | |||
| 1 | SUMMARY = "Linux Virtualization Tests" | ||
| 2 | DESCRIPTION = "virt-test is a Linux virtualization test suite, intended to be used in conjunction with the autotest framework" | ||
| 3 | HOMEPAGE = "https://github.com/autotest/virt-test" | ||
| 4 | SECTION = "console/tests" | ||
| 5 | LICENSE = "GPLv2 & MIT & PSF" | ||
| 6 | LIC_FILES_CHKSUM = "file://LICENSE;md5=ca2697f94d6c6ecb0c4ed70d4bca81e2 \ | ||
| 7 | file://README.rst;md5=3f0b5623cfac6b30670bd27eb823e12e" | ||
| 8 | |||
| 9 | RDEPENDS_${PN} = "autotest tcpdump iputils netcat-openbsd virt-manager procps \ | ||
| 10 | less python-logging python-shell python-resource python-subprocess \ | ||
| 11 | python-netclient python-email python-compression python-unixadmin \ | ||
| 12 | python-ctypes python-html python-terminal python-distutils \ | ||
| 13 | python-math python-numbers python-xml python-db" | ||
| 14 | |||
| 15 | DEPENDS += "python" | ||
| 16 | |||
| 17 | # We cannot use the default do_compile etc. from distutils, so just use | ||
| 18 | # distutils-base to get all the correct paths. | ||
| 19 | inherit distutils-base | ||
| 20 | |||
| 21 | # SRCREV reflects the packaged PV | ||
| 22 | PV = "2014.04.14" | ||
| 23 | SRCREV = "b6ee5f288e16d5a72e562a567295d40d3a890fcb" | ||
| 24 | |||
| 25 | SRC_URI = "git://github.com/autotest/virt-test \ | ||
| 26 | file://remove_7za_dependency.patch \ | ||
| 27 | file://remove_gcc_dependency.patch \ | ||
| 28 | file://clear_mandatory_header_list.patch \ | ||
| 29 | file://do_not_upgrade_test_providers.patch \ | ||
| 30 | file://allow_bootstrap_3rd_party_image.patch \ | ||
| 31 | file://add_enea_linux_support.patch \ | ||
| 32 | file://virt-test-qemu_vm-add-monotonic-start-time.patch \ | ||
| 33 | file://dnsmasq-virt-test \ | ||
| 34 | file://virt-test-search-qemu-system-arch.patch \ | ||
| 35 | file://virt-test-ppc.patch \ | ||
| 36 | " | ||
| 37 | |||
| 38 | S = "${WORKDIR}/git" | ||
| 39 | B = "${S}" | ||
| 40 | |||
| 41 | FILES_${PN} += "/opt /etc/dnsmasq.d/virt-test" | ||
| 42 | FILES_${PN}-dbg += "/opt/${PN}/virttest/.debug/* /opt/${PN}/shared/scripts/.debug/*" | ||
| 43 | |||
| 44 | PACKAGES =+ "${PN}-guest-scripts-bin" | ||
| 45 | |||
| 46 | DESCRIPTION_${PN}-guest-scripts-bin = "Guest test binaries for virt-test" | ||
| 47 | FILES_${PN}-guest-scripts-bin = "/opt/${PN}/shared/scripts/pipetest" | ||
| 48 | |||
| 49 | python do_devshell_prepend() { | ||
| 50 | os.environ['BUILD_SYS']="${BUILD_SYS}" | ||
| 51 | os.environ['HOST_SYS']="${HOST_SYS}" | ||
| 52 | os.environ['STAGING_INCDIR']="${STAGING_INCDIR}" | ||
| 53 | os.environ['STAGING_LIBDIR']="${STAGING_LIBDIR}" | ||
| 54 | } | ||
| 55 | |||
| 56 | do_compile() { | ||
| 57 | # _passfd.so | ||
| 58 | export BUILD_SYS="${BUILD_SYS}" | ||
| 59 | export HOST_SYS="${HOST_SYS}" | ||
| 60 | export STAGING_INCDIR="${STAGING_INCDIR}" | ||
| 61 | export STAGING_LIBDIR="${STAGING_LIBDIR}" | ||
| 62 | cd ${S}/virttest | ||
| 63 | python passfd_setup.py ${DISTUTILS_BUILD_ARGS} | ||
| 64 | |||
| 65 | # guest-scripts-bin | ||
| 66 | cd ${S}/shared/scripts/ | ||
| 67 | ${CC} ${CFLAGS} ${LDFLAGS} pipetest.c -o pipetest | ||
| 68 | } | ||
| 69 | |||
| 70 | do_install() { | ||
| 71 | install -d ${D}/opt/${PN} | ||
| 72 | cp -r --preserve=mode,links ${B}/* ${D}/opt/${PN} | ||
| 73 | rm -f ${D}/opt/${PN}/shared/data | ||
| 74 | mkdir -p ${D}/opt/${PN}/shared/data | ||
| 75 | mkdir -p ${D}/etc/dnsmasq.d/ | ||
| 76 | cp --preserve=mode,links ${WORKDIR}/dnsmasq-virt-test ${D}/etc/dnsmasq.d/virt-test | ||
| 77 | } | ||
