diff --git a/generic/tests/autotest_regression.py b/generic/tests/autotest_regression.py index bc40f356c2009db422c200e2e145b37d1dfd57cd..8e734c603e3d2624cf2e41dbace57b0e844aa3fc 100644 --- a/generic/tests/autotest_regression.py +++ b/generic/tests/autotest_regression.py @@ -164,7 +164,7 @@ def run(test, params, env): list_labels_output = session_server.cmd(list_labels_cmd) for line in list_labels_output.splitlines(): logging.debug(line) - if not label_name in list_labels_output: + if label_name not in list_labels_output: raise ValueError("No label %s in the output of %s" % (label_name, list_labels_cmd)) @@ -178,10 +178,10 @@ def run(test, params, env): list_hosts_output = session_server.cmd(list_hosts_cmd) for line in list_hosts_output.splitlines(): logging.debug(line) - if not client_ip in list_hosts_output: + if client_ip not in list_hosts_output: raise ValueError("No client %s in the output of %s" % (client_ip, create_label_cmd)) - if not label_name in list_hosts_output: + if label_name not in list_hosts_output: raise ValueError("No label %s in the output of %s" % (label_name, create_label_cmd)) diff --git a/generic/tests/netstress_kill_guest.py b/generic/tests/netstress_kill_guest.py index 878d61c560c93107a77cbd381351093df82752a1..09992de8dfe0efce2e35dddd38087909f36159c7 100644 --- a/generic/tests/netstress_kill_guest.py +++ b/generic/tests/netstress_kill_guest.py @@ -40,7 +40,7 @@ def run(test, params, env): cmd = params.get("nic_module_cmd") out = session.cmd(cmd) for module in out.split("\n"): - if not cmd in module: + if cmd not in module: modules.append(module.split("/")[-1]) modules.remove("") return set(modules) diff --git a/generic/tests/pxe_boot.py b/generic/tests/pxe_boot.py index 865c6c38280b95f8b62cf5d03ccf60a95629fa5a..aad6ad2039755a60a53e382ec7d8d81571d07209 100644 --- a/generic/tests/pxe_boot.py +++ b/generic/tests/pxe_boot.py @@ -26,7 +26,7 @@ def run(test, params, env): logging.debug, "(pxe capture) ", timeout)[1] error.context("Analyzing the tcpdump result", logging.info) - if not "tftp" in output: + if "tftp" not in output: raise error.TestFail( "Couldn't find any TFTP packets after %s seconds" % timeout) diff --git a/qemu/tests/cpuflags.py b/qemu/tests/cpuflags.py index 4bac2244f893042457136b64281987e1eb567710..b4b1847150b714ae6072c978ed583904c356d53a 100644 --- a/qemu/tests/cpuflags.py +++ b/qemu/tests/cpuflags.py @@ -517,7 +517,7 @@ def run(test, params, env): missing = [] cpu_models = map(separe_cpu_model, cpu_models) for cpu_model in cpu_models: - if not cpu_model in result.stdout: + if cpu_model not in result.stdout: missing.append(cpu_model) if missing: raise error.TestFail("CPU models %s are not in output " @@ -537,7 +537,7 @@ def run(test, params, env): cpu_models = map(separe_cpu_model, cpu_models) missing = [] for cpu_model in cpu_models: - if not cpu_model in result.stdout: + if cpu_model not in result.stdout: missing.append(cpu_model) if missing: raise error.TestFail("CPU models %s are not in output " diff --git a/qemu/tests/cpuinfo_query.py b/qemu/tests/cpuinfo_query.py index c80d8f914f71d96d1839c95556c46b574afcdd5c..fccf991c3401cf28c88c9d2e4e1050602f0dfe71 100644 --- a/qemu/tests/cpuinfo_query.py +++ b/qemu/tests/cpuinfo_query.py @@ -26,7 +26,7 @@ def run(test, params, env): cpuinfos = params.get("cpu_info", "Conroe").split(",") missing = [] for cpuinfo in cpuinfos: - if not cpuinfo in output: + if cpuinfo not in output: missing.append(cpuinfo) if missing: raise error.TestFail("%s is missing in the output\n %s" % diff --git a/qemu/tests/floppy.py b/qemu/tests/floppy.py index 3d4a92ffedfb905f9fa821ab3cb12fbcc2c68c8d..11e4f9c9fb1cb13da0fa484b22720724941bc5fb 100644 --- a/qemu/tests/floppy.py +++ b/qemu/tests/floppy.py @@ -112,7 +112,7 @@ def run(test, params, env): # needs time to load and init floppy driver if self.dest_dir: lsmod = self.session.cmd("lsmod") - if not 'floppy' in lsmod: + if 'floppy' not in lsmod: self.session.cmd("modprobe floppy") else: time.sleep(20) @@ -234,7 +234,7 @@ def run(test, params, env): error.context("Prepare floppy for writing.") if self.mount_dir: lsmod = session.cmd("lsmod") - if not 'floppy' in lsmod: + if 'floppy' not in lsmod: session.cmd("modprobe floppy") else: time.sleep(20) @@ -265,7 +265,7 @@ def run(test, params, env): error.context("Wait for copy finishing.") status = int(session.cmd_status("kill %s" % pid, timeout=copy_timeout)) - if not status in [0]: + if status not in [0]: raise error.TestFail("Copy process was terminatted with" " error code %s" % (status)) @@ -338,12 +338,12 @@ def run(test, params, env): error.context("Prepare floppy for writing.") if self.mount_dir: # If linux lsmod = session.cmd("lsmod") - if not 'floppy' in lsmod: + if 'floppy' not in lsmod: session.cmd("modprobe floppy") else: time.sleep(20) - if not floppy in vm.monitor.info("block"): + if floppy not in vm.monitor.info("block"): raise error.TestFail("Wrong floppy image is placed in vm.") try: @@ -387,7 +387,7 @@ def run(test, params, env): session.cmd("mount -t vfat %s %s" % (guest_floppy_path, self.mount_dir), timeout=30) - if not second_floppy in vm.monitor.info("block"): + if second_floppy not in vm.monitor.info("block"): raise error.TestFail("Wrong floppy image is placed in vm.") sync = SyncData(self.mig.master_id(), self.mig.hostid, diff --git a/qemu/tests/migration_multi_host_downtime_and_speed.py b/qemu/tests/migration_multi_host_downtime_and_speed.py index 0876d8516b6a42326a2aab77c6d9104b8dc9f03b..79d702c448d7097168eb4fc36fdbd62a3ffa3a03 100644 --- a/qemu/tests/migration_multi_host_downtime_and_speed.py +++ b/qemu/tests/migration_multi_host_downtime_and_speed.py @@ -68,7 +68,7 @@ def run(test, params, env): ret = s.get("migrated") == "true" o = vm.monitor.info("migrate") if isinstance(o, str): - return ret and (not "status: active" in o) + return ret and ("status: active" not in o) else: return ret and (o.get("status") != "active") diff --git a/qemu/tests/migration_multi_host_firewall_block.py b/qemu/tests/migration_multi_host_firewall_block.py index 2598d622c1d9781c1e2f9ac3bedb00866ea1eae3..735bf1d6c57e90319adc9ec3bfa1930593f2ef56 100644 --- a/qemu/tests/migration_multi_host_firewall_block.py +++ b/qemu/tests/migration_multi_host_firewall_block.py @@ -39,7 +39,7 @@ def run(test, params, env): ret = s.get("migrated") == "true" o = vm.monitor.info("migrate") if isinstance(o, str): - return ret and (not "status: active" in o) + return ret and ("status: active" not in o) else: return ret and (o.get("status") != "active") diff --git a/qemu/tests/migration_multi_host_timedrift.py b/qemu/tests/migration_multi_host_timedrift.py index d27e78a7f15bac0bc523c0a85a0220a38a5eb546..579a13beaae370dc41b4c614fe4fd0a98f271e8b 100644 --- a/qemu/tests/migration_multi_host_timedrift.py +++ b/qemu/tests/migration_multi_host_timedrift.py @@ -61,7 +61,7 @@ def run(test, params, env): self.time_filter_re, self.time_format) session.cmd(self.create_file) - if not vm.name in self.start_ht.keys(): + if vm.name not in self.start_ht.keys(): (self.start_ht[vm.name], self.start_gt[vm.name]) = (ht, gt) if abs(ht - gt) > self.diff_limit: logging.warning("Host and %s time diff %s is greater " diff --git a/qemu/tests/migration_multi_host_with_speed_measurement.py b/qemu/tests/migration_multi_host_with_speed_measurement.py index e1250fa067466d7c0936623d40b552e0296f1203..0c92ef1e48c232a8289c207f8a5af6fd1103d4d3 100644 --- a/qemu/tests/migration_multi_host_with_speed_measurement.py +++ b/qemu/tests/migration_multi_host_with_speed_measurement.py @@ -59,7 +59,7 @@ def run(test, params, env): fail_msg = ("Could not determine the transferred memory from" " monitor data: %s" % o) if isinstance(o, str): - if not "status: active" in o: + if "status: active" not in o: raise error.TestWarn(warning_msg) try: transfered_mem = int(get_mig_speed.search(o).groups()[0]) diff --git a/qemu/tests/migration_with_dst_problem.py b/qemu/tests/migration_with_dst_problem.py index 4ead5ff65af9f89f1b5dcffac140bbc91fa874ae..111d55d2bd2e948a942eb575d2a040f5379b3053 100644 --- a/qemu/tests/migration_with_dst_problem.py +++ b/qemu/tests/migration_with_dst_problem.py @@ -260,7 +260,7 @@ def run(test, params, env): session.cmd("dd if=/dev/zero of=%s bs=1M count=%s" % (disk_path, disk_size)) status, output = session.cmd_status_output("setenforce 0") - if not status in [0, 127]: + if status not in [0, 127]: logging.warn("Function setenforce fails.\n %s" % (output)) config = self.config % (self.server_name, disk_path, diff --git a/qemu/tests/migration_with_speed_measurement.py b/qemu/tests/migration_with_speed_measurement.py index 7431bd22ccee19a957d28c514180822c81e5f711..ebc6e11bf012707cbb53e2f98d36f1d7450ac366 100644 --- a/qemu/tests/migration_with_speed_measurement.py +++ b/qemu/tests/migration_with_speed_measurement.py @@ -56,7 +56,7 @@ def run(test, params, env): fail_msg = ("Could not determine the transferred memory from" " monitor data: %s" % o) if isinstance(o, str): - if not "status: active" in o: + if "status: active" not in o: raise error.TestWarn(warning_msg) try: transfered_mem = int(get_mig_speed.search(o).groups()[0]) diff --git a/qemu/tests/mq_change_qnum.py b/qemu/tests/mq_change_qnum.py index 1651a9bf05a5ab85f5e871c1d006c834cf7c822b..6145baed9cd341803d356b790c58b8481a5e587f 100644 --- a/qemu/tests/mq_change_qnum.py +++ b/qemu/tests/mq_change_qnum.py @@ -96,7 +96,7 @@ def run(test, params, env): error.context("Change queues number repeatly", logging.info) repeat_counts = int(params.get("repeat_counts", 10)) for nic_index, nic in enumerate(vm.virtnet): - if not "virtio" in nic['nic_model']: + if "virtio" not in nic['nic_model']: continue queues = int(vm.virtnet[nic_index].queues) if queues == 1: diff --git a/qemu/tests/pci_hotplug.py b/qemu/tests/pci_hotplug.py index 253e605b3655bec69d478c6a627985c7a319454b..b082f2474042bb042024420bf521852b5d9bf765 100644 --- a/qemu/tests/pci_hotplug.py +++ b/qemu/tests/pci_hotplug.py @@ -44,7 +44,7 @@ def run(test, params, env): add_output = vm.monitor.send_args_cmd(pci_add_cmd, convert=False) pci_info.append(['', '', add_output, pci_model]) - if not "OK domain" in add_output: + if "OK domain" not in add_output: raise error.TestFail("Add PCI device failed. " "Monitor command is: %s, Output: %r" % (pci_add_cmd, add_output)) diff --git a/qemu/tests/pci_hotplug_check.py b/qemu/tests/pci_hotplug_check.py index c085b6ef502043efec164a21eec3bc796b4043c1..4bc3bfc3c53a039f2e4a08abe65c7db753955d46 100644 --- a/qemu/tests/pci_hotplug_check.py +++ b/qemu/tests/pci_hotplug_check.py @@ -86,7 +86,7 @@ def run(test, params, env): add_output = vm.monitor.send_args_cmd(pci_add_cmd, convert=False) guest_device = find_new_device(chk_cmd, guest_devices) pci_info.append(['', '', add_output, pci_model, guest_device]) - if not "OK domain" in add_output: + if "OK domain" not in add_output: raise error.TestFail("Add PCI device failed. " "Monitor command is: %s, Output: %r" % (pci_add_cmd, add_output)) diff --git a/qemu/tests/physical_resources_check.py b/qemu/tests/physical_resources_check.py index df6a5a72d527ed33f47869543b4eae19f104b115..1e909f54ca285017460aa6301475d58d512daad9 100644 --- a/qemu/tests/physical_resources_check.py +++ b/qemu/tests/physical_resources_check.py @@ -271,7 +271,7 @@ def run(test, params, env): if expected_vendor_id and cpu_vendor_id_chk_cmd: output = session.cmd_output(cpu_vendor_id_chk_cmd) - if not expected_vendor_id in output: + if expected_vendor_id not in output: fail_log = "CPU vendor id check failed.\n" fail_log += " Assigned to VM: '%s'\n" % expected_vendor_id fail_log += " Reported by OS: '%s'" % output @@ -333,7 +333,7 @@ def run(test, params, env): num_nics = len(params.objects("nics")) for nic_index in range(num_nics): mac = vm.get_mac_address(nic_index) - if not string.lower(mac) in found_mac_addresses: + if string.lower(mac) not in found_mac_addresses: fail_log = "MAC address mismatch:\n" fail_log += " Assigned to VM (not found): %s" % mac n_fail.append(fail_log) diff --git a/qemu/tests/qemu_img.py b/qemu/tests/qemu_img.py index 98fc7e307edec8f354af512ba6a90218e2c41f0c..58b6738b6f7a0682f2eabf69d027174ae36df9d9 100644 --- a/qemu/tests/qemu_img.py +++ b/qemu/tests/qemu_img.py @@ -240,10 +240,10 @@ def run(test, params, env): """ img_info = _info(cmd, image_name) logging.info("Info of image '%s':\n%s", image_name, img_info) - if not image_format in img_info: + if image_format not in img_info: raise error.TestFail("Got unexpected format of image '%s'" " in info test" % image_name) - if not image_size in img_info: + if image_size not in img_info: raise error.TestFail("Got unexpected size of image '%s'" " in info test" % image_name) @@ -424,7 +424,7 @@ def run(test, params, env): :param cmd: qemu-img base command. """ - if not 'rebase' in utils.system_output(cmd + ' --help', + if 'rebase' not in utils.system_output(cmd + ' --help', ignore_status=True): raise error.TestNAError("Current kvm user space version does not" " support 'rebase' subcommand") @@ -453,7 +453,7 @@ def run(test, params, env): # Check sn2's format and backing_file actual_base_img = _info(cmd, sn2, "backing file") base_img_name = os.path.basename(base_img) - if not base_img_name in actual_base_img: + if base_img_name not in actual_base_img: raise error.TestFail("After rebase the backing_file of 'sn2' is " "'%s' which is not expected as '%s'" % (actual_base_img, base_img_name)) diff --git a/qemu/tests/qmp_basic.py b/qemu/tests/qmp_basic.py index 95f882945e0c039888588ad6c219ac04cb9fd566..06d7bbb84b50b70a298dc156166437b2319a87df 100644 --- a/qemu/tests/qmp_basic.py +++ b/qemu/tests/qmp_basic.py @@ -34,7 +34,7 @@ def run(test, params, env): if not isinstance(qmp_dict, dict): raise error.TestFail("qmp_dict is not a dict (it's '%s')" % type(qmp_dict)) - if not key in qmp_dict: + if key not in qmp_dict: raise error.TestFail("'%s' key doesn't exist in dict ('%s')" % (key, str(qmp_dict))) diff --git a/qemu/tests/qmp_basic_rhel6.py b/qemu/tests/qmp_basic_rhel6.py index 8fa39ba41009f27ec3922e604cbca2cffb779ca5..9b39467ffcca2b5ddfe707dcf7cea1430f64316a 100644 --- a/qemu/tests/qmp_basic_rhel6.py +++ b/qemu/tests/qmp_basic_rhel6.py @@ -35,7 +35,7 @@ def run(test, params, env): if not isinstance(qmp_dict, dict): raise error.TestFail("qmp_dict is not a dict (it's '%s')" % type(qmp_dict)) - if not key in qmp_dict: + if key not in qmp_dict: raise error.TestFail("'%s' key doesn't exist in dict ('%s')" % (key, str(qmp_dict))) diff --git a/qemu/tests/rv_input.py b/qemu/tests/rv_input.py index 22b6757ad7f11bea5196c4ef1a336284612eed96..609364e5eb2106de03c52858dd68f52de2cbf92b 100644 --- a/qemu/tests/rv_input.py +++ b/qemu/tests/rv_input.py @@ -94,7 +94,7 @@ def test_type_and_func_keys(client_vm, guest_session, params): logging.info("Sending typewriter and functional keys to client machine") for i in range(1, 69): # Avoid Ctrl, RSH, LSH, PtScr, Alt, CpsLk - if not (i in [29, 42, 54, 55, 56, 58]): + if i not in [29, 42, 54, 55, 56, 58]: client_vm.send_key(str(hex(i))) utils_spice.wait_timeout(0.3) diff --git a/qemu/tests/rv_smartcard.py b/qemu/tests/rv_smartcard.py index 32f638817437ae3470fe991bb06ae9379e32ede1..82db05dd0a8ed74f9088efaf5425d5b22b788055 100644 --- a/qemu/tests/rv_smartcard.py +++ b/qemu/tests/rv_smartcard.py @@ -84,8 +84,8 @@ def run(test, params, env): raise error.TestFail("Certificate %s was not found as a listed" " cert in the guest" % subj_string) elif smartcard_testtype == "pklogin_finder": - # pkcs11_listcerts not installed until - # Smart Card Support is installed + # pkcs11_listcerts not installed until + # Smart Card Support is installed try: certsinfo_output = guest_session.cmd("pklogin_finder debug") except aexpect.ShellTimeoutError: diff --git a/qemu/tests/sr_iov_hotplug.py b/qemu/tests/sr_iov_hotplug.py index f57a6b0878ac98bd4a40120142b89d3aee65dd72..c9260ed471fb56e67af6631d0cf14477639fdde5 100644 --- a/qemu/tests/sr_iov_hotplug.py +++ b/qemu/tests/sr_iov_hotplug.py @@ -51,7 +51,7 @@ def run(test, params, env): error.context("Adding pci device with command 'pci_add'") add_output = vm.monitor.send_args_cmd(pci_add_cmd, convert=False) pci_info.append(['', add_output]) - if not "OK domain" in add_output: + if "OK domain" not in add_output: raise error.TestFail("Add PCI device failed. " "Monitor command is: %s, Output: %r" % (pci_add_cmd, add_output)) diff --git a/qemu/tests/timedrift_adjust_time.py b/qemu/tests/timedrift_adjust_time.py index 0b0f26de1711d0d197caac7ff16f91ee9608224f..54bed783ff3b8f64c6e066ac0bd6de8c76157e91 100644 --- a/qemu/tests/timedrift_adjust_time.py +++ b/qemu/tests/timedrift_adjust_time.py @@ -149,7 +149,7 @@ class TimedriftTest(object): read_clock_cmd = "cat /sys/devices/system/clocksource/" read_clock_cmd += "clocksource0/current_clocksource" current_clocksource = session.cmd_output(read_clock_cmd) - if not clock_source in current_clocksource: + if clock_source not in current_clocksource: raise error.TestFail("Guest didn't use'%s'" % clock_source + "clocksource, current clocksoure " + "is %s;" % current_clocksource) diff --git a/qemu/tests/timedrift_no_net.py b/qemu/tests/timedrift_no_net.py index 0dd05aa79fcde365f359f34e18165326a5d8d7de..fcd64f92b33d91ad6f282556b2c76cdc530547ee 100644 --- a/qemu/tests/timedrift_no_net.py +++ b/qemu/tests/timedrift_no_net.py @@ -120,7 +120,7 @@ def run(test, params, env): session = vm.wait_for_serial_login(timeout=login_timeout) out = session.cmd_output("cat /sys/devices/system/clocksource/" "clocksource0/current_clocksource") - if not guest_clock_source in out: + if guest_clock_source not in out: raise error.TestFail("Clock source %s missing in guest clock " "sources %s." % (guest_clock_source, out)) diff --git a/qemu/tests/timerdevice_boot.py b/qemu/tests/timerdevice_boot.py index 5bf21175a4f7726b0831928123e20bf3a0e5c0ed..159f464384017629c5d518fa169fd5b16aeeabc0 100644 --- a/qemu/tests/timerdevice_boot.py +++ b/qemu/tests/timerdevice_boot.py @@ -32,7 +32,7 @@ def run(test, params, env): error.context("Check the current clocksource in guest", logging.info) cmd = "cat /sys/devices/system/clocksource/" cmd += "clocksource0/current_clocksource" - if not expected in session.cmd(cmd): + if expected not in session.cmd(cmd): raise error.TestFail( "Guest didn't use '%s' clocksource" % expected) diff --git a/qemu/tests/timerdevice_change_guest_clksource.py b/qemu/tests/timerdevice_change_guest_clksource.py index 5e83add6c5b7e02a3aa8eef691b60326393e06c2..5be7928a95dc0b4c748b912b63bf5a006f692b68 100644 --- a/qemu/tests/timerdevice_change_guest_clksource.py +++ b/qemu/tests/timerdevice_change_guest_clksource.py @@ -24,7 +24,7 @@ def run(test, params, env): error.context("Check the current clocksource in guest", logging.info) cmd = "cat /sys/devices/system/clocksource/" cmd += "clocksource0/current_clocksource" - if not expected in session.cmd(cmd): + if expected not in session.cmd(cmd): raise error.TestFail( "Guest didn't use '%s' clocksource" % expected) @@ -38,7 +38,7 @@ def run(test, params, env): error.context("Check the current clocksource in guest", logging.info) cmd = "cat /sys/devices/system/clocksource/" cmd += "clocksource0/current_clocksource" - if not "kvm-clock" in session.cmd(cmd): + if "kvm-clock" not in session.cmd(cmd): grub_file = params.get("grub_file", "/boot/grub2/grub.cfg") if "clocksource=" not in session.cmd("cat %s" % grub_file): raise error.TestFail("Guest didn't use 'kvm-clock' clocksource") diff --git a/qemu/tests/timerdevice_clock_drift_with_ntp.py b/qemu/tests/timerdevice_clock_drift_with_ntp.py index d6a3de2b737c41a999184db57a942c60b33b5f24..c63e43853a8ebf7df32680d9171b18643f2935d6 100644 --- a/qemu/tests/timerdevice_clock_drift_with_ntp.py +++ b/qemu/tests/timerdevice_clock_drift_with_ntp.py @@ -36,7 +36,7 @@ def run(test, params, env): error.context("Check for an appropriate clocksource on host", logging.info) host_cmd = "cat /sys/devices/system/clocksource/" host_cmd += "clocksource0/current_clocksource" - if not "tsc" in utils.system_output(host_cmd): + if "tsc" not in utils.system_output(host_cmd): raise error.TestNAError("Host must use 'tsc' clocksource") error.context("Boot the guest", logging.info) diff --git a/qemu/tests/timerdevice_clock_drift_with_sleep.py b/qemu/tests/timerdevice_clock_drift_with_sleep.py index 4548bc14e14e9e282bf6dc4a98394801e4f01cfd..d0c000029c745cf5187a5725a56fa86223171e8f 100644 --- a/qemu/tests/timerdevice_clock_drift_with_sleep.py +++ b/qemu/tests/timerdevice_clock_drift_with_sleep.py @@ -53,7 +53,7 @@ def run(test, params, env): logging.info) cmd = "cat /sys/devices/system/clocksource/" cmd += "clocksource0/current_clocksource" - if not "kvm-clock" in session.cmd(cmd): + if "kvm-clock" not in session.cmd(cmd): grub_file = params.get("grub_file", "/boot/grub2/grub.cfg") if "clocksource=" not in session.cmd("cat %s" % grub_file): raise error.TestFail("Guest didn't use 'kvm-clock' clocksource") diff --git a/qemu/tests/timerdevice_tscsync_change_host_clksource.py b/qemu/tests/timerdevice_tscsync_change_host_clksource.py index d4a94a0f752f34cb7564c1827b197c21c754eb46..8ea018d324f7313e285a48b5e2b1bc447ff6f24e 100644 --- a/qemu/tests/timerdevice_tscsync_change_host_clksource.py +++ b/qemu/tests/timerdevice_tscsync_change_host_clksource.py @@ -27,7 +27,7 @@ def run(test, params, env): error.context("Check for an appropriate clocksource on host", logging.info) host_cmd = "cat /sys/devices/system/clocksource/" host_cmd += "clocksource0/current_clocksource" - if not "tsc" in utils.system_output(host_cmd): + if "tsc" not in utils.system_output(host_cmd): raise error.TestNAError("Host must use 'tsc' clocksource") error.context("Boot the guest with one cpu socket", logging.info) @@ -40,7 +40,7 @@ def run(test, params, env): error.context("Check the guest is using vsyscall", logging.info) date_cmd = "strace date 2>&1|egrep 'clock_gettime|gettimeofday'|wc -l" output = session.cmd(date_cmd) - if not '0' in output: + if '0' not in output: raise error.TestFail("Failed to check vsyscall. Output: '%s'" % output) error.context("Copy time-warp-test.c to guest", logging.info) @@ -99,7 +99,7 @@ def run(test, params, env): " Output (last 5 lines): '%s'" % msg) output = session.cmd(date_cmd) - if not "1" in output: + if "1" not in output: raise error.TestFail("Failed to check vsyscall." " Output: '%s'" % output) finally: diff --git a/qemu/tests/timerdevice_tscsync_longtime.py b/qemu/tests/timerdevice_tscsync_longtime.py index 47cc6594c4a27887293c0df6fb9c74e02f9c624d..b9ea37d1402fc57e0eef2b964218f1c9783ec7be 100644 --- a/qemu/tests/timerdevice_tscsync_longtime.py +++ b/qemu/tests/timerdevice_tscsync_longtime.py @@ -25,7 +25,7 @@ def run(test, params, env): error.context("Check for an appropriate clocksource on host", logging.info) host_cmd = "cat /sys/devices/system/clocksource/" host_cmd += "clocksource0/current_clocksource" - if not "tsc" in utils.system_output(host_cmd): + if "tsc" not in utils.system_output(host_cmd): raise error.TestNAError("Host must use 'tsc' clocksource") error.context("Check host has more than one cpu socket", logging.info) diff --git a/qemu/tests/timerdevice_tscwrite.py b/qemu/tests/timerdevice_tscwrite.py index c7d3a3f292c5a89e3341d7c29847af7abf0e1954..b897d4bb53f99b5272d51fb7a87e6209f7048b47 100644 --- a/qemu/tests/timerdevice_tscwrite.py +++ b/qemu/tests/timerdevice_tscwrite.py @@ -20,7 +20,7 @@ def run(test, params, env): error.context("Check for an appropriate clocksource on host", logging.info) host_cmd = "cat /sys/devices/system/clocksource/" host_cmd += "clocksource0/current_clocksource" - if not "tsc" in utils.system_output(host_cmd): + if "tsc" not in utils.system_output(host_cmd): raise error.TestNAError("Host must use 'tsc' clocksource") error.context("Boot the guest", logging.info) @@ -40,7 +40,7 @@ def run(test, params, env): date_cmd = "strace date 2>&1 | egrep 'clock_gettime|gettimeofday' | wc -l" output = session.cmd(date_cmd) - if not '0' in output: + if '0' not in output: raise error.TestFail("Test failed before run msr tools." " Output: '%s'" % output) @@ -51,6 +51,6 @@ def run(test, params, env): session.cmd(cmd) output = session.cmd(date_cmd) - if not "1" in output: + if "1" not in output: raise error.TestFail("Test failed after run msr tools." " Output: '%s'" % output) diff --git a/qemu/tests/usb_storage.py b/qemu/tests/usb_storage.py index f96c954a5fafc95a879893d5b86704317eb1efb8..b39bfec12e77e8d1c3c22643cc386d3a20f81efa 100644 --- a/qemu/tests/usb_storage.py +++ b/qemu/tests/usb_storage.py @@ -115,7 +115,7 @@ def run(test, params, env): error.context("Check serial option in guest", logging.info) session = _login() output = session.cmd("lsusb -v") - if not ("EMPTY_STRING" in serial or "NO_EQUAL_STRING" in serial): + if "EMPTY_STRING" not in serial or "NO_EQUAL_STRING" not in serial: # Verify in guest when serial is set to empty/null is meaningless. _verify_string(serial, output, [serial]) _do_io_test_guest(session)