@@ -35,49 +35,42 @@ import (
35
35
)
36
36
37
37
const (
38
- pluginKustomizationYaml = "deployments/fpga_plugin/base/kustomization.yaml"
39
- webhookKustomizationYaml = "deployments/fpga_admissionwebhook/default/kustomization .yaml"
40
- nlb0NodeResource = "fpga.intel.com/af-695.d84.aVKNtusxV3qMNmj5-qCB9thCTcSko8QT-J5DNoP5BAs"
41
- nlb0PodResource = "fpga.intel.com/arria10.dcp1.2-nlb0-orchestrated"
42
- nlb3PodResource = "fpga.intel.com/arria10.dcp1.2-nlb3-orchestrated"
43
- nlb0PodResourceAF = "fpga.intel.com/arria10.dcp1.2-nlb0-preprogrammed"
44
- arria10NodeResource = "fpga.intel.com/region-69528db6eb31577a8c3668f9faa081f6"
38
+ pluginKustomizationYaml = "deployments/fpga_plugin/base/kustomization.yaml"
39
+ mappingsCollectionYaml = "deployments/fpga_admissionwebhook/mappings-collection .yaml"
40
+ nlb0NodeResource = "fpga.intel.com/af-695.d84.aVKNtusxV3qMNmj5-qCB9thCTcSko8QT-J5DNoP5BAs"
41
+ nlb0PodResource = "fpga.intel.com/arria10.dcp1.2-nlb0-orchestrated"
42
+ nlb3PodResource = "fpga.intel.com/arria10.dcp1.2-nlb3-orchestrated"
43
+ nlb0PodResourceAF = "fpga.intel.com/arria10.dcp1.2-nlb0-preprogrammed"
44
+ arria10NodeResource = "fpga.intel.com/region-69528db6eb31577a8c3668f9faa081f6"
45
45
)
46
46
47
47
func init () {
48
48
ginkgo .Describe ("FPGA Plugin E2E tests" , describe )
49
49
}
50
50
51
51
func describe () {
52
- webhookKustomizationPath , err := utils .LocateRepoFile (webhookKustomizationYaml )
52
+ pluginKustomizationPath , err := utils .LocateRepoFile (pluginKustomizationYaml )
53
53
if err != nil {
54
- framework .Failf ("unable to locate %q: %v" , webhookKustomizationYaml , err )
54
+ framework .Failf ("unable to locate %q: %v" , pluginKustomizationYaml , err )
55
55
}
56
56
57
- pluginKustomizationPath , err := utils .LocateRepoFile (pluginKustomizationYaml )
57
+ mappingsCollectionPath , err := utils .LocateRepoFile (mappingsCollectionYaml )
58
58
if err != nil {
59
- framework .Failf ("unable to locate %q: %v" , pluginKustomizationYaml , err )
59
+ framework .Failf ("unable to locate %q: %v" , mappingsCollectionYaml , err )
60
60
}
61
61
62
62
fmw := framework .NewDefaultFramework ("fpgaplugin-e2e" )
63
63
64
64
ginkgo .It ("Run FPGA plugin tests" , func () {
65
- // Deploy webhook
66
- ginkgo .By (fmt .Sprintf ("namespace %s: deploying webhook" , fmw .Namespace .Name ))
67
- utils .DeployFpgaWebhook (fmw , webhookKustomizationPath )
68
-
69
- ginkgo .By ("deploying mappings" )
70
- framework .RunKubectlOrDie (fmw .Namespace .Name , "apply" , "-n" , fmw .Namespace .Name , "-f" , filepath .Dir (webhookKustomizationPath )+ "/../mappings-collection.yaml" )
71
-
72
65
// Run region test case twice to ensure that device is reprogrammed at least once
73
- runTestCase (fmw , pluginKustomizationPath , "region" , arria10NodeResource , nlb3PodResource , "nlb3" , "nlb0" )
74
- runTestCase (fmw , pluginKustomizationPath , "region" , arria10NodeResource , nlb0PodResource , "nlb0" , "nlb3" )
66
+ runTestCase (fmw , pluginKustomizationPath , mappingsCollectionPath , "region" , arria10NodeResource , nlb3PodResource , "nlb3" , "nlb0" )
67
+ runTestCase (fmw , pluginKustomizationPath , mappingsCollectionPath , "region" , arria10NodeResource , nlb0PodResource , "nlb0" , "nlb3" )
75
68
// Run af test case
76
- runTestCase (fmw , pluginKustomizationPath , "af" , nlb0NodeResource , nlb0PodResourceAF , "nlb0" , "nlb3" )
69
+ runTestCase (fmw , pluginKustomizationPath , mappingsCollectionPath , "af" , nlb0NodeResource , nlb0PodResourceAF , "nlb0" , "nlb3" )
77
70
})
78
71
}
79
72
80
- func runTestCase (fmw * framework.Framework , pluginKustomizationPath , pluginMode , nodeResource , podResource , cmd1 , cmd2 string ) {
73
+ func runTestCase (fmw * framework.Framework , pluginKustomizationPath , mappingsCollectionPath , pluginMode , nodeResource , podResource , cmd1 , cmd2 string ) {
81
74
tmpDir , err := ioutil .TempDir ("" , "fpgaplugine2etest-" + fmw .Namespace .Name )
82
75
if err != nil {
83
76
framework .Failf ("unable to create temp directory: %v" , err )
@@ -93,6 +86,9 @@ func runTestCase(fmw *framework.Framework, pluginKustomizationPath, pluginMode,
93
86
_ , _ = framework .RunKubectl (fmw .Namespace .Name , "delete" , "-k" , tmpDir )
94
87
framework .RunKubectlOrDie (fmw .Namespace .Name , "apply" , "-k" , tmpDir )
95
88
89
+ ginkgo .By ("deploying mappings" )
90
+ framework .RunKubectlOrDie (fmw .Namespace .Name , "apply" , "-n" , fmw .Namespace .Name , "-f" , mappingsCollectionPath )
91
+
96
92
waitForPod (fmw , "intel-fpga-plugin" )
97
93
98
94
resource := v1 .ResourceName (nodeResource )
0 commit comments