sonic-net / sonic-mgmt

Configuration management examples for SONiC
Other
194 stars 712 forks source link

[Bug]: `fib/test_fib.py::test_ipinip_hash_negative` fails due to ptf_runner not specifying `is_python3=True` #13313

Closed arista-nwolfe closed 3 months ago

arista-nwolfe commented 3 months ago

Issue Description

If you run fib/test_fib.py::test_ipinip_hash_negative on master or 202405 it will fail with the following error:

"Traceback (most recent call last):"
"  File \"/usr/bin/ptf\", line 522, in <module>"
"    test_modules = load_test_modules(config)"
"  File \"/usr/bin/ptf\", line 413, in load_test_modules"
"    mod = imp.load_module(modname, *imp.find_module(modname, [root]))"
"  File \"ptftests/py3/pfc_wd_background_traffic.py\", line 40"
"    print(f\"traffic from {src_port} to {dst_port}: {queue} \")"
"                                                           ^"
"SyntaxError: invalid syntax"]

The problem is ptf_runner in test_ipinip_hash_negative isn't passed the is_python3=True argument. So things like python3 string formatting is unsupported.

fib/test_fib.py:419:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
ptf_runner.py:114: in ptf_runner
...
        is_python3 = False

Results you see

Test fails with Invalid Syntax on print(f\"traffic from {src_port} to {dst_port}: {queue} \")

Results you expected to see

Test should pass is_python3=True to ptf_runner and pass

Is it platform specific

generic

Relevant log output

No response

Output of show version

show version

SONiC Software Version: SONiC.branch.202405-ars.6720793b-buildimage.origin.202405-review.359992.1-dbg-2024.06.12.20.54
SONiC OS Version: 12
Distribution: Debian 12.5
Kernel: 6.1.0-11-2-amd64
Build commit: 99554e765
Build date: Thu Jun 13 03:44:44 UTC 2024
Built by: jenkins@jenkins-arsonic-k8s-7-n6lf2

Platform: x86_64-arista_7800r3ak_36dm2_lc
HwSKU: Arista-7800R3AK-36DM2-C36
ASIC: broadcom
ASIC Count: 2
Serial Number: SSN21060178
Model Number: 7800R3AK-36DM2-LC
Hardware Revision: 29.00
Uptime: 22:46:09 up 1 day,  4:54,  1 user,  load average: 1.55, 1.82, 2.15
Date: Fri 14 Jun 2024 22:46:09

Attach files (if any)

No response

justin-wong-ce commented 2 months ago

On 202311, there is one more testcase without the is_python3=True argument in ptf_runner(): https://github.com/sonic-net/sonic-mgmt/blob/748c557781f5349a9473ea702287c0d785c85b5f/tests/fib/test_fib.py#L399