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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2 April 2016 at 20:32, Johannes Berg <johannes@xxxxxxxxxxxxxxxx> wrote:
> 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.
>
I decide to not fix all problems in one patchset - to much changes.
First I added hwsim_wrapper() for remote test execution with current
hwsim test cases. After that I can fix test cases one by one.

Regarding host.execute(), this using subprocess.check_output( ..., shell=False)
Anyway I think this is possible to get list and build string in Host()
class for ssh case. while
for local_execute() and execute(host=None) I split command back to the list.

BR
Janusz

> johannes

_______________________________________________
Hostap mailing list
Hostap@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/hostap



[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux