-
Notifications
You must be signed in to change notification settings - Fork 124
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
refactor: NAT Interface and AddressPool API changes #1595
Conversation
Signed-off-by: Rastislav Szabo <raszabo@cisco.com>
Signed-off-by: Rastislav Szabo <raszabo@cisco.com>
Signed-off-by: Rastislav Szabo <raszabo@cisco.com>
Codecov Report
@@ Coverage Diff @@
## dev #1595 +/- ##
==========================================
- Coverage 52.81% 52.74% -0.08%
==========================================
Files 673 677 +4
Lines 79720 80530 +810
==========================================
+ Hits 42105 42476 +371
- Misses 34965 35349 +384
- Partials 2650 2705 +55
|
Signed-off-by: Rastislav Szabo <raszabo@cisco.com>
Signed-off-by: Rastislav Szabo <raszabo@cisco.com>
Signed-off-by: Rastislav Szabo <raszabo@cisco.com>
Signed-off-by: Rastislav Szabo <raszabo@cisco.com>
Signed-off-by: Rastislav Szabo <raszabo@cisco.com>
test-e2e Signed-off-by: Rastislav Szabo <raszabo@cisco.com>
Currently
Probably, examples should be updated too if possible. EDIT: and e2e too. For me, Failing TestSourceNAT
--- FAIL: TestSourceNAT (14.84s)
e2e_test.go:612: VPP start OK (PID: 29453)
e2e_test.go:156: Using docker client endpoint: unix:///var/run/docker.sock
e2e_test.go:612: VPP-Agent start OK (PID: 29472)
e2e_test.go:564: agent ready, took 101.397587ms
e2e_test.go:299: exec: vppctl show nat44 addresses
e2e_test.go:299: exec: vppctl show nat44 addresses
microservice_test.go:177: Linux ping 80.80.80.10: sent=5, received=3, loss=40%
e2e_test.go:299: exec: vppctl clear trace
e2e_test.go:299: exec: vppctl trace add virtio-input 100
e2e_test.go:299: exec: vppctl show trace
e2e_test.go:299: exec: vppctl clear trace
e2e_test.go:299: exec: vppctl trace add virtio-input 100
e2e_test.go:299: exec: vppctl show trace
testing_t_support.go:22:
/home/andrii/go/pkg/mod/github.com/onsi/gomega@v1.4.1/internal/assertion/assertion.go:69 +0x1b4
github.com/onsi/gomega/internal/assertion.(*Assertion).To(0xc000032dc0, 0xf3d3e0, 0x15fd170, 0xc0005341e0, 0x1, 0x1, 0x1)
/home/andrii/go/pkg/mod/github.com/onsi/gomega@v1.4.1/internal/assertion/assertion.go:35 +0xac
go.ligato.io/vpp-agent/v2/tests/e2e.TestSourceNAT(0xc00019c900)
/home/andrii/Projects/vpp-agent/tests/e2e/050_nat_test.go:190 +0x1af9
testing.tRunner(0xc00019c900, 0xe38d60)
/usr/local/go/src/testing/testing.go:909 +0xc9
created by testing.(*T).Run
/usr/local/go/src/testing/testing.go:960 +0x350
Agent is not in-sync
Expected
<bool>: false
to be true
e2e_test.go:208: -----------------
e2e_test.go:633: VPP-Agent exit OK
e2e_test.go:633: VPP exit OK
FAIL
-------------------------------------------------------------
FAILED! (exit code: 1)
------------------------------------------------------------- (I always look into old PRs to remember how to do this 😃) You may add |
Thanks @rewenset , tests should not fail even if using old API, since this aims to be backward compatible. It seems that I forgot to setup this dependency in address descriptor Will update e2e-tests as well. Edit: done, e2e updated & passing. I also kept one e2e test there for legacy API testing. |
This PR moves NAT interfaces and NAT address pools from the global NAT44 config into separate NB API entities.
At the same time, it supports full backward compatibility with the old (deprecated) API. This is done by keeping both old (global - deprecated) and new NAT address pool & interface descriptors, which share the same VPPcalls. Once the deprecated API is to be definitively removed, the old descriptors can be just deleted.