Re: [PATCH 31/50] tests: Modify kernel test sets for python3

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

 



On Mon, 2019-01-28 at 17:11 +0900, Masashi Honma wrote:
> On 2019/01/25 19:33, Johannes Berg wrote:
> > Same here, we could just have hapd.request() take bytes (it makes sense
> > anyway when communicating with another process!) and then the .decode()
> > isn't needed, you just have to add a b"" to the string.
> 
> I think it is not so good.
> 
> If I modify the hapd.request(), I need to modify wpa_suppcant.request() also
> to avoid confusion. Now, almost test cases expects string for 
> wpa_suppcant.request() argument.
> So, much more modification will be needed.
> For example, to pass the ap_eap test we needs 400+ modifications.

Ok, that's no fun.

However, why not make them take both? We can always assume bytes inside
the function, and do something like

if isinstance(query, str):
    query = query.encode('ascii')

That way, tests that actually just use plain arguments need no
modifications at all, but tests that deal with binascii or similar
things that takes bytes can be converted completely to bytes and not
have .decode()/.encode() sprinkled over them.

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