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

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
ftests/036-cgset-multi_thread.py

index 592ed9b3a6afcb6c40010e2fce08337dc179ee7b..a38b6647cc0237d9a0e2a640add24775085d5a7b 100755 (executable)
@@ -35,22 +35,24 @@ SETTING = 'cgroup.type'
 AFTER = 'threaded'
 THREADS = 3
 
+
 def prereqs(config):
     result = consts.TEST_PASSED
     cause = None
 
     if config.args.container:
         result = consts.TEST_SKIPPED
-        cause = "This test cannot be run within a container"
+        cause = 'This test cannot be run within a container'
         return result, cause
 
     if CgroupVersion.get_version(CONTROLLER) != CgroupVersion.CGROUP_V2:
         result = consts.TEST_SKIPPED
-        cause = "This test requires the cgroup v2"
+        cause = 'This test requires the cgroup v2'
         return result, cause
 
     return result, cause
 
+
 def setup(config):
     Cgroup.create(config, CONTROLLER, PARENT_CGNAME)
     Cgroup.create(config, CONTROLLER, CHILD_CGPATH)
@@ -59,22 +61,24 @@ def setup(config):
 
     return consts.TEST_PASSED, None
 
+
 def test(config):
     config.process.create_threaded_process_in_cgroup(
                                 config, CONTROLLER, PARENT_CGNAME, THREADS)
 
     threads = Cgroup.get(config, controller=None, cgname=PARENT_CGNAME,
-                         setting="cgroup.threads", print_headers=False,
+                         setting='cgroup.threads', print_headers=False,
                          values_only=True)
     threads = threads.replace('\n', '').split('\t')
 
-    #pick the first thread
+#   #pick the first thread
     thread_tid = threads[1]
 
-    Cgroup.set_and_validate(config, CHILD_CGPATH, "cgroup.threads", thread_tid)
+    Cgroup.set_and_validate(config, CHILD_CGPATH, 'cgroup.threads', thread_tid)
 
     return consts.TEST_PASSED, None
 
+
 def teardown(config):
     # destroy the child processes
     pids = Cgroup.get_pids_in_cgroup(config, PARENT_CGNAME, CONTROLLER)
@@ -84,6 +88,7 @@ def teardown(config):
 
     Cgroup.delete(config, CONTROLLER, PARENT_CGNAME, recursive=True)
 
+
 def main(config):
     [result, cause] = prereqs(config)
     if result != consts.TEST_PASSED:
@@ -97,6 +102,7 @@ def main(config):
 
     return [result, cause]
 
+
 if __name__ == '__main__':
     config = ftests.parse_args()
     # this test was invoked directly.  run only it