-
Notifications
You must be signed in to change notification settings - Fork 29
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
add-metallb-nodeselector-tc #347
base: main
Are you sure you want to change the base?
Conversation
064e163
to
c92959e
Compare
c92959e
to
1019bfe
Compare
|
||
// ValidateLocalPref verifies local pref from FRR is equal to configured Local Pref. | ||
func ValidateLocalPref(frrPod *pod.Builder, localPref uint32, ipFamily string) error { | ||
var ( |
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.
remove
err error | ||
) | ||
|
||
res, err = frrPod.ExecCommand(append(netparam.VtySh, |
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.
please use getBGPStatus func
return fmt.Errorf("failed to parse route local preference %w", err) | ||
} | ||
|
||
for _, locPref := range toParse.Routes { |
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.
for _, locPref := range toParse.Routes { | |
for _, route := range toParse.Routes { |
} | ||
|
||
for _, locPref := range toParse.Routes { | ||
if locPref[0].LocalPref != localPref { |
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.
do we expect to validate only first route?
} | ||
} | ||
|
||
return err |
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.
return nil
Expect(err).ToNot(HaveOccurred(), "Fail to validate local preference") | ||
|
||
By("Validate BGP Community exists with the node selector") | ||
output, err := frr.GetBGPCommunityStatus(frrPod0, noAdvertise, strings.ToLower(netparam.IPV4Family)) |
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.
output, err := frr.GetBGPCommunityStatus(frrPod0, noAdvertise, strings.ToLower(netparam.IPV4Family)) | |
bgpStatus, err := frr.GetBGPCommunityStatus(frrPod0, noAdvertise, strings.ToLower(netparam.IPV4Family)) |
Expect(len(output.Routes)).To(Equal(1)) | ||
|
||
By("Validate BGP Community does not exist without the node selector") | ||
output, err = frr.GetBGPCommunityStatus(frrPod1, customCommunity, strings.ToLower(netparam.IPV4Family)) |
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.
output, err = frr.GetBGPCommunityStatus(frrPod1, customCommunity, strings.ToLower(netparam.IPV4Family)) | |
bgpStatus, err = frr.GetBGPCommunityStatus(frrPod1, customCommunity, strings.ToLower(netparam.IPV4Family)) |
_, err := metallb.NewBPGPeerBuilder(APIClient, name, NetConfig.MlbOperatorNamespace, | ||
peerIP, tsparams.LocalBGPASN, tsparams.LocalBGPASN).WithPassword(tsparams.BGPPassword).Create() | ||
|
||
return err |
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.
validate error here
return ipAddressPool | ||
} | ||
|
||
func createBGPPeer(name, peerIP string) error { |
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.
why don't use createBGPPeerAndVerifyIfItsReady?
setupMetalLbService("service-1", netparam.IPV4Family, ipAddressPool1, "Cluster") | ||
setupMetalLbService("service-2", netparam.IPV4Family, ipAddressPool2, "Cluster") |
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 that expected that you create 2 the same services with different name in case single IP addressPool?
moving test cases from cnf-gotest to eco-gotest