From 5ba4f2fceee7b666d62a14b6173576f26704c32f Mon Sep 17 00:00:00 2001 From: evgenLevin Date: Tue, 30 Jul 2024 21:39:21 -0400 Subject: [PATCH] cnf-network: Added logLevel to SriovNetworks --- tests/cnf/core/network/dpdk/tests/rootless.go | 2 +- .../cnf/core/network/policy/tests/multinetpolicysriov.go | 2 +- tests/cnf/core/network/sriov/tests/allmulti.go | 4 ++-- tests/cnf/core/network/sriov/tests/exposemtu.go | 6 +++--- tests/cnf/core/network/sriov/tests/externalllymanaged.go | 6 ++++-- tests/cnf/core/network/sriov/tests/paralleldraining.go | 2 +- tests/cnf/core/network/sriov/tests/qinq.go | 9 +++++---- 7 files changed, 17 insertions(+), 14 deletions(-) diff --git a/tests/cnf/core/network/dpdk/tests/rootless.go b/tests/cnf/core/network/dpdk/tests/rootless.go index a276fc085..66c252eb5 100644 --- a/tests/cnf/core/network/dpdk/tests/rootless.go +++ b/tests/cnf/core/network/dpdk/tests/rootless.go @@ -652,7 +652,7 @@ func defineAndCreateVlanNad(name, intName string, vlanID uint16, ipam *nad.IPAM) func defineAndCreateSrIovNetwork(srIovNetwork, resName string, vlanID uint16) { srIovNetworkObject := sriov.NewNetworkBuilder( APIClient, srIovNetwork, NetConfig.SriovOperatorNamespace, tsparams.TestNamespaceName, resName). - WithMacAddressSupport() + WithMacAddressSupport().WithLogLevel("debug") if vlanID != 0 { srIovNetworkObject.WithVLAN(vlanID) diff --git a/tests/cnf/core/network/policy/tests/multinetpolicysriov.go b/tests/cnf/core/network/policy/tests/multinetpolicysriov.go index b47886fb7..af456321d 100644 --- a/tests/cnf/core/network/policy/tests/multinetpolicysriov.go +++ b/tests/cnf/core/network/policy/tests/multinetpolicysriov.go @@ -84,7 +84,7 @@ var _ = Describe("SRIOV", Ordered, Label("multinetworkpolicy"), ContinueOnFailur NetConfig.SriovOperatorNamespace, tsparams.TestNamespaceName, sriovPolicy.Definition.Spec.ResourceName). - WithStaticIpam().Create() + WithStaticIpam().WithLogLevel("debug").Create() Expect(err).ToNot(HaveOccurred(), "Failed to configure sr-iov network") By("Waiting until cluster MCP and SR-IOV are stable") diff --git a/tests/cnf/core/network/sriov/tests/allmulti.go b/tests/cnf/core/network/sriov/tests/allmulti.go index 50531e388..4d64123e9 100644 --- a/tests/cnf/core/network/sriov/tests/allmulti.go +++ b/tests/cnf/core/network/sriov/tests/allmulti.go @@ -320,7 +320,7 @@ var _ = Describe("allmulti", Ordered, Label(tsparams.LabelSuite), ContinueOnFail func defineAndCreateSrIovNetwork(srIovNetwork, resName string, allMulti bool) { srIovNetworkObject := sriov.NewNetworkBuilder( APIClient, srIovNetwork, NetConfig.SriovOperatorNamespace, tsparams.TestNamespaceName, resName). - WithStaticIpam().WithIPAddressSupport().WithMacAddressSupport() + WithStaticIpam().WithIPAddressSupport().WithMacAddressSupport().WithLogLevel("debug") if allMulti { srIovNetworkObject.WithTrustFlag(true).WithMetaPluginAllMultiFlag(true) @@ -477,7 +477,7 @@ func defineBondNAD(nadname, mode string) *nad.Builder { func defineAndCreateSrIovNetworkWithOutIPAM(srIovNetwork string, allMulti bool) { srIovNetworkObject := sriov.NewNetworkBuilder( APIClient, srIovNetwork, NetConfig.SriovOperatorNamespace, tsparams.TestNamespaceName, - srIovPolicyNode0ResName).WithMacAddressSupport() + srIovPolicyNode0ResName).WithMacAddressSupport().WithLogLevel("debug") if allMulti { srIovNetworkObject.WithTrustFlag(true).WithMetaPluginAllMultiFlag(true) diff --git a/tests/cnf/core/network/sriov/tests/exposemtu.go b/tests/cnf/core/network/sriov/tests/exposemtu.go index 5c3ea7da2..cc6037ff4 100644 --- a/tests/cnf/core/network/sriov/tests/exposemtu.go +++ b/tests/cnf/core/network/sriov/tests/exposemtu.go @@ -109,12 +109,12 @@ var _ = Describe("SRIOV: Expose MTU:", Ordered, Label(tsparams.LabelExposeMTUTes By("Creating 2 SR-IOV networks") _, err = sriov.NewNetworkBuilder(APIClient, sriovAndResourceName5000, NetConfig.SriovOperatorNamespace, tsparams.TestNamespaceName, sriovAndResourceName5000).WithStaticIpam().WithMacAddressSupport(). - WithIPAddressSupport().Create() + WithIPAddressSupport().WithLogLevel("debug").Create() Expect(err).ToNot(HaveOccurred(), "Failed to create SR-IOV network for the policy with 5000 MTU") _, err = sriov.NewNetworkBuilder(APIClient, sriovAndResourceName9000, NetConfig.SriovOperatorNamespace, tsparams.TestNamespaceName, sriovAndResourceName9000).WithStaticIpam().WithMacAddressSupport(). - WithIPAddressSupport().Create() + WithIPAddressSupport().WithLogLevel("debug").Create() Expect(err).ToNot(HaveOccurred(), "Failed to create SR-IOV network for the policy with 9000 MTU") By("Creating 2 pods with different VFs") @@ -171,7 +171,7 @@ func testExposeMTU(mtu int, interfacesUnderTest []string, devType, workerName st _, err = sriov.NewNetworkBuilder(APIClient, sriovAndResourceNameExposeMTU, NetConfig.SriovOperatorNamespace, tsparams.TestNamespaceName, sriovAndResourceNameExposeMTU).WithStaticIpam().WithMacAddressSupport(). - WithIPAddressSupport().Create() + WithIPAddressSupport().WithLogLevel("debug").Create() Expect(err).ToNot(HaveOccurred(), "Failed to create SR-IOV network") By("Creating test pod") diff --git a/tests/cnf/core/network/sriov/tests/externalllymanaged.go b/tests/cnf/core/network/sriov/tests/externalllymanaged.go index a27954cf5..7f34802e4 100644 --- a/tests/cnf/core/network/sriov/tests/externalllymanaged.go +++ b/tests/cnf/core/network/sriov/tests/externalllymanaged.go @@ -385,7 +385,8 @@ var _ = Describe("ExternallyManaged", Ordered, Label(tsparams.LabelExternallyMan _, err = sriov.NewNetworkBuilder( APIClient, sriovAndResourceNameExManagedTrue, NetConfig.SriovOperatorNamespace, tsparams.TestNamespaceName, sriovAndResourceNameExManagedTrue). - WithStaticIpam().WithMacAddressSupport().WithIPAddressSupport().WithVLAN(uint16(testVlan)).Create() + WithStaticIpam().WithMacAddressSupport().WithIPAddressSupport().WithVLAN(uint16(testVlan)). + WithLogLevel("debug").Create() Expect(err).ToNot(HaveOccurred(), "Failed to create SR-IOV network") By("Creating test pods and checking connectivity between test pods") @@ -410,7 +411,8 @@ func createSriovConfiguration(sriovAndResName, sriovInterfaceName string, extern By("Creating SR-IOV network") _, err = sriov.NewNetworkBuilder(APIClient, sriovAndResName, NetConfig.SriovOperatorNamespace, - tsparams.TestNamespaceName, sriovAndResName).WithStaticIpam().WithMacAddressSupport().WithIPAddressSupport().Create() + tsparams.TestNamespaceName, sriovAndResName).WithStaticIpam().WithMacAddressSupport().WithIPAddressSupport(). + WithLogLevel("debug").Create() Expect(err).ToNot(HaveOccurred(), "Failed to create SR-IOV network") } diff --git a/tests/cnf/core/network/sriov/tests/paralleldraining.go b/tests/cnf/core/network/sriov/tests/paralleldraining.go index f82b0fc4c..f67b78b1d 100644 --- a/tests/cnf/core/network/sriov/tests/paralleldraining.go +++ b/tests/cnf/core/network/sriov/tests/paralleldraining.go @@ -248,7 +248,7 @@ func createSriovConfigurationParallelDrain(sriovInterfaceName string) { _, err = sriov.NewNetworkBuilder(APIClient, sriovAndResourceNameParallelDrain, NetConfig.SriovOperatorNamespace, tsparams.TestNamespaceName, sriovAndResourceNameParallelDrain).WithStaticIpam().WithMacAddressSupport(). - WithIPAddressSupport().Create() + WithIPAddressSupport().WithLogLevel("debug").Create() Expect(err).ToNot(HaveOccurred(), "Failed to create SR-IOV network") } diff --git a/tests/cnf/core/network/sriov/tests/qinq.go b/tests/cnf/core/network/sriov/tests/qinq.go index cd837c528..a72b4dd2c 100644 --- a/tests/cnf/core/network/sriov/tests/qinq.go +++ b/tests/cnf/core/network/sriov/tests/qinq.go @@ -371,7 +371,7 @@ var _ = Describe("QinQ", Ordered, Label(tsparams.LabelQinQTestCases), ContinueOn By("Define and create sriov-network for the promiscuous client") _, err = sriov.NewNetworkBuilder(APIClient, srIovNetworkPromiscuous, NetConfig.SriovOperatorNamespace, tsparams.TestNamespaceName, - srIovPolicyResNameNetDevice).WithTrustFlag(true).Create() + srIovPolicyResNameNetDevice).WithTrustFlag(true).WithLogLevel("debug").Create() Expect(err).ToNot(HaveOccurred(), "Failed to create sriov network srIovNetworkPromiscuous") By("Define and create sriov-network with 802.1q S-VLAN") @@ -698,7 +698,7 @@ func defineAndCreateSrIovNetworkWithQinQ(srIovNetwork, resName, vlanProtocol str srIovNetworkObject, err := sriov.NewNetworkBuilder( APIClient, srIovNetwork, NetConfig.SriovOperatorNamespace, tsparams.TestNamespaceName, resName). - WithVlanProto(vlanProtocol).WithVLAN(uint16(vlan)).Create() + WithVlanProto(vlanProtocol).WithVLAN(uint16(vlan)).WithLogLevel("debug").Create() Expect(err).ToNot(HaveOccurred(), fmt.Sprintf("Failed to create sriov network %s", err)) Eventually(func() bool { @@ -711,7 +711,8 @@ func defineAndCreateSrIovNetworkWithQinQ(srIovNetwork, resName, vlanProtocol str func defineAndCreateSrIovNetworkClientDPDK(srIovNetworkName, resName string) { srIovNetworkObject, err := sriov.NewNetworkBuilder( - APIClient, srIovNetworkName, NetConfig.SriovOperatorNamespace, tsparams.TestNamespaceName, resName).Create() + APIClient, srIovNetworkName, NetConfig.SriovOperatorNamespace, tsparams.TestNamespaceName, resName). + WithLogLevel("debug").Create() Expect(err).ToNot(HaveOccurred(), "Failed to create dpdk sriov-network") Eventually(func() bool { @@ -1064,7 +1065,7 @@ func defineAndCreateSriovNetworks(sriovNetworkPromiscName, sriovNetworkDot1ADNam _, err := sriov.NewNetworkBuilder(APIClient, sriovNetworkPromiscName, NetConfig.SriovOperatorNamespace, tsparams.TestNamespaceName, - sriovResName).WithTrustFlag(true).Create() + sriovResName).WithTrustFlag(true).WithLogLevel("debug").Create() Expect(err).ToNot(HaveOccurred(), fmt.Sprintf("Failed to create sriov network srIovNetworkPromiscuous %s", err))