From 82092fb10b2142b3e03307c1cb411d68cb1af311 Mon Sep 17 00:00:00 2001 From: "Taihsiang Ho (tai271828)" Date: Mon, 26 Aug 2019 16:24:43 +0800 Subject: stress: support customized value over env var --- units/stress/jobs.pxu | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'units/stress') diff --git a/units/stress/jobs.pxu b/units/stress/jobs.pxu index 756d537..0c710ac 100644 --- a/units/stress/jobs.pxu +++ b/units/stress/jobs.pxu @@ -18,7 +18,15 @@ estimated_duration: 7200.0 requires: package.name == 'stress-ng' or executable.name == 'stress-ng' user: root -command: cpu_stress --runtime 7200 +command: + if [ -n "$STRESS_NG_CPU_TIME" ] + then + echo "Found STRESS_NG_CPU_TIME env var, stress_ng cpu running time is now: $STRESS_NG_CPU_TIME seconds" + cpu_stress --runtime $STRESS_NG_CPU_TIME + else + echo STRESS_NG_CPU_TIME env var is not found, stress_ng cpu running time is default value + cpu_stress --runtime 7200 + fi _summary: Stress of CPUs (very long runtime) _description: -- cgit v1.2.3