Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: openshift-kni/eco-gotests
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 471b13821017c4bab66154d516ce9fdc07103833
Choose a base ref
..
head repository: openshift-kni/eco-gotests
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 3686479a945394d5a8d6b117b26bea13e46a7cc7
Choose a head ref
8 changes: 5 additions & 3 deletions tests/cnf/core/network/internal/netenv/netenv.go
Original file line number Diff line number Diff line change
@@ -300,26 +300,28 @@ func SetStaticRoute(frrPod *pod.Builder, action, destIP, containerName string,
}

// CreateExternalNad creats an external network-attchment-definition using the br-ex interface.
func CreateExternalNad(apiClient *clients.Settings, name, testNameSpace string) {
func CreateExternalNad(apiClient *clients.Settings, name, testNameSpace string) error {
glog.V(90).Info("Creating external BR-EX NetworkAttachmentDefinition")

// Define the master NAD plugin
macVlanPlugin, err := define.MasterNadPlugin(coreparams.OvnExternalBridge, "bridge", nad.IPAMStatic())
if err != nil {
glog.V(90).Infof("Failed to define master NAD plugin: %v", err)

return
return err
}

// Create the NetworkAttachmentDefinition
_, err = define.CreateNadWithMasterPlugin(apiClient, name, testNameSpace, macVlanPlugin)
if err != nil {
glog.V(90).Infof("Failed to create external NetworkAttachmentDefinition: %v", err)

return
return err
}

glog.V(90).Infof("Successfully created external NetworkAttachmentDefinition: %s", name)

return nil
}

// WaitForMcpStable waits for the stability of the MCP with the given name.
6 changes: 4 additions & 2 deletions tests/cnf/core/network/metallb/tests/bfd-test.go
Original file line number Diff line number Diff line change
@@ -61,7 +61,8 @@ var _ = Describe("BFD", Ordered, Label(tsparams.LabelBFDTestCases), ContinueOnFa

err = metallbenv.IsEnvVarMetalLbIPinNodeExtNetRange(ipv4NodeAddrList, ipv4metalLbIPList, nil)
Expect(err).ToNot(HaveOccurred(), "Failed to validate metalLb exported ip address")
netenv.CreateExternalNad(APIClient, tsparams.ExternalMacVlanNADName, tsparams.TestNamespaceName)
err = netenv.CreateExternalNad(APIClient, tsparams.ExternalMacVlanNADName, tsparams.TestNamespaceName)
Expect(err).ToNot(HaveOccurred(), "Failed to create a network-attachment-definition")
})

Context("single hop", Label("singlehop"), func() {
@@ -214,7 +215,8 @@ var _ = Describe("BFD", Ordered, Label(tsparams.LabelBFDTestCases), ContinueOnFa

DescribeTable("should provide fast link failure detection", reportxml.ID("47186"),
func(bgpProtocol, ipStack string, externalTrafficPolicy corev1.ServiceExternalTrafficPolicyType) {
netenv.CreateExternalNad(APIClient, tsparams.ExternalMacVlanNADName, tsparams.TestNamespaceName)
err := netenv.CreateExternalNad(APIClient, tsparams.ExternalMacVlanNADName, tsparams.TestNamespaceName)
Expect(err).ToNot(HaveOccurred(), "Failed to create a network-attachment-definition")

By("Verifying that speaker route map is not empty")
Expect(speakerRoutesMap).ToNot(BeNil(), "Speaker route map is empty")
Original file line number Diff line number Diff line change
@@ -184,7 +184,8 @@ var _ = Describe("FRR", Ordered, Label(tsparams.LabelBGPTestCases), ContinueOnFa

func createAndDeployFRRPod() *pod.Builder {
By("Creating External NAD")
netenv.CreateExternalNad(APIClient, tsparams.ExternalMacVlanNADName, tsparams.TestNamespaceName)
err := netenv.CreateExternalNad(APIClient, tsparams.ExternalMacVlanNADName, tsparams.TestNamespaceName)

Check failure on line 187 in tests/cnf/core/network/metallb/tests/bgp-connect-time-tests.go

GitHub Actions / build

assignments should only be cuddled with other assignments (wsl)
Expect(err).ToNot(HaveOccurred(), "Failed to create a network-attachment-definition")

By("Creating static ip annotation")

6 changes: 4 additions & 2 deletions tests/cnf/core/network/metallb/tests/bgp-gracefulrestart.go
Original file line number Diff line number Diff line change
@@ -64,7 +64,8 @@ var _ = Describe("BGP Graceful Restart", Ordered, Label(tsparams.LabelGRTestCase

err = metallbenv.IsEnvVarMetalLbIPinNodeExtNetRange(ipv4NodeAddrList, ipv4MetalLbIPList, nil)
Expect(err).ToNot(HaveOccurred(), "Failed to validate metalLb exported ip address")
netenv.CreateExternalNad(APIClient, tsparams.ExternalMacVlanNADName, tsparams.TestNamespaceName)
err = netenv.CreateExternalNad(APIClient, tsparams.ExternalMacVlanNADName, tsparams.TestNamespaceName)
Expect(err).ToNot(HaveOccurred(), "Failed to create a network-attachment-definition")

By("Listing master nodes")
masterNodeList, err = nodes.List(APIClient,
@@ -84,7 +85,8 @@ var _ = Describe("BGP Graceful Restart", Ordered, Label(tsparams.LabelGRTestCase
Expect(err).ToNot(HaveOccurred(), "Failed to recreate metalLb daemonset")

By("Creating External NAD")
netenv.CreateExternalNad(APIClient, tsparams.ExternalMacVlanNADName, tsparams.TestNamespaceName)
err = netenv.CreateExternalNad(APIClient, tsparams.ExternalMacVlanNADName, tsparams.TestNamespaceName)
Expect(err).ToNot(HaveOccurred(), "Failed to create a network-attachment-definition")

By("Creating static ip annotation")
staticIPAnnotation := pod.StaticIPAnnotation(
9 changes: 6 additions & 3 deletions tests/cnf/core/network/metallb/tests/bgp-remote-as-dynamic.go
Original file line number Diff line number Diff line change
@@ -209,7 +209,8 @@ func createBGPPeerWithDynamicASN(peerIP, dynamicASN string, eBgpMultiHop bool) {
func deployFrrExternalPod(hubIPAddresses, externalAdvertisedIPv4Routes,
externalAdvertisedIPv6Routes []string, localAS int) *pod.Builder {
By("Creating External NAD")
netenv.CreateExternalNad(APIClient, tsparams.ExternalMacVlanNADName, tsparams.TestNamespaceName)
err := netenv.CreateExternalNad(APIClient, tsparams.ExternalMacVlanNADName, tsparams.TestNamespaceName)

Check failure on line 212 in tests/cnf/core/network/metallb/tests/bgp-remote-as-dynamic.go

GitHub Actions / build

assignments should only be cuddled with other assignments (wsl)
Expect(err).ToNot(HaveOccurred(), "Failed to create a network-attachment-definition")

By("Creating static ip annotation")

@@ -276,10 +277,12 @@ func setupBGPRemoteASMultiHopTest(ipv4metalLbIPList, hubIPv4ExternalAddresses, e
Expect(err).ToNot(HaveOccurred(), "Fail to set iteration parameters")

By("Creating External NAD for master FRR pod")
netenv.CreateExternalNad(APIClient, tsparams.ExternalMacVlanNADName, tsparams.TestNamespaceName)
err = netenv.CreateExternalNad(APIClient, tsparams.ExternalMacVlanNADName, tsparams.TestNamespaceName)

Check failure on line 280 in tests/cnf/core/network/metallb/tests/bgp-remote-as-dynamic.go

GitHub Actions / build

assignments should only be cuddled with other assignments (wsl)
Expect(err).ToNot(HaveOccurred(), "Failed to create a network-attachment-definition")

By("Creating External NAD for hub FRR pods")
netenv.CreateExternalNad(APIClient, tsparams.HubMacVlanNADName, tsparams.TestNamespaceName)
err = netenv.CreateExternalNad(APIClient, tsparams.HubMacVlanNADName, tsparams.TestNamespaceName)

Check failure on line 284 in tests/cnf/core/network/metallb/tests/bgp-remote-as-dynamic.go

GitHub Actions / build

assignments should only be cuddled with other assignments (wsl)
Expect(err).ToNot(HaveOccurred(), "Failed to create a network-attachment-definition")

By("Creating static ip annotation for hub0")

4 changes: 2 additions & 2 deletions tests/cnf/core/network/metallb/tests/bgp-tests.go
Original file line number Diff line number Diff line change
@@ -65,10 +65,10 @@ var _ = Describe("BGP", Ordered, Label(tsparams.LabelBGPTestCases), ContinueOnFa

BeforeEach(func() {
By("Creating External NAD")
netenv.CreateExternalNad(APIClient, tsparams.ExternalMacVlanNADName, tsparams.TestNamespaceName)
err := netenv.CreateExternalNad(APIClient, tsparams.ExternalMacVlanNADName, tsparams.TestNamespaceName)
Expect(err).ToNot(HaveOccurred(), "Failed to create a network-attachment-definition")

By("Listing metalLb speakers pod")
var err error
frrk8sPods, err = pod.List(APIClient, NetConfig.MlbOperatorNamespace, metav1.ListOptions{
LabelSelector: tsparams.FRRK8sDefaultLabel,
})
21 changes: 14 additions & 7 deletions tests/cnf/core/network/metallb/tests/frrk8-tests.go
Original file line number Diff line number Diff line change
@@ -497,10 +497,12 @@ var _ = Describe("FRR", Ordered, Label(tsparams.LabelFRRTestCases), ContinueOnFa
}

By("Creating External NAD for master FRR pod")
netenv.CreateExternalNad(APIClient, tsparams.ExternalMacVlanNADName, tsparams.TestNamespaceName)
err = netenv.CreateExternalNad(APIClient, tsparams.ExternalMacVlanNADName, tsparams.TestNamespaceName)
Expect(err).ToNot(HaveOccurred(), "Failed to create a network-attachment-definition")

By("Creating External NAD for hub FRR pods")
netenv.CreateExternalNad(APIClient, tsparams.HubMacVlanNADName, tsparams.TestNamespaceName)
err = netenv.CreateExternalNad(APIClient, tsparams.HubMacVlanNADName, tsparams.TestNamespaceName)
Expect(err).ToNot(HaveOccurred(), "Failed to create a network-attachment-definition")

By("Creating static ip annotation for hub0")
hub0BRstaticIPAnnotation := define.CreateStaticIPAnnotations(tsparams.ExternalMacVlanNADName,
@@ -569,10 +571,12 @@ var _ = Describe("FRR", Ordered, Label(tsparams.LabelFRRTestCases), ContinueOnFa
}

By("Creating External NAD for master FRR pod")
netenv.CreateExternalNad(APIClient, tsparams.ExternalMacVlanNADName, tsparams.TestNamespaceName)
err = netenv.CreateExternalNad(APIClient, tsparams.ExternalMacVlanNADName, tsparams.TestNamespaceName)
Expect(err).ToNot(HaveOccurred(), "Failed to create a network-attachment-definition")

By("Creating External NAD for hub FRR pods")
netenv.CreateExternalNad(APIClient, tsparams.HubMacVlanNADName, tsparams.TestNamespaceName)
err = netenv.CreateExternalNad(APIClient, tsparams.HubMacVlanNADName, tsparams.TestNamespaceName)
Expect(err).ToNot(HaveOccurred(), "Failed to create a network-attachment-definition")

By("Creating static ip annotation for hub0")
hub0BRstaticIPAnnotation := define.CreateStaticIPAnnotations(tsparams.ExternalMacVlanNADName,
@@ -668,10 +672,12 @@ var _ = Describe("FRR", Ordered, Label(tsparams.LabelFRRTestCases), ContinueOnFa
createExternalNadWithMasterInterface(tsparams.HubMacVlanNADSecIntName, interfaceNameWithVlan)

By("Creating External NAD for master FRR pod")
netenv.CreateExternalNad(APIClient, tsparams.ExternalMacVlanNADName, tsparams.TestNamespaceName)
err = netenv.CreateExternalNad(APIClient, tsparams.ExternalMacVlanNADName, tsparams.TestNamespaceName)
Expect(err).ToNot(HaveOccurred(), "Failed to create a network-attachment-definition")

By("Creating External NAD for hub FRR pods")
netenv.CreateExternalNad(APIClient, tsparams.HubMacVlanNADName, tsparams.TestNamespaceName)
err = netenv.CreateExternalNad(APIClient, tsparams.HubMacVlanNADName, tsparams.TestNamespaceName)
Expect(err).ToNot(HaveOccurred(), "Failed to create a network-attachment-definition")

By("Creating MetalLb Hub pod configMap")
createHubConfigMapSecInt := createHubConfigMap("frr-hub-node-config")
@@ -787,7 +793,8 @@ func deployTestPods(addressPool, hubIPAddresses, externalAdvertisedIPv4Routes,
setupNGNXPod(workerNodeList[0].Definition.Name)

By("Creating External NAD")
netenv.CreateExternalNad(APIClient, tsparams.ExternalMacVlanNADName, tsparams.TestNamespaceName)
err := netenv.CreateExternalNad(APIClient, tsparams.ExternalMacVlanNADName, tsparams.TestNamespaceName)

Check failure on line 796 in tests/cnf/core/network/metallb/tests/frrk8-tests.go

GitHub Actions / build

assignments should only be cuddled with other assignments (wsl)
Expect(err).ToNot(HaveOccurred(), "Failed to create a network-attachment-definition")

By("Creating static ip annotation")

3 changes: 2 additions & 1 deletion tests/cnf/core/network/metallb/tests/layer2-test.go
Original file line number Diff line number Diff line change
@@ -80,7 +80,8 @@ var _ = Describe("Layer2", Ordered, Label(tsparams.LabelLayer2TestCases), Contin
setupMetalLbService(netparam.IPV4Family, ipAddressPool, "Cluster")

By("Creating external Network Attachment Definition")
netenv.CreateExternalNad(APIClient, tsparams.ExternalMacVlanNADName, tsparams.TestNamespaceName)
err = netenv.CreateExternalNad(APIClient, tsparams.ExternalMacVlanNADName, tsparams.TestNamespaceName)
Expect(err).ToNot(HaveOccurred(), "Failed to create a network-attachment-definition")

By("Creating client test pod")
clientTestPod, err = pod.NewBuilder(
Original file line number Diff line number Diff line change
@@ -3,6 +3,7 @@ package tsparams
import (
"github.com/openshift-kni/eco-gotests/tests/cnf/core/network/internal/netparam"
"github.com/openshift-kni/k8sreporter"
mcfgv1 "github.com/openshift/machine-config-operator/pkg/apis/machineconfiguration.openshift.io/v1"
)

var (
@@ -17,5 +18,7 @@ var (
// TestNamespaceName security-tests namespace where all test cases are performed.
TestNamespaceName = "security-tests"
// ReporterCRDsToDump tells to the reporter what CRs to dump.
ReporterCRDsToDump = []k8sreporter.CRData{}
ReporterCRDsToDump = []k8sreporter.CRData{
{Cr: &mcfgv1.MachineConfigList{}},
}
)
Original file line number Diff line number Diff line change
@@ -175,10 +175,12 @@ func setupRemoteMultiHopTest(
)

By("Creating External NAD for master FRR pod")
netenv.CreateExternalNad(APIClient, externalMacVlanNADName, tsparams.TestNamespaceName)
err := netenv.CreateExternalNad(APIClient, externalMacVlanNADName, tsparams.TestNamespaceName)

Check failure on line 178 in tests/cnf/core/network/security/tests/nftables-custom-firewall-test.go

GitHub Actions / build

assignments should only be cuddled with other assignments (wsl)
Expect(err).ToNot(HaveOccurred(), "Failed to create a network-attachment-definition")

By("Creating External NAD for hub FRR pods")
netenv.CreateExternalNad(APIClient, nadHubName, tsparams.TestNamespaceName)
err = netenv.CreateExternalNad(APIClient, nadHubName, tsparams.TestNamespaceName)

Check failure on line 182 in tests/cnf/core/network/security/tests/nftables-custom-firewall-test.go

GitHub Actions / build

assignments should only be cuddled with other assignments (wsl)
Expect(err).ToNot(HaveOccurred(), "Failed to create a network-attachment-definition")

By("Creating static ip annotation for hub0")