Skip to content

Commit

Permalink
Disable kubelet restart tests for file volmode
Browse files Browse the repository at this point in the history
Change-Id: I016cba4aba11d6e8574d4bc2d1f26284a068e562
  • Loading branch information
msau42 committed Aug 15, 2019
1 parent 33c2135 commit 62f0b7d
Showing 1 changed file with 34 additions and 28 deletions.
62 changes: 34 additions & 28 deletions test/e2e/storage/testsuites/disruptive.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ func InitDisruptiveTestSuite() TestSuite {
featureTag: "[Disruptive]",
testPatterns: []testpatterns.TestPattern{
// FSVolMode is already covered in subpath testsuite
testpatterns.DefaultFsInlineVolume,
testpatterns.FsVolModePreprovisionedPV,
testpatterns.FsVolModeDynamicPV,
testpatterns.BlockVolModePreprovisionedPV,
testpatterns.BlockVolModePreprovisionedPV,
testpatterns.BlockVolModeDynamicPV,
},
Expand Down Expand Up @@ -122,41 +126,43 @@ func (s *disruptiveTestSuite) defineTests(driver TestDriver, pattern testpattern
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.",
runTestFile: utils.TestVolumeUnmountsFromDeletedPod,
testItStmt: "Should test that pv used in a pod that is deleted while the kubelet is down cleans up when the kubelet returns.",
// File test is covered by subpath testsuite
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.",
runTestFile: utils.TestVolumeUnmountsFromForceDeletedPod,
testItStmt: "Should test that pv used in a pod that is force deleted while the kubelet is down cleans up when the kubelet returns.",
// File test is covered by subpath testsuite
runTestBlock: utils.TestVolumeUnmapsFromForceDeletedPod,
},
}

for _, test := range disruptiveTestTable {
func(t disruptiveTest) {
ginkgo.It(t.testItStmt, func() {
init()
defer cleanup()

var err error
var pvcs []*v1.PersistentVolumeClaim
var inlineSources []*v1.VolumeSource
if pattern.VolType == testpatterns.InlineVolume {
inlineSources = append(inlineSources, l.resource.volSource)
} else {
pvcs = append(pvcs, l.resource.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)
framework.ExpectNoError(err, "While creating pods for kubelet restart test")

if pattern.VolMode == v1.PersistentVolumeBlock {
t.runTestBlock(l.cs, l.config.Framework, l.pod)
} else {
t.runTestFile(l.cs, l.config.Framework, l.pod)
}
})
}(test)
if test.runTestFile != nil {
func(t disruptiveTest) {
ginkgo.It(t.testItStmt, func() {
init()
defer cleanup()

var err error
var pvcs []*v1.PersistentVolumeClaim
var inlineSources []*v1.VolumeSource
if pattern.VolType == testpatterns.InlineVolume {
inlineSources = append(inlineSources, l.resource.volSource)
} else {
pvcs = append(pvcs, l.resource.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)
framework.ExpectNoError(err, "While creating pods for kubelet restart test")

if pattern.VolMode == v1.PersistentVolumeBlock {
t.runTestBlock(l.cs, l.config.Framework, l.pod)
} else {
t.runTestFile(l.cs, l.config.Framework, l.pod)
}
})
}(test)
}
}
}

0 comments on commit 62f0b7d

Please sign in to comment.