-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error during test run: NameError: global name 'TCP' is not defined #107
Comments
I posted the following to the slack channel: I'm working on an issue I put in the tracker for switch: #107 |
I figured out the problem. https://github.com/p4lang/scapy-vxlan must be installed for this test to work. Here is a version of README.md with a fix. If someone feels like giving me access I'll put in a pull request. |
Dear all,
I have installed the switch according to the instructions in this project's README.md
When I
/mnt/NFS/switch/bmv2# ./run_tests.sh
I get an error while running the switch.L2VxlanTunnelTest
NameError: global name 'TCP' is not defined
Full output of error at end of this message. Please excuse that it is not preformatted. I don't know of an easy way to do this for large chunks of output.
When I do a grep -R over the test directories I do not see TCP defined anywhere.
I imagine it is supposed to come from one of the libraries imported, but it is hard to tell because two of the imports are of the form "from foo.bar import *"
Is this perhaps a library version conflict? I used the recommended install scripts and therefore have the correct versions of whatever has version numbers specified in those scripts.
Code version is current master: 92afb04
Ubuntu 16.04.6
Python 2.7.12
switch.L2VxlanTunnelTest ...
Cleaning state
Sending packet port 1 -> port 2 - Vxlan tunnel encap
Inner packet (192.168.10.1 -> 192.168.20.2 [id = 101])
Outer packet (10.10.10.1 -> 10.10.10.2 [vnid = 0x1234, id = 101])
ERROR
======================================================================
ERROR: switch.L2VxlanTunnelTest
Traceback (most recent call last):
File "/mnt/NFS/switch/tests/ptf-tests/pd-tests/switch.py", line 500, in runTest
udp_sport = entropy_hash(pkt1)
File "/mnt/NFS/switch/tests/ptf-tests/pd-tests/../common/utils.py", line 314, in entropy_hash
buff += str(hex(pkt[TCP].sport)[2:]).zfill(4)
NameError: global name 'TCP' is not defined
The text was updated successfully, but these errors were encountered: