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-07-30 04:35:13

On Thu, 29 Jul 2021 19:10:37 -0400 (EDT), John Kacur [off-list ref] wrote:
On Thu, 29 Jul 2021, Atsushi Nemoto wrote:
quoted
On Wed, 28 Jul 2021 17:38:05 -0400 (EDT), John Kacur [off-list ref] wrote:
quoted
quoted
-            self.process = subprocess.Popen(self.args,
+            self.process = subprocess.Popen(" ".join(self.args), shell=True,
                                             stdout=self.__out,
                                             stderr=self.__err,
                                             stdin=self.__in)
-- 
I don't see the need to do this here and in fact there are some security 
implications to using shell=True. Is there a reason you want to do this?
I want to pass multiple options using --stressng-arg.

And also, there are elements with spaces in self.args already:
"--timeout %s" and "--taskset %s".
Running stress-ng as a load in rteval is fairly new and purposely 
contrained so far. So, you can't run multiple tests right now.
However most of what you want to do is already possible.
I just want to pass some additional option like "--memcpy-method=libc"
using stressng-arg.

    rteval --stressng-option=memcpy --stressng-arg="8 --memcpy-method=libc"
stress-ng is like any other load so you can specify the taskset like this
--loads-cpulist='0-4'

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(),

---
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