NUS-SNL / p4-traffictool

p4-traffictool helps in packet generation, parsing and dissection for popular backends
MIT License
40 stars 10 forks source link

p4-traffictool cannot generate scapy code #38

Closed Xiangpeng-Sun closed 3 years ago

Xiangpeng-Sun commented 4 years ago

Our team try to introduce p4-traffictool into our p4 traffic test unit. However, when we try to use p4-traffictool to generate scapy code base on our p4 code, the tool says it cannot generate scapy. image

Seems like this is an IOError in GenTrafficScapy.py, so I add traceback func in that part of code and get this image

Looks like it try to open a temp file, but turns out some wrong happened, I think it is caused by DESTINATION variable received wrong value? https://github.com/NUS-SNL/p4-traffictool/blob/b0c0ce25a0b1e0f6157ce9dcd9a02c883a936311/p4-traffictool.sh#L214-L218 https://github.com/NUS-SNL/p4-traffictool/blob/b0c0ce25a0b1e0f6157ce9dcd9a02c883a936311/src/GenTrafficScapy.py#L16-L18 https://github.com/NUS-SNL/p4-traffictool/blob/b0c0ce25a0b1e0f6157ce9dcd9a02c883a936311/src/GenTrafficScapy.py#L588

image

rhl-bthr commented 4 years ago

Hi @Xiangpeng-Sun. Thanks for reporting the issue.

Looks like you're using a 'different p4c' which does not generate the bmv2 json file as required by p4-traffictool