提交 bebdbba4 编写于 作者: C cuixucui

Modify static method

上级 050833aa
......@@ -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:
......
......@@ -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:
......
......@@ -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:
......
......@@ -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:
......
......@@ -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
......
......@@ -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:
......
......@@ -23,8 +23,7 @@ class ClockTest(Test):
"""
Clock Test
"""
@staticmethod
def test():
def test(self):
"""
Clock test case
:return:
......
......@@ -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:
......
......@@ -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:
......
......@@ -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:
......
......@@ -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:
......
......@@ -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:
......
......@@ -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:
......
......@@ -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:
......
......@@ -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:
......
......@@ -65,8 +65,7 @@ class WatchDogTest(Test):
print("")
return False
@staticmethod
def startup():
def startup(self):
"""
Initialization before test
:return:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册