Re: [PATCH v2 00/38] Use python3 compatible codes for hwsim tests

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

 



On Thu, Jan 31, 2019 at 05:15:39PM +0900, Masashi Honma wrote:
> This patch set modifies hwsim test to support python3 because python2 is
> deprecated from 2020. After applying this patch set, user can run hwsim
> test both python2 and python3. We can run with python3 by modifying
> run-tests.py.

Thanks, applied with number of fixes and cleanup. I ended up splitting
the patches differently to make it easier to review the changes and to
be able to pick the parts that looked correct to me. I did replace some
areas by not doing unnecessary hexlify/unhexlify conversions (i.e.,
using binary comparisons where appropriate and hex strings were more
convenient). In addition, I did more changes with wpaspy support.

> [failing tests]
> Some test cases fails. This is not because of python3, it fails with python2
> also. This is the list of the test cases.

In addition to this, it looks like number of test cases were being
skipped in your setup. Those test cases missed changes needed for
python3. I implemented those and the end result can now pass every
single test case with both python2 and python3.

While the coverage looks more or less identical, there are some
differences in particular due to the way dict iteration works. python3
ended up processing the dict entries in different order and that ended
up actually finding a real bug in the D-Bus handling.. I did not yet
check whether there could be other differences in coverage, so I left
the python2 as the default for now. Anyway, the goal from now on would
be to maintain working python3 support and likely remove that python2
default eventually.

> [known issue]
> Writing un-printable code with logger.debug() causes exception.
> This occurs only at vm environment and this does not interrupt the test.
> The test end with PASS even thought this exception.
> 
> Traceback (most recent call last):
>   File "/usr/lib/python3.6/logging/__init__.py", line 996, in emit
>     stream.write(msg)
> UnicodeEncodeError: 'ascii' codec can't encode character '\x80' in position 68: ordinal not in range(128)

It looks like the logging.FileHandler() is not able to handle these and
at least with Python 3.5.2 it did not even handle utf-8 which was a bit
surprising. I tried to get that working, but did not find any easy way
of doing so. Should try to figure out what exactly is happening here and
why utf-8 part did not work.. For non-printable-even-with-utf-8-working
cases, those should probably be filtered out by the code that generates
such output. It does not really belong in a log file that is supposed to
be text.
 
-- 
Jouni Malinen                                            PGP id EFC895FA

_______________________________________________
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