Skip to content

Error during test run: NameError: global name 'TCP' is not defined #107

@tbenjamin-pl

Description

@tbenjamin-pl

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


Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions