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

cnf network: add-metallb-frr-test-cases #239

Merged
merged 1 commit into from
Oct 4, 2024

Conversation

gkopels
Copy link
Collaborator

@gkopels gkopels commented Oct 1, 2024

Last two test cases of frrk8 epic

@gkopels gkopels changed the title bump eco-infra pkg frrnodestate cnf network: add-metallb-frr-test-cases Oct 1, 2024
@gkopels gkopels force-pushed the add-metallb-frrk8-test-case-2 branch 7 times, most recently from 22ec307 to e735dee Compare October 1, 2024 13:41
@fedepaol
Copy link
Member

fedepaol commented Oct 1, 2024

did a rough check on what the tests are covering, lgtm from that side. I didn't go deeply in what the code does / how it's written

@gkopels gkopels force-pushed the add-metallb-frrk8-test-case-2 branch 4 times, most recently from e31b751 to bad8db4 Compare October 2, 2024 11:12
// Get the routes
frrNodeState, err := metallb.ListFrrNodeState(APIClient)
Expect(err).ToNot(HaveOccurred(), "Failed to verify BGP routes")
fmt.Println("frrNodeState[0].Objects.Status.RunningConfig",
Copy link
Collaborator

Choose a reason for hiding this comment

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

why do we need it?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Removed


By("Create first frrconfiguration that receieves a single route")
createFrrConfiguration(frrConfigFiltered1, ipv4metalLbIPList[0],
64500, []string{externalAdvertisedIPv4Routes[0], externalAdvertisedIPv6Routes[0]},
Copy link
Collaborator

Choose a reason for hiding this comment

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

use var instead 64500

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

replaced every found

"frr-k8s-webhook-server deployment is not ready")

By("Creating BGP Peers")
createBGPPeerAndVerifyIfItsReady(ipv4metalLbIPList[0], "", 64500,
Copy link
Collaborator

Choose a reason for hiding this comment

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

use var instead 64500

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

replaced everywhere found for 64500 and 64501

64500, []string{externalAdvertisedIPv4Routes[0], externalAdvertisedIPv6Routes[0]},
false, false)

By("Verify Worker-0 Node state update")
Copy link
Collaborator

Choose a reason for hiding this comment

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

please replace worker-0

Copy link
Collaborator Author

@gkopels gkopels Oct 3, 2024

Choose a reason for hiding this comment

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

replaced with a different name like Node 0 ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

replaced


By("Create second frrconfiguration that receives a single route")
createFrrConfiguration(frrConfigFiltered2, ipv4metalLbIPList[0],
64500, []string{externalAdvertisedIPv4Routes[1], externalAdvertisedIPv6Routes[1]},
Copy link
Collaborator

Choose a reason for hiding this comment

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

use var instead 64500

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

done

By("create a secondary IP address on the worker node 0")
err = createSecondaryInterfaceOnNode("sec-int-worker0", workerNodeList[0].Definition.Name,
srIovInterfacesUnderTest[0], frrNodeSecIntIPv4Addresses[0], "2001:100::254", vlanID)
Expect(err).ToNot(HaveOccurred(), "Fail to create a secondary interface on worker0")
Copy link
Collaborator

Choose a reason for hiding this comment

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

remove worker0

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

replaced

By("create a secondary IP address on the worker node 1")
err = createSecondaryInterfaceOnNode("sec-int-worker1", workerNodeList[1].Definition.Name,
srIovInterfacesUnderTest[0], frrNodeSecIntIPv4Addresses[1], "2001:100::253", vlanID)
Expect(err).ToNot(HaveOccurred(), "Fail to create a secondary interface on worker1")
Copy link
Collaborator

Choose a reason for hiding this comment

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

remove worker1

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

replaced

[]string{fmt.Sprintf("%s/24", hubSecIntIPv4Addresses[1])},
[]string{fmt.Sprintf("%s/24", hubIPv4ExternalAddresses[1])})

By("Creating FRR Hub Worker-0 Pod")
Copy link
Collaborator

Choose a reason for hiding this comment

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

remove wokrer-0

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

replaced

workerNodeList[0].Object.Name, createHubConfigMapSecInt.Definition.Name, []string{},
hub0BRStaticSecIntIPAnnotation)

By("Creating FRR Hub Worker-1 Pod")
Copy link
Collaborator

Choose a reason for hiding this comment

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

remove wokrer-1

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

removed

_, err := secondaryInterface.Create()

if err != nil {
return fmt.Errorf("fail to create secondary interface: %s.+%d", interfaceName, vlanID)
Copy link
Collaborator

Choose a reason for hiding this comment

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

verifye erro with Expect

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

replaced

@gkopels gkopels force-pushed the add-metallb-frrk8-test-case-2 branch from bad8db4 to 6490aec Compare October 3, 2024 11:51
ContainSubstring(externalAdvertisedIPv4Routes[1]), // Second IP address
), "Fail to find all expected received routes")
verifyReceivedRoutes(frrk8sPods, externalAdvertisedIPv4Routes[1])
verifyBlockedRoutes(frrk8sPods, prefixToBlock)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Another By() for Verifying blocked routes ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

added

@gkopels gkopels force-pushed the add-metallb-frrk8-test-case-2 branch from 6490aec to c82bf5b Compare October 3, 2024 12:59

By("Adding static routes to the speakers")
speakerRoutesMap := buildRoutesMapWithSpecificRoutes(frrk8sPods, hubSecIntIPv4Addresses)
Expect(err).ToNot(HaveOccurred(), "Failed to build speaker route map")
Copy link
Collaborator

Choose a reason for hiding this comment

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

remove

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

removed

@gkopels gkopels force-pushed the add-metallb-frrk8-test-case-2 branch 2 times, most recently from e8233e8 to c339d26 Compare October 3, 2024 17:00
@gkopels gkopels force-pushed the add-metallb-frrk8-test-case-2 branch from c339d26 to 905384c Compare October 3, 2024 17:03
Copy link
Collaborator

@evgenLevin evgenLevin left a comment

Choose a reason for hiding this comment

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

/lgtm

Copy link
Collaborator

@ajaggapa ajaggapa left a comment

Choose a reason for hiding this comment

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

lgtm

@ajaggapa ajaggapa merged commit 68f88c8 into openshift-kni:main Oct 4, 2024
1 check 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.

4 participants