summaryrefslogtreecommitdiff
diff options
authorUbuntu <ubuntu@cert-jenkins-slave-1-201406-15260.maas>2022-08-01 21:55:28 +0000
committerUbuntu <ubuntu@cert-jenkins-slave-1-201406-15260.maas>2022-08-01 21:55:28 +0000
commit6486c39d11c212debb5e23541815b7cb8f7ab868 (patch)
tree89f2e0d0a9e839a435b9229854139bd201198bdf
parent2da795f3a5a890b8f254872883fd1122c655b26a (diff)
parentbd00efd9c35c6582fdf40b0416ddd5962af65117 (diff)
Merge #427635 from ~bladernr/plainbox-provider-checkbox:1983122-fix-thread_count-stress-ng
Fixes a couple bugs with "thread_count" on stressors
-rwxr-xr-xbin/stress_ng_test.py12
1 files changed, 7 insertions, 5 deletions
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...".