diff --git a/hwcompatible/commandUI.py b/hwcompatible/commandUI.py index bf83692e7e787d8973b9cf5d0594bf42fad0663b..9fb055d4ab3c836c2fd47e64eeffc7af5bdea8ad 100755 --- a/hwcompatible/commandUI.py +++ b/hwcompatible/commandUI.py @@ -98,8 +98,7 @@ class CommandUI(object): return False sys.stdout.write("Please reply %s or %s.\n" % (YES, NO)) - @staticmethod - def prompt_edit(label, value, choices=None): + def prompt_edit(self, label, value, choices=None): """ prompt choice edit :param label: diff --git a/hwcompatible/compatibility.py b/hwcompatible/compatibility.py index 6492cac3a80ee880bb58d86ee2e906cebb2561d5..00cc9dd2c0ec191ef522d2639b5b6ccf3d74086e 100755 --- a/hwcompatible/compatibility.py +++ b/hwcompatible/compatibility.py @@ -461,8 +461,7 @@ class EulerCertification(object): self.test_factory.sort(key=lambda k: k["name"]) FactoryDocument(CertEnv.factoryfile, self.test_factory).save() - @staticmethod - def search_factory(obj_test, test_factory): + def search_factory(self, obj_test, test_factory): """ Determine whether test exists by searching test_factory :param obj_test: diff --git a/hwcompatible/device.py b/hwcompatible/device.py index 2ee2ac57168d699ee8cca0fda0c5d48cd2bfcc13..1b1102698ad84240497b906d947fdf4ad2528c45 100755 --- a/hwcompatible/device.py +++ b/hwcompatible/device.py @@ -63,8 +63,8 @@ class CertDevice(object): else: prop = line.split(":", 1) if len(prop) == 2: - tp = prop[0].strip(r'\ \'\n') - attribute = prop[1].strip(r'\ \'\n') + tp = prop[0].strip('\ \'\n') + attribute = prop[1].strip('\ \'\n') if tp == "E": keyvalue = attribute.split("=", 1) if len(keyvalue) == 2: diff --git a/hwcompatible/job.py b/hwcompatible/job.py index 008998491ab4855617e02b6eb8fb61fcdf005f89..90c4170b2f64108b7a6e5d54350d7c63231e5c39 100755 --- a/hwcompatible/job.py +++ b/hwcompatible/job.py @@ -51,8 +51,7 @@ class Job(object): for parameter_name, parameter_value in self.args.test_parameters: self.test_parameters[parameter_name] = parameter_value - @staticmethod - def discover(testname, subtests_filter=None): + def discover(self, testname, subtests_filter=None): """ discover test :param testname: diff --git a/tests/acpi/acpi.py b/tests/acpi/acpi.py index 17cc752dc3e780ab6b4aa44e4a4a9de1980e5640..f267210964c6a631bb9fe4cdd7f8f293a502bf5c 100755 --- a/tests/acpi/acpi.py +++ b/tests/acpi/acpi.py @@ -24,8 +24,7 @@ class AcpiTest(Test): Test.__init__(self) self.requirements = ["acpica-tools"] - @staticmethod - def test(): + def test(self): try: Command("acpidump").echo() return True diff --git a/tests/cdrom/cdrom.py b/tests/cdrom/cdrom.py index 967b1beb1dc69403b2aae4f29a9fc1371887ba2d..37e7f0e073b09a0a6de414b6c4169aa7261c60ee 100755 --- a/tests/cdrom/cdrom.py +++ b/tests/cdrom/cdrom.py @@ -77,8 +77,7 @@ class CDRomTest(Test): return False return True - @staticmethod - def get_type(device): + def get_type(self, device): """ Get the type of CDROM :param device: @@ -234,8 +233,7 @@ class CDRomTest(Test): print(e) return False - @staticmethod - def cmp_tree(dir1, dir2): + def cmp_tree(self, dir1, dir2): """ Compare the differences between the two directories :param dir1: diff --git a/tests/clock/clock.py b/tests/clock/clock.py index d0c20f9f902f42f4decb0bd32bbfdd58ce95d802..df5a1c99cd64b314d6b1d9c6b85d5efb78fb49bd 100755 --- a/tests/clock/clock.py +++ b/tests/clock/clock.py @@ -23,8 +23,7 @@ class ClockTest(Test): """ Clock Test """ - @staticmethod - def test(): + def test(self): """ Clock test case :return: diff --git a/tests/cpufreq/cpufreq.py b/tests/cpufreq/cpufreq.py index 4d1de9f9d2f8ad39837786f4f5b7957430d8f845..66bc8da7db846b3029ec430ee5f7122b20d9e1d7 100644 --- a/tests/cpufreq/cpufreq.py +++ b/tests/cpufreq/cpufreq.py @@ -63,8 +63,7 @@ class CPU(object): return True - @staticmethod - def set_freq(freq, cpu='all'): + def set_freq(self, freq, cpu='all'): """ Set CPU frequency :param freq: @@ -79,8 +78,7 @@ class CPU(object): print(e) return False - @staticmethod - def get_freq(cpu): + def get_freq(self, cpu): """ Get CPU frequency :param cpu: @@ -93,8 +91,7 @@ class CPU(object): print(e) return False - @staticmethod - def set_governor(governor, cpu='all'): + def set_governor(self, governor, cpu='all'): """ Set the frequency governor mode of CPU :param governor: @@ -109,8 +106,7 @@ class CPU(object): print(e) return False - @staticmethod - def get_governor(cpu): + def get_governor(self, cpu): """ Get cpu governor :param cpu: @@ -123,8 +119,7 @@ class CPU(object): print(e) return False - @staticmethod - def find_path(parent_dir, target_name): + def find_path(self, parent_dir, target_name): """ Find the target path from the specified directory :param parent_dir: diff --git a/tests/disk/disk.py b/tests/disk/disk.py index 3bb7682aea62b712e0aeb0aaa0202e882bd013ea..d561a41cf999500a7ccd65bac59067d96f9372c0 100755 --- a/tests/disk/disk.py +++ b/tests/disk/disk.py @@ -207,8 +207,7 @@ class DiskTest(Test): print("#############") return return_code - @staticmethod - def do_fio(filepath, size, option): + def do_fio(self, filepath, size, option): if os.path.isdir(filepath): file_opt = "-directory=%s" % filepath else: diff --git a/tests/ipmi/ipmi.py b/tests/ipmi/ipmi.py index 5f8fa314893bc3b3369b8a5eec2b4a5d8ca42272..c336d35258bd8885f0136e9080da7f1308a7c4c3 100755 --- a/tests/ipmi/ipmi.py +++ b/tests/ipmi/ipmi.py @@ -24,8 +24,7 @@ class IpmiTest(Test): Test.__init__(self) self.requirements = ["OpenIPMI", "ipmitool"] - @staticmethod - def start_ipmi(): + def start_ipmi(self): """ Start IPMI test :return: @@ -38,8 +37,7 @@ class IpmiTest(Test): return False return True - @staticmethod - def ipmitool(): + def ipmitool(self): """ Testing with iptool tools :return: diff --git a/tests/memory/memory.py b/tests/memory/memory.py index 89f515d8e5a4c95b24c342f53b1e1411021adfe3..8f6422143457a4f9b99e590f7e585d2b616c7bba 100755 --- a/tests/memory/memory.py +++ b/tests/memory/memory.py @@ -186,8 +186,7 @@ class MemoryTest(Test): return False return True - @staticmethod - def hot_plug_verify(): + def hot_plug_verify(self): """ Verify hot plug :return: @@ -232,8 +231,7 @@ class MemoryTest(Test): if total_mem_3 != total_mem_1: return False - @staticmethod - def online_memory(memory_path): + def online_memory(self, memory_path): """ Set memory online :param memory_path: @@ -247,8 +245,7 @@ class MemoryTest(Test): print("Error: fail to online %s." % memory_path) return False - @staticmethod - def offline_memory(memory_path): + def offline_memory(self, memory_path): """ Set memory offline :param memory_path: diff --git a/tests/network/network.py b/tests/network/network.py index 296e561a3cfa4bb0ba63980289de4dc7ffdbb871..ba6d6218f6c4e9d6b9cf129027ec8d96baf589bf 100755 --- a/tests/network/network.py +++ b/tests/network/network.py @@ -50,8 +50,7 @@ class NetworkTest(Test): self.target_bandwidth_percent = 0.8 self.testfile = 'testfile' - @staticmethod - def ifdown(interface): + def ifdown(self, interface): """ Judge whether the specified interface is closed successfully :param interface: @@ -64,8 +63,7 @@ class NetworkTest(Test): time.sleep(1) return False - @staticmethod - def ifup(interface): + def ifup(self, interface): """ Judge whether the specified interface is enabled successfully :param interface: @@ -78,8 +76,7 @@ class NetworkTest(Test): return True return False - @staticmethod - def get_other_interfaces(): + def get_other_interfaces(self): """ Get other interfaces :return: diff --git a/tests/nvme/nvme.py b/tests/nvme/nvme.py index 23ca495299652ed4a6e69c9659f22d954012923c..daf0634afe2f58c9839b891c5dd38e6cd0c1096b 100755 --- a/tests/nvme/nvme.py +++ b/tests/nvme/nvme.py @@ -86,8 +86,7 @@ class NvmeTest(Test): print(e) return False - @staticmethod - def in_use(disk): + def in_use(self, disk): """ Determine whether the swapon is in use :param disk: diff --git a/tests/system/system.py b/tests/system/system.py index 55dc1c2587d62da5787b55c91102f97ec1a67807..79677351f8e6c71f427e730aacf1abaf093eb4e4 100755 --- a/tests/system/system.py +++ b/tests/system/system.py @@ -68,8 +68,7 @@ class SystemTest(Test): return return_code - @staticmethod - def check_certrpm(): + def check_certrpm(self): """ Check installed cert package :return: @@ -168,8 +167,7 @@ class SystemTest(Test): return return_code - @staticmethod - def get_modules(sign): + def get_modules(self, sign): """ Get the module with signs character :param sign: @@ -238,8 +236,7 @@ class SystemTest(Test): print("") return True - @staticmethod - def read_abi_whitelist(whitelist): + def read_abi_whitelist(self, whitelist): """ Read abi whitelist :param whitelist: @@ -296,8 +293,7 @@ class SystemTest(Test): nm.close() return self.readSymbols(symbols) - @staticmethod - def get_modulefile(module): + def get_modulefile(self, module): """ Get module file :param module: @@ -312,8 +308,7 @@ class SystemTest(Test): print("Error: could no find module file for %s:" % module) return None - @staticmethod - def check_selinux(): + def check_selinux(self): """ check selinux :return: diff --git a/tests/usb/usb.py b/tests/usb/usb.py index 78500b7db26d237acdeb3afe5b0202d621f0b8d1..5b7c09a3ca314a4ac88c12dfbb3181858da65589 100755 --- a/tests/usb/usb.py +++ b/tests/usb/usb.py @@ -97,8 +97,7 @@ class UsbTest(Test): if self.ui.prompt_confirm("All usb sockets have been tested?"): return True - @staticmethod - def get_usb(): + def get_usb(self): """ Get usb :return: diff --git a/tests/watchdog/watchdog.py b/tests/watchdog/watchdog.py index 39548bb9c158e2b60a24aefa4c15792b51ddde5b..12ca1bbbe4c5015a4a3a0669694eb70c346dbec6 100755 --- a/tests/watchdog/watchdog.py +++ b/tests/watchdog/watchdog.py @@ -65,8 +65,7 @@ class WatchDogTest(Test): print("") return False - @staticmethod - def startup(): + def startup(self): """ Initialization before test :return: