diff --git a/test/e2e/framework/test_context.go b/test/e2e/framework/test_context.go index c9b8a37db4f..a9391b72052 100644 --- a/test/e2e/framework/test_context.go +++ b/test/e2e/framework/test_context.go @@ -167,6 +167,9 @@ type TestContextType struct { // ProgressReportURL is the URL which progress updates will be posted to as tests complete. If empty, no updates are sent. ProgressReportURL string + + // SriovdpConfigMapFile is the path to the ConfigMap to configure the SRIOV device plugin on this host. + SriovdpConfigMapFile string } // NodeKillerConfig describes configuration of NodeKiller -- a utility to diff --git a/test/e2e_node/e2e_node_suite_test.go b/test/e2e_node/e2e_node_suite_test.go index 33b381b0f3b..0237f7d38b9 100644 --- a/test/e2e_node/e2e_node_suite_test.go +++ b/test/e2e_node/e2e_node_suite_test.go @@ -80,6 +80,7 @@ func registerNodeFlags(flags *flag.FlagSet) { flags.StringVar(&framework.TestContext.ImageDescription, "image-description", "", "The description of the image which the test will be running on.") flags.StringVar(&framework.TestContext.SystemSpecName, "system-spec-name", "", "The name of the system spec (e.g., gke) that's used in the node e2e test. The system specs are in test/e2e_node/system/specs/. This is used by the test framework to determine which tests to run for validating the system requirements.") flags.Var(cliflag.NewMapStringString(&framework.TestContext.ExtraEnvs), "extra-envs", "The extra environment variables needed for node e2e tests. Format: a list of key=value pairs, e.g., env1=val1,env2=val2") + flags.StringVar(&framework.TestContext.SriovdpConfigMapFile, "sriovdp-configmap-file", "", "The name of the SRIOV device plugin Config Map to load.") } func init() { diff --git a/test/e2e_node/testing-manifests/sriovdp-cm.yaml b/test/e2e_node/testing-manifests/sriovdp-cm.yaml index 373d759767c..f37ae0c8d2b 100644 --- a/test/e2e_node/testing-manifests/sriovdp-cm.yaml +++ b/test/e2e_node/testing-manifests/sriovdp-cm.yaml @@ -10,8 +10,8 @@ data: "resourceName": "intel_sriov_netdevice", "selectors": { "vendors": ["8086"], - "devices": ["154c", "10ed", "1521"], - "drivers": ["i40evf", "ixgbevf", "igb"] + "devices": ["154c", "10ed"], + "drivers": ["i40evf", "ixgbevf"] } }, { diff --git a/test/e2e_node/topology_manager_test.go b/test/e2e_node/topology_manager_test.go index 944156b61b6..127cbe50ac5 100644 --- a/test/e2e_node/topology_manager_test.go +++ b/test/e2e_node/topology_manager_test.go @@ -19,6 +19,7 @@ package e2enode import ( "context" "fmt" + "io/ioutil" "os/exec" "regexp" "strconv" @@ -491,9 +492,21 @@ func runTopologyManagerNodeAlignmentSinglePodTest(f *framework.Framework, sriovR } func runTopologyManagerNodeAlignmentSuiteTests(f *framework.Framework, numaNodes int) { + cmData := testfiles.ReadOrDie(SRIOVDevicePluginCMYAML) var err error - configMap := readConfigMapV1OrDie(testfiles.ReadOrDie(SRIOVDevicePluginCMYAML)) + // the SRIOVDP configuration is hw-dependent, so we allow per-test-host customization. + framework.Logf("host-local SRIOV Device Plugin Config Map %q", framework.TestContext.SriovdpConfigMapFile) + if framework.TestContext.SriovdpConfigMapFile != "" { + cmData, err = ioutil.ReadFile(framework.TestContext.SriovdpConfigMapFile) + if err != nil { + framework.Failf("unable to load the SRIOV Device Plugin ConfigMap: %v", err) + } + } else { + framework.Logf("Using built-in SRIOV Device Plugin Config Map") + } + + configMap := readConfigMapV1OrDie(cmData) ginkgo.By(fmt.Sprintf("Creating configMap %v/%v", metav1.NamespaceSystem, configMap.Name)) if _, err = f.ClientSet.CoreV1().ConfigMaps(metav1.NamespaceSystem).Create(context.TODO(), configMap, metav1.CreateOptions{}); err != nil { framework.Failf("unable to create test configMap %s: %v", configMap.Name, err)