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: Added logLevel to SriovNetworks #127

Merged
merged 1 commit into from
Aug 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion tests/cnf/core/network/dpdk/tests/rootless.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import (
"github.com/openshift-kni/eco-gotests/tests/cnf/core/network/internal/define"
"github.com/openshift-kni/eco-gotests/tests/cnf/core/network/internal/netenv"
. "github.com/openshift-kni/eco-gotests/tests/cnf/core/network/internal/netinittools"
"github.com/openshift-kni/eco-gotests/tests/cnf/core/network/internal/netparam"
"github.com/openshift-kni/eco-gotests/tests/internal/cluster"
"gopkg.in/k8snetworkplumbingwg/multus-cni.v4/pkg/types"
corev1 "k8s.io/api/core/v1"
Expand Down Expand Up @@ -652,7 +653,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(netparam.LogLevelDebug)

if vlanID != 0 {
srIovNetworkObject.WithVLAN(vlanID)
Expand Down
2 changes: 2 additions & 0 deletions tests/cnf/core/network/internal/netparam/const.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,6 @@ const (
IPSubnet64 = "64"
// IPSubnet32 represents prefix 32 ipv4 subnet.
IPSubnet32 = "32"
// LogLevelDebug represents log level debug.
LogLevelDebug = "debug"
)
3 changes: 2 additions & 1 deletion tests/cnf/core/network/policy/tests/multinetpolicysriov.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import (
"github.com/openshift-kni/eco-gotests/tests/cnf/core/network/internal/ipaddr"
"github.com/openshift-kni/eco-gotests/tests/cnf/core/network/internal/netenv"
. "github.com/openshift-kni/eco-gotests/tests/cnf/core/network/internal/netinittools"
"github.com/openshift-kni/eco-gotests/tests/cnf/core/network/internal/netparam"
"github.com/openshift-kni/eco-gotests/tests/cnf/core/network/policy/internal/tsparams"
"github.com/openshift-kni/eco-gotests/tests/internal/cluster"
corev1 "k8s.io/api/core/v1"
Expand Down Expand Up @@ -84,7 +85,7 @@ var _ = Describe("SRIOV", Ordered, Label("multinetworkpolicy"), ContinueOnFailur
NetConfig.SriovOperatorNamespace,
tsparams.TestNamespaceName,
sriovPolicy.Definition.Spec.ResourceName).
WithStaticIpam().Create()
WithStaticIpam().WithLogLevel(netparam.LogLevelDebug).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(netparam.LogLevelDebug)

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(netparam.LogLevelDebug)

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(netparam.LogLevelDebug).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(netparam.LogLevelDebug).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(netparam.LogLevelDebug).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(netparam.LogLevelDebug).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(netparam.LogLevelDebug).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(netparam.LogLevelDebug).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(netparam.LogLevelDebug).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(netparam.LogLevelDebug).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(netparam.LogLevelDebug).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(netparam.LogLevelDebug).Create()
Expect(err).ToNot(HaveOccurred(),
fmt.Sprintf("Failed to create sriov network srIovNetworkPromiscuous %s", err))

Expand Down
Loading