Thread (6 messages) 6 messages, 2 authors, 2021-08-06

Re: [rteval PATCH] rteval: stressng.py: Fix argument passing to Popen

From: Atsushi Nemoto <hidden>
Date: 2021-08-06 08:45:21

On Fri, 30 Jul 2021 13:35:08 +0900 (JST), Atsushi Nemoto [off-list ref] wrote:
quoted
If you want for example to run the stress-ng memcpy test with an argument 
of N=8 for 8 workers with a timeout of ten seconds you do this

rteval -d1m --loads-cpulist='0-4' --stressng-option=memcpy 
--stressng-arg=8 --stressng-timeout=10

which will result in rteval running the following command
stress-ng --memcpy 8 --timeout 10 --taskset 0,1,2,3,4
In this case, the self.args will be:

	["stress-ng", "--memcpy", "8", "--timeout 10", "--taskset 0,1,2,3,4"]

and will cause "stress-ng: unrecognized option '--timeout 10'" error.

If "shell=True" is not acceptable, how about this?

    self.process = subprocess.Popen(" ".join(self.args).split(),
Instead of this, spliting "--timeout 10" to ["--timeout", "10"] would
be better?

I will post another patch.

---
Atsushi Nemoto
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help