From bd00efd9c35c6582fdf40b0416ddd5962af65117 Mon Sep 17 00:00:00 2001 From: Jeff Lane Date: Fri, 29 Jul 2022 13:16:44 -0400 Subject: FIX: stres_ng_test.py thread_count now accurately set on ALL stressors in the list. This fixes a newly introduced bug as well as an old bug that I stumbled on while fixing this. lp: #1983122 --- bin/stress_ng_test.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'bin') diff --git a/bin/stress_ng_test.py b/bin/stress_ng_test.py index 5f3b9a5..c6a2d13 100755 --- a/bin/stress_ng_test.py +++ b/bin/stress_ng_test.py @@ -58,7 +58,7 @@ class StressNg(): stressors, wrapper_timeout, sng_timeout, - thread_count, + thread_count=0, extra_options=""): self.stressors = stressors @@ -72,13 +72,15 @@ class StressNg(): def run(self): """Run a stress-ng test, storing results in self.results.""" - stressor_list = "--" + " 0 --".join(self.stressors) + stressor_list = "--" + " {} --".format(self.thread_count).join( + self.stressors) + # LP:1983122 ensure the final stressor in the list is properly defined + stressor_list = stressor_list + " {}".format(self.thread_count) - command = "stress-ng --aggressive --verify --timeout {} {} {} {}". \ + command = "stress-ng --aggressive --verify --timeout {} {} {}". \ format(self.sng_timeout, self.extra_options, - stressor_list, - self.thread_count) + stressor_list) time_str = time.strftime("%d %b %H:%M", time.gmtime()) if len(self.stressors) == 1: print("{}: Running stress-ng {} stressor for {:.0f} seconds...". -- cgit v1.2.3