8000 feat: Add support for bgp dynamic neighbours subcommand for metal gateway by aayushrangwala · Pull Request #433 · equinix/metal-cli · GitHub
[go: up one dir, main page]

Skip to content
This repository was archived by the owner on Sep 4, 2026. It is now read-only.

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

Merged
ctreatma merged 14 commits into
equinix:mainfrom
aayushrangwala:gw-bgp-neighbours
Jan 31, 2024
Merged

ctreatma merged 14 commits into
equinix:mainfrom
aayushrangwala:gw-bgp-neighbours

Conversation

@aayushrangwala
@aayushrangwala aayushrangwala commented Jan 15, 2024 •
Copy link
Copy Markdown
Contributor

Fixes: #413

@ctreatma ctreatma left a comment
Copy link
Copy Markdown
Contributor

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
Copy Markdown
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
Copy Markdown
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.

Comment thread internal/gateway/getbgpneighbours.go Resolved
"github.com/equinix/metal-cli/test/helper"
)

func TestBgpDynamicNeighbours_Create(t *testing.T) {
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Contributor

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.

Comment thread internal/gateway/listbgpneighbours.go Resolved
Comment thread internal/gateway/getbgpneighbours.go Resolved
Comment thread internal/gateway/getbgpneighbours.go Resolved
@displague
Copy link
Copy Markdown
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
Comment thread test/helper/helper.go Resolved
@aayushrangwala
Copy link
Copy Markdown
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

< 8BD0 div data-show-on-forbidden-error hidden>

Uh oh!

There was an error while loading. Please reload this page.

@aayushrangwala
aayushrangwala requested a deployment to external January 30, 2024 16:07 — with GitHub Actions Abandoned
…eway

Signed-off-by: Ayush Rangwala <ayush.rangwala@gmail.com>
Signed-off-by: Ayush Rangwala <ayush.rangwala@gmail.com>
Signed-off-by: Ayush Rangwala <ayush.rangwala@gmail.com>
Signed-off-by: Ayush Rangwala <ayush.rangwala@gmail.com>
Signed-off-by: Ayush Rangwala <ayush.rangwala@gmail.com>
Signed-off-by: Ayush Rangwala <ayush.rangwala@gmail.com>
Signed-off-by: Ayush Rangwala <ayush.rangwala@gmail.com>
@aayushrangwala
aayushrangwala requested a deployment to external January 30, 2024 21:44 — with GitHub Actions Abandoned
Comment thread test/helper/helper.go Resolved
Signed-off-by: Chris Privitere <23177737+cprivitere@users.noreply.github.com>
Signed-off-by: Chris Privitere <23177737+cprivitere@users.noreply.github.com>
Signed-off-by: Chris Privitere <23177737+cprivitere@users.noreply.github.com>
Signed-off-by: Chris Privitere <23177737+cprivitere@users.noreply.github.com>
@aayushrangwala
Copy link
Copy Markdown
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 <ayush.rangwala@gmail.com>
@ctreatma ctreatma left a comment
Copy link
Copy Markdown
Contributor

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

This branch was previously deployed

1 inactive deployment
external — 8fcadd30 Deployed Jan 31, 2024 by aayushrangwala
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

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

0