Skip to content

Commit

Permalink
cnf-network: Added logLevel to SriovNetworks
Browse files Browse the repository at this point in the history
  • Loading branch information
evgenLevin committed Jul 31, 2024
1 parent ad7339e commit 5ba4f2f
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 14 deletions.
2 changes: 1 addition & 1 deletion tests/cnf/core/network/dpdk/tests/rootless.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion tests/cnf/core/network/policy/tests/multinetpolicysriov.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
4 changes: 2 additions & 2 deletions tests/cnf/core/network/sriov/tests/allmulti.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions tests/cnf/core/network/sriov/tests/exposemtu.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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")
Expand Down
6 changes: 4 additions & 2 deletions tests/cnf/core/network/sriov/tests/externalllymanaged.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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")
}

Expand Down
2 changes: 1 addition & 1 deletion tests/cnf/core/network/sriov/tests/paralleldraining.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}

Expand Down
9 changes: 5 additions & 4 deletions tests/cnf/core/network/sriov/tests/qinq.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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 {
Expand All @@ -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 {
Expand Down Expand Up @@ -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))

Expand Down

0 comments on commit 5ba4f2f

Please sign in to comment.