]> git.ipfire.org Git - thirdparty/libcgroup.git/commitdiff
test-018: make it PEP8 compliant
authorKamalesh Babulal <kamalesh.babulal@oracle.com>
Tue, 15 Feb 2022 07:19:24 +0000 (12:49 +0530)
committerTom Hromatka <tom.hromatka@oracle.com>
Wed, 16 Feb 2022 19:09:18 +0000 (12:09 -0700)
Make test 018-cgconfig-load_dir.py PEP-8 compliant.

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
ftests/018-cgconfig-load_dir.py

index 6c57c665b66f9c3877cd0016f5ab664244c5c8f0..6245788ebba483f6cb744b57bf8549343b943f1b 100755 (executable)
@@ -23,8 +23,8 @@
 from cgroup import Cgroup, CgroupVersion
 import consts
 import ftests
-import os
 import sys
+import os
 
 CPU_CTRL = 'cpu'
 MEMORY_CTRL = 'memory'
@@ -53,22 +53,24 @@ CONFIG_FILE = '''group
 CONFIG_FILE_DIR = os.path.join(os.getcwd(), '018cgconfig')
 CONFIG_FILE_NAME = os.path.join(CONFIG_FILE_DIR, 'cgconfig.conf')
 
+
 def prereqs(config):
     result = consts.TEST_PASSED
     cause = None
 
     if CgroupVersion.get_version('cpu') != CgroupVersion.CGROUP_V1:
         result = consts.TEST_SKIPPED
-        cause = "This test requires the cgroup v1 cpu controller"
+        cause = 'This test requires the cgroup v1 cpu controller'
         return result, cause
 
     if CgroupVersion.get_version('memory') != CgroupVersion.CGROUP_V1:
         result = consts.TEST_SKIPPED
-        cause = "This test requires the cgroup v1 memory controller"
+        cause = 'This test requires the cgroup v1 memory controller'
         return result, cause
 
     return result, cause
 
+
 def setup(config):
     os.mkdir(CONFIG_FILE_DIR)
 
@@ -76,24 +78,28 @@ def setup(config):
     f.write(CONFIG_FILE)
     f.close()
 
+
 def test(config):
     Cgroup.configparser(config, load_dir=CONFIG_FILE_DIR)
 
     Cgroup.get_and_validate(config, CGNAME, 'cpu.cfs_period_us', CFS_PERIOD)
     Cgroup.get_and_validate(config, CGNAME, 'cpu.cfs_quota_us', CFS_QUOTA)
     Cgroup.get_and_validate(config, CGNAME, 'cpu.shares', SHARES)
-    Cgroup.get_and_validate(config, CGNAME, 'memory.limit_in_bytes', LIMIT_IN_BYTES)
+    Cgroup.get_and_validate(config, CGNAME, 'memory.limit_in_bytes',
+                            LIMIT_IN_BYTES)
     Cgroup.get_and_validate(config, CGNAME, 'memory.soft_limit_in_bytes',
                             SOFT_LIMIT_IN_BYTES)
 
     return consts.TEST_PASSED, None
 
+
 def teardown(config):
     Cgroup.delete(config, CPU_CTRL, CGNAME)
     Cgroup.delete(config, MEMORY_CTRL, CGNAME)
     os.remove(CONFIG_FILE_NAME)
     os.rmdir(CONFIG_FILE_DIR)
 
+
 def main(config):
     [result, cause] = prereqs(config)
     if result != consts.TEST_PASSED:
@@ -107,6 +113,7 @@ def main(config):
 
     return [result, cause]
 
+
 if __name__ == '__main__':
     config = ftests.parse_args()
     # this test was invoked directly.  run only it