Disable kubelet restart tests for file volmode

Change-Id: I016cba4aba11d6e8574d4bc2d1f26284a068e562
This commit is contained in:
Michelle Au
2019-08-15 15:08:14 -07:00
parent 33c213577e
commit 62f0b7df7b

View File

@@ -39,6 +39,10 @@ func InitDisruptiveTestSuite() TestSuite {
featureTag: "[Disruptive]", featureTag: "[Disruptive]",
testPatterns: []testpatterns.TestPattern{ testPatterns: []testpatterns.TestPattern{
// FSVolMode is already covered in subpath testsuite // FSVolMode is already covered in subpath testsuite
testpatterns.DefaultFsInlineVolume,
testpatterns.FsVolModePreprovisionedPV,
testpatterns.FsVolModeDynamicPV,
testpatterns.BlockVolModePreprovisionedPV,
testpatterns.BlockVolModePreprovisionedPV, testpatterns.BlockVolModePreprovisionedPV,
testpatterns.BlockVolModeDynamicPV, testpatterns.BlockVolModeDynamicPV,
}, },
@@ -122,41 +126,43 @@ func (s *disruptiveTestSuite) defineTests(driver TestDriver, pattern testpattern
runTestBlock: utils.TestKubeletRestartsAndRestoresMap, runTestBlock: utils.TestKubeletRestartsAndRestoresMap,
}, },
{ {
testItStmt: "Should test that pv used in a pod that is deleted while the kubelet is down cleans up when the kubelet returns.", testItStmt: "Should test that pv used in a pod that is deleted while the kubelet is down cleans up when the kubelet returns.",
runTestFile: utils.TestVolumeUnmountsFromDeletedPod, // File test is covered by subpath testsuite
runTestBlock: utils.TestVolumeUnmapsFromDeletedPod, runTestBlock: utils.TestVolumeUnmapsFromDeletedPod,
}, },
{ {
testItStmt: "Should test that pv used in a pod that is force deleted while the kubelet is down cleans up when the kubelet returns.", testItStmt: "Should test that pv used in a pod that is force deleted while the kubelet is down cleans up when the kubelet returns.",
runTestFile: utils.TestVolumeUnmountsFromForceDeletedPod, // File test is covered by subpath testsuite
runTestBlock: utils.TestVolumeUnmapsFromForceDeletedPod, runTestBlock: utils.TestVolumeUnmapsFromForceDeletedPod,
}, },
} }
for _, test := range disruptiveTestTable { for _, test := range disruptiveTestTable {
func(t disruptiveTest) { if test.runTestFile != nil {
ginkgo.It(t.testItStmt, func() { func(t disruptiveTest) {
init() ginkgo.It(t.testItStmt, func() {
defer cleanup() init()
defer cleanup()
var err error var err error
var pvcs []*v1.PersistentVolumeClaim var pvcs []*v1.PersistentVolumeClaim
var inlineSources []*v1.VolumeSource var inlineSources []*v1.VolumeSource
if pattern.VolType == testpatterns.InlineVolume { if pattern.VolType == testpatterns.InlineVolume {
inlineSources = append(inlineSources, l.resource.volSource) inlineSources = append(inlineSources, l.resource.volSource)
} else { } else {
pvcs = append(pvcs, l.resource.pvc) pvcs = append(pvcs, l.resource.pvc)
} }
ginkgo.By("Creating a pod with pvc") ginkgo.By("Creating a pod with pvc")
l.pod, err = framework.CreateSecPodWithNodeSelection(l.cs, l.ns.Name, pvcs, inlineSources, false, "", false, false, framework.SELinuxLabel, nil, framework.NodeSelection{Name: l.config.ClientNodeName}, framework.PodStartTimeout) l.pod, err = framework.CreateSecPodWithNodeSelection(l.cs, l.ns.Name, pvcs, inlineSources, false, "", false, false, framework.SELinuxLabel, nil, framework.NodeSelection{Name: l.config.ClientNodeName}, framework.PodStartTimeout)
framework.ExpectNoError(err, "While creating pods for kubelet restart test") framework.ExpectNoError(err, "While creating pods for kubelet restart test")
if pattern.VolMode == v1.PersistentVolumeBlock { if pattern.VolMode == v1.PersistentVolumeBlock {
t.runTestBlock(l.cs, l.config.Framework, l.pod) t.runTestBlock(l.cs, l.config.Framework, l.pod)
} else { } else {
t.runTestFile(l.cs, l.config.Framework, l.pod) t.runTestFile(l.cs, l.config.Framework, l.pod)
} }
}) })
}(test) }(test)
}
} }
} }