]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Upgrade (scapy) py2 tests to work on py3.
authorBjoern A. Zeeb <bz@FreeBSD.org>
Sat, 26 Oct 2019 21:19:55 +0000 (21:19 +0000)
committerBjoern A. Zeeb <bz@FreeBSD.org>
Sat, 26 Oct 2019 21:19:55 +0000 (21:19 +0000)
commitf0297f121aee3ff9ae6de9d445fc4a7981385d05
tree17ad3bd5b72dcb20108ee3e157009ea9bef13ccd
parentcefbdf3eaa6afa169e5ad03810ce3ed7f58111ee
Upgrade (scapy) py2 tests to work on py3.

In order to move python2 out of the test framework to avoid py2 vs. py3
confusions upgrade the remaining test cases using scapy to work with py3.
That means only one version of scapy needs to be installed in the CI system.
It also gives a path forward for testing i386 issues observed in the CI
system with some of these tests.

Fixes are:
- Use default python from environment (which is 3.x these days).
- properly ident some lines as common for the rest of the file to avoid
  errors.
- cast the calculated offset to an int as the division result is considered
  a float which is not accepted input.
- when comparing payload to a magic number make sure we always add the
  payload properly to the packet and do not try to compare string in
  the result but convert the data payload back into an integer.
- fix print formating.

Discussed with: lwhsu, kp (taking it off his todo :)
MFC after: 2 weeks
tests/sys/netpfil/common/pft_ping.py
tests/sys/netpfil/pf/CVE-2019-5597.py
tests/sys/netpfil/pf/CVE-2019-5598.py