Skip to content
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

feat: Add support for bgp dynamic neighbours subcommand for metal gateway #433

Merged
merged 14 commits into from
Jan 31, 2024

Conversation

aayushrangwala
Copy link
Contributor

@aayushrangwala aayushrangwala commented Jan 15, 2024

Fixes: #413

Copy link
Contributor

@ctreatma ctreatma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add tests for this subcommand?

@aayushrangwala
Copy link
Contributor Author

Can you add tests for this subcommand?

@ctreatma I am working on the tests but should we keep small PRs and raise tests in the next one? It'll be easier to review as well. And anyway this is a new functionality which is not release

@ctreatma
Copy link
Contributor

@ctreatma I am working on the tests but should we keep small PRs and raise tests in the next one? It'll be easier to review as well. And anyway this is a new functionality which is not release

Tests build the reviewer's confidence that the changes actually work the way they are supposed to. Doing them in a separate PR only serves to delay finishing the code.

internal/gateway/getbgpneighbours.go Outdated Show resolved Hide resolved
"github.com/equinix/metal-cli/test/helper"
)

func TestBgpDynamicNeighbours_Create(t *testing.T) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All of the new tests are failing with 404s:

=== RUN   TestBgpDynamicNeighbours_Create/create_bgp_dynamic_neighbour
Error: Could not create BGP Dynamic Neighbour: 404 Not Found Not found
    helper.go:591: Could not create BGP Dynamic Neighbour: 404 Not Found Not found
--- FAIL: TestBgpDynamicNeighbours_Create (2.54s)
    --- FAIL: TestBgpDynamicNeighbours_Create/create_bgp_dynamic_neighbour (0.14s)
=== RUN   TestBgpDynamicNeighbours_Delete
    delete_test.go:27: Error when calling `VRFsApi.CreateBgpDynamicNeighbor`: 404 Not Found Not found
--- FAIL: TestBgpDynamicNeighbours_Delete (3.10s)
=== RUN   TestBgpDynamicNeighbours_Get
    get_test.go:25: Error when calling `VRFsApi.CreateBgpDynamicNeighbor`: 404 Not Found Not found
--- FAIL: TestBgpDynamicNeighbours_Get (2.65s)
=== RUN   TestBgpDynamicNeighbours_List
    list_test.go:25: Error when calling `VRFsApi.CreateBgpDynamicNeighbor`: 404 Not Found Not found
--- FAIL: TestBgpDynamicNeighbours_List (3.00s)
FAIL

Do we need to pass in any additional CLI flags?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure why its failing with 404 on the CI, its passing at local

~/go/src/metal-cli   gw-bgp-neighbours *2 !15 ?4 ❯ go test -v ./test/e2e/gateways/bgp-dynamic-neighbour/...                                                                          27s
=== RUN   TestBgpDynamicNeighbors_Create
=== RUN   TestBgpDynamicNeighbors_Create/create_bgp_dynamic_neighbor
--- PASS: TestBgpDynamicNeighbors_Create (6.15s)
    --- PASS: TestBgpDynamicNeighbors_Create/create_bgp_dynamic_neighbor (0.83s)
=== RUN   TestBgpDynamicNeighbors_Delete
=== RUN   TestBgpDynamicNeighbors_Delete/delete_bgpDynamicNeighbor_by_ID
--- PASS: TestBgpDynamicNeighbors_Delete (6.11s)
    --- PASS: TestBgpDynamicNeighbors_Delete/delete_bgpDynamicNeighbor_by_ID (0.82s)
=== RUN   TestBgpDynamicNeighbors_Get
=== RUN   TestBgpDynamicNeighbors_Get/get_bgpDynamicNeighbor_by_ID
--- PASS: TestBgpDynamicNeighbors_Get (5.97s)
    --- PASS: TestBgpDynamicNeighbors_Get/get_bgpDynamicNeighbor_by_ID (0.43s)
=== RUN   TestBgpDynamicNeighbors_List
=== RUN   TestBgpDynamicNeighbors_List/list_bgpDynamicNeighbor_by_ID
--- PASS: TestBgpDynamicNeighbors_List (6.04s)
    --- PASS: TestBgpDynamicNeighbors_List/list_bgpDynamicNeighbor_by_ID (0.66s)
PASS
ok  	github.com/equinix/metal-cli/test/e2e/gateways/bgp-dynamic-neighbour	24.716s

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm also getting the 404 Not found Not Found on my local tests.

internal/gateway/listbgpneighbours.go Outdated Show resolved Hide resolved
internal/gateway/getbgpneighbours.go Outdated Show resolved Hide resolved
internal/gateway/getbgpneighbours.go Outdated Show resolved Hide resolved
@displague
Copy link
Member

I enabled VRF over Shared Connections, VRF Static Routers, and BGP Dynamic Neighbors for the testing org. We should see better progress in the E2E.

@aayushrangwala aayushrangwala requested a deployment to external January 29, 2024 18:50 — with GitHub Actions Abandoned
test/helper/helper.go Outdated Show resolved Hide resolved
@aayushrangwala
Copy link
Contributor Author

strings.Contains(err.Error(), "Not Found")

Yes after enabling FFs, tests started passing for BGP
https://github.com/equinix/metal-cli/actions/runs/7700595014/job/20986048893?pr=433#step:5:111

@aayushrangwala aayushrangwala requested a deployment to external January 30, 2024 16:07 — with GitHub Actions Abandoned
Signed-off-by: Chris Privitere <[email protected]>
@aayushrangwala
Copy link
Contributor Author

=== RUN   TestBgpDynamicNeighbors_Create
=== RUN   TestBgpDynamicNeighbors_Create/create_bgp_dynamic_neighbor
--- PASS: TestBgpDynamicNeighbors_Create (5.21s)
    --- PASS: TestBgpDynamicNeighbors_Create/create_bgp_dynamic_neighbor (0.45s)
=== RUN   TestBgpDynamicNeighbors_Delete
=== RUN   TestBgpDynamicNeighbors_Delete/delete_bgpDynamicNeighbor_by_ID
--- PASS: TestBgpDynamicNeighbors_Delete (3.82s)
    --- PASS: TestBgpDynamicNeighbors_Delete/delete_bgpDynamicNeighbor_by_ID (0.36s)
=== RUN   TestBgpDynamicNeighbors_Get
=== RUN   TestBgpDynamicNeighbors_Get/get_bgpDynamicNeighbor_by_ID
--- PASS: TestBgpDynamicNeighbors_Get (3.22s)
    --- PASS: TestBgpDynamicNeighbors_Get/get_bgpDynamicNeighbor_by_ID (0.19s)
=== RUN   TestBgpDynamicNeighbors_List
=== RUN   TestBgpDynamicNeighbors_List/list_bgpDynamicNeighbor_by_ID
--- PASS: TestBgpDynamicNeighbors_List (3.61s)
    --- PASS: TestBgpDynamicNeighbors_List/list_bgpDynamicNeighbor_by_ID (0.19s)

All related tests are passing in this test run @ctreatma can you please approve this PR

Signed-off-by: Ayush Rangwala <[email protected]>
Copy link
Contributor

@ctreatma ctreatma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The only test failure in CI was a panic due to hitting the go test timeout. I'm going to assume it's unrelated and deal with any consequences later.

@ctreatma ctreatma merged commit 60d0035 into equinix:main Jan 31, 2024
7 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for Metal Gateway BGP Dynamic Neighbors
4 participants