Merge pull request #44191 from msau42/pv-upgrade-fix

Automatic merge from submit-queue (batch tested with PRs 44191, 44117, 44072)

Fix pv upgrade test failure

**What this PR does / why we need it**:
2 changes were made that broke the pv upgrade test:
1. MakePod() was changed so that the volume mount point is at /mnt/volume<n> instead of /mnt.  This change updates the path that the pod writes to.
2. The MakePod() call was changed to CreatePod(), which creates the pod and expects a long running pod.  But the upgrade test uses a short running pod, and the call to TestContainerOutput() will also create the pod. This changes it back to MakePod()


**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #44168

**Special notes for your reviewer**:

**Release note**:

NONE
This commit is contained in:
Kubernetes Submit Queue 2017-04-06 22:16:18 -07:00 committed by GitHub
commit bbf15d5c33

View File

@ -33,7 +33,7 @@ type PersistentVolumeUpgradeTest struct {
func (PersistentVolumeUpgradeTest) Name() string { return "persistent-volume-upgrade" }
const (
pvTestFile string = "/mnt/pv_upgrade_test"
pvTestFile string = "/mnt/volume1/pv_upgrade_test"
pvTestData string = "keep it pv"
pvWriteCmd string = "echo \"" + pvTestData + "\" > " + pvTestFile
pvReadCmd string = "cat " + pvTestFile
@ -99,7 +99,7 @@ func (t *PersistentVolumeUpgradeTest) Teardown(f *framework.Framework) {
// testPod creates a pod that consumes a pv and prints it out. The output is then verified.
func (t *PersistentVolumeUpgradeTest) testPod(f *framework.Framework, cmd string) {
pod := framework.CreatePod(f.ClientSet, f.Namespace.Name, []*v1.PersistentVolumeClaim{t.pvc}, false, cmd)
pod := framework.MakePod(f.Namespace.Name, []*v1.PersistentVolumeClaim{t.pvc}, false, cmd)
expectedOutput := []string{pvTestData}
f.TestContainerOutput("pod consumes pv", pod, 0, expectedOutput)
}