[PATCH 1/2] tests: ibss kill subprocess usage

Johannes Berg johannes at sipsolutions.net
Sat Apr 2 11:32:23 PDT 2016

On Sat, 2016-04-02 at 08:24 +0200, Janusz Dziedzic wrote:

> -    subprocess.check_call(['iw', 'dev', dev[0].ifname, 'set',
> 'type', 'adhoc'])
> -    subprocess.check_call(['iw', 'dev', dev[0].ifname, 'ibss',
> 'join',
> -                           'ibss-test', '2412', 'HT20', 'fixed-
> freq',
> -                           '02:22:33:44:55:66'])
> +    dev[0].host.execute("iw dev " + dev[0].ifname + " set type
> adhoc")
I suppose I should've seen that in some other patch in the previous
series, but can we perhaps find a way to not have to do string
manipulation here? host.execute() should probably take a list just like
subprocess.Popen() does, and execute it as such, rather than passing it
through a shell? And even if that's absolutely not possible (using
ssh?) then we should probably do string quoting in a central place in
the code.


More information about the Hostap mailing list