-
Notifications
You must be signed in to change notification settings - Fork 1
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
Rework hw pytest #598
Rework hw pytest #598
Conversation
9f95ad0
to
7ce61c0
Compare
I do not have the chance to actually run these tests due to lacking of directly connected machines. I get the idea by reading the code, and see the value during the development. What I can comment here is that, preparing an environment, e.g., providing a qcow2 file, setting up VMs and bridges, are currently manual, thus difficult to integrate into CI/CD. It is of course the same issue as the benchmark test. |
ICMPv6EchoRequest()) | ||
delayed_sendp(icmp_pkt, PF0.tap) | ||
|
||
def external_ping6(dst_ipv6, ul_ipv6): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it pure refactoring if I get it right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Functionally this is pure refactoring, but the reason to do this was because I need to encapsulate all sniff()
calls to intercept the mangled packets with EtherType=1337 and fix them.
These calls were the last three instances where a "naked" scapy call was being made.
@PlagueCZ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the detailed drawings. This looks good to me.
There was a switch to run pytest suite using actual hardware (Mellanox NIC). It was highly specific to a setup with corsslinked ports and could not thus cover everything.
I created a better implementation where the Mellanox NIC is connected to another machine (or another NIC on the same machine with network namespace isolation). Then a special
scapy
script is run on the remote machine to reflect underlay packets back to the test suite (it needs to mangle some of them to prevent isolation rule from firing).Currently this needs a directly connected machine with no switch in between, as the MAC addresses used would cause the traffic to be dropped I believe. But this is something I want to address later so this test can be run in other environments.
This is also capable of testing the multiport setup and pf1-proxy functionality (as the pytest suite needs to listen on the proxy port)
The change to dpservice C code is actually just a cleanup of a hack to make the previous HW test work.
As for the test suite itself, almost all calls to
send()
andsniff()
were already encapsulated, so adding the de-mangling of packets (for isolation rule prevention) is centralized. There were a few instances of a naked call tosend()
andsniff()
which I encapsulated and it even cleaned the code up.There is a bit of a messy change to telemetry tests (due to the fact that we change the graph for pf1-proxy, etc.), but this will be fixed once we either remove or rework the way pf1-proxy is implemented.
Apart from the above, the tests themselves are oblivious to this change.