mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-03 01:06:27 +00:00
Merge pull request #54549 from linyouchong/linyouchong-20171025
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. fix incorrect log **What this PR does / why we need it**: fix incorrect log in nfs_test.go **Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes # NONE **Special notes for your reviewer**: NONE **Release note**: NONE
This commit is contained in:
commit
6d73f03d2b
@ -168,7 +168,7 @@ func TestPlugin(t *testing.T) {
|
|||||||
if _, err := os.Stat(path); err == nil {
|
if _, err := os.Stat(path); err == nil {
|
||||||
t.Errorf("TearDown() failed, volume path still exists: %s", path)
|
t.Errorf("TearDown() failed, volume path still exists: %s", path)
|
||||||
} else if !os.IsNotExist(err) {
|
} else if !os.IsNotExist(err) {
|
||||||
t.Errorf("SetUp() failed: %v", err)
|
t.Errorf("TearDown() failed: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Test Provisioner
|
// Test Provisioner
|
||||||
|
@ -184,7 +184,7 @@ func testPlugin(t *testing.T, tmpDir string, volumeHost volume.VolumeHost) {
|
|||||||
if _, err := os.Stat(path); err == nil {
|
if _, err := os.Stat(path); err == nil {
|
||||||
t.Errorf("TearDown() failed, volume path still exists: %s", path)
|
t.Errorf("TearDown() failed, volume path still exists: %s", path)
|
||||||
} else if !os.IsNotExist(err) {
|
} else if !os.IsNotExist(err) {
|
||||||
t.Errorf("SetUp() failed: %v", err)
|
t.Errorf("TearDown() failed: %v", err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -111,7 +111,7 @@ func TestPlugin(t *testing.T) {
|
|||||||
if _, err := os.Stat(volumePath); err == nil {
|
if _, err := os.Stat(volumePath); err == nil {
|
||||||
t.Errorf("TearDown() failed, volume path still exists: %s", volumePath)
|
t.Errorf("TearDown() failed, volume path still exists: %s", volumePath)
|
||||||
} else if !os.IsNotExist(err) {
|
} else if !os.IsNotExist(err) {
|
||||||
t.Errorf("SetUp() failed: %v", err)
|
t.Errorf("TearDown() failed: %v", err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -194,7 +194,7 @@ func TestPlugin(t *testing.T) {
|
|||||||
if _, err := os.Stat(path); err == nil {
|
if _, err := os.Stat(path); err == nil {
|
||||||
t.Errorf("TearDown() failed, volume path still exists: %s", path)
|
t.Errorf("TearDown() failed, volume path still exists: %s", path)
|
||||||
} else if !os.IsNotExist(err) {
|
} else if !os.IsNotExist(err) {
|
||||||
t.Errorf("SetUp() failed: %v", err)
|
t.Errorf("TearDown() failed: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Test Provisioner
|
// Test Provisioner
|
||||||
|
@ -606,6 +606,6 @@ func doTestCleanAndTeardown(plugin volume.VolumePlugin, podUID types.UID, testVo
|
|||||||
if _, err := os.Stat(volumePath); err == nil {
|
if _, err := os.Stat(volumePath); err == nil {
|
||||||
t.Errorf("TearDown() failed, volume path still exists: %s", volumePath)
|
t.Errorf("TearDown() failed, volume path still exists: %s", volumePath)
|
||||||
} else if !os.IsNotExist(err) {
|
} else if !os.IsNotExist(err) {
|
||||||
t.Errorf("SetUp() failed: %v", err)
|
t.Errorf("TearDown() failed: %v", err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -287,7 +287,7 @@ func (test *downwardAPITest) tearDown() {
|
|||||||
if _, err := os.Stat(test.volumePath); err == nil {
|
if _, err := os.Stat(test.volumePath); err == nil {
|
||||||
test.t.Errorf("TearDown() failed, volume path still exists: %s", test.volumePath)
|
test.t.Errorf("TearDown() failed, volume path still exists: %s", test.volumePath)
|
||||||
} else if !os.IsNotExist(err) {
|
} else if !os.IsNotExist(err) {
|
||||||
test.t.Errorf("SetUp() failed: %v", err)
|
test.t.Errorf("TearDown() failed: %v", err)
|
||||||
}
|
}
|
||||||
os.RemoveAll(test.rootDir)
|
os.RemoveAll(test.rootDir)
|
||||||
}
|
}
|
||||||
|
@ -216,7 +216,7 @@ func doTestPlugin(t *testing.T, config pluginTestConfig) {
|
|||||||
if _, err := os.Stat(volPath); err == nil {
|
if _, err := os.Stat(volPath); err == nil {
|
||||||
t.Errorf("TearDown() failed, volume path still exists: %s", volPath)
|
t.Errorf("TearDown() failed, volume path still exists: %s", volPath)
|
||||||
} else if !os.IsNotExist(err) {
|
} else if !os.IsNotExist(err) {
|
||||||
t.Errorf("SetUp() failed: %v", err)
|
t.Errorf("TearDown() failed: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check the number of physicalMounter calls during tardown
|
// Check the number of physicalMounter calls during tardown
|
||||||
|
@ -181,7 +181,7 @@ func doTestPlugin(t *testing.T, spec *volume.Spec) {
|
|||||||
if _, err := os.Stat(path); err == nil {
|
if _, err := os.Stat(path); err == nil {
|
||||||
t.Errorf("TearDown() failed, volume path still exists: %s", path)
|
t.Errorf("TearDown() failed, volume path still exists: %s", path)
|
||||||
} else if !os.IsNotExist(err) {
|
} else if !os.IsNotExist(err) {
|
||||||
t.Errorf("SetUp() failed: %v", err)
|
t.Errorf("TearDown() failed: %v", err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -161,7 +161,7 @@ func TestPlugin(t *testing.T) {
|
|||||||
if _, err := os.Stat(path); err == nil {
|
if _, err := os.Stat(path); err == nil {
|
||||||
t.Errorf("TearDown() failed, volume path still exists: %s", path)
|
t.Errorf("TearDown() failed, volume path still exists: %s", path)
|
||||||
} else if !os.IsNotExist(err) {
|
} else if !os.IsNotExist(err) {
|
||||||
t.Errorf("SetUp() failed: %v", err)
|
t.Errorf("TearDown() failed: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Test Provisioner
|
// Test Provisioner
|
||||||
|
@ -306,7 +306,7 @@ func doTestPlugin(scenario struct {
|
|||||||
fmt.Errorf("TearDown() failed, volume path still exists: %s", path))
|
fmt.Errorf("TearDown() failed, volume path still exists: %s", path))
|
||||||
} else if !os.IsNotExist(err) {
|
} else if !os.IsNotExist(err) {
|
||||||
allErrs = append(allErrs,
|
allErrs = append(allErrs,
|
||||||
fmt.Errorf("SetUp() failed: %v", err))
|
fmt.Errorf("TearDown() failed: %v", err))
|
||||||
}
|
}
|
||||||
return allErrs
|
return allErrs
|
||||||
}
|
}
|
||||||
|
@ -129,7 +129,7 @@ func doTestPlugin(t *testing.T, spec *volume.Spec) {
|
|||||||
if _, err := os.Stat(volumePath); err == nil {
|
if _, err := os.Stat(volumePath); err == nil {
|
||||||
t.Errorf("TearDown() failed, volume path still exists: %s", volumePath)
|
t.Errorf("TearDown() failed, volume path still exists: %s", volumePath)
|
||||||
} else if !os.IsNotExist(err) {
|
} else if !os.IsNotExist(err) {
|
||||||
t.Errorf("SetUp() failed: %v", err)
|
t.Errorf("TearDown() failed: %v", err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -179,7 +179,7 @@ func doTestPlugin(t *testing.T, spec *volume.Spec) {
|
|||||||
if _, err := os.Stat(path); err == nil {
|
if _, err := os.Stat(path); err == nil {
|
||||||
t.Errorf("TearDown() failed, volume path still exists: %s", path)
|
t.Errorf("TearDown() failed, volume path still exists: %s", path)
|
||||||
} else if !os.IsNotExist(err) {
|
} else if !os.IsNotExist(err) {
|
||||||
t.Errorf("SetUp() failed: %v", err)
|
t.Errorf("TearDown() failed: %v", err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -193,7 +193,7 @@ func TestMountUnmount(t *testing.T) {
|
|||||||
if _, err := os.Stat(path); err == nil {
|
if _, err := os.Stat(path); err == nil {
|
||||||
t.Errorf("TearDown() failed, volume path still exists: %s", path)
|
t.Errorf("TearDown() failed, volume path still exists: %s", path)
|
||||||
} else if !os.IsNotExist(err) {
|
} else if !os.IsNotExist(err) {
|
||||||
t.Errorf("SetUp() failed: %v", err)
|
t.Errorf("TearDown() failed: %v", err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -157,13 +157,13 @@ func doTestPlugin(t *testing.T, spec *volume.Spec) {
|
|||||||
if _, err := os.Stat(volumePath); err == nil {
|
if _, err := os.Stat(volumePath); err == nil {
|
||||||
t.Errorf("TearDown() failed, volume path still exists: %s", volumePath)
|
t.Errorf("TearDown() failed, volume path still exists: %s", volumePath)
|
||||||
} else if !os.IsNotExist(err) {
|
} else if !os.IsNotExist(err) {
|
||||||
t.Errorf("SetUp() failed: %v", err)
|
t.Errorf("TearDown() failed: %v", err)
|
||||||
}
|
}
|
||||||
if len(fake.Log) != 1 {
|
if len(fake.Log) != 1 {
|
||||||
t.Errorf("Unmount was not called exactly one time. It was called %d times.", len(fake.Log))
|
t.Errorf("Unmount was not called exactly one time. It was called %d times.", len(fake.Log))
|
||||||
} else {
|
} else {
|
||||||
if fake.Log[0].Action != mount.FakeActionUnmount {
|
if fake.Log[0].Action != mount.FakeActionUnmount {
|
||||||
t.Errorf("Unexpected mounter action: %#v", fake.Log[0])
|
t.Errorf("Unexpected unmounter action: %#v", fake.Log[0])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -161,7 +161,7 @@ func TestPlugin(t *testing.T) {
|
|||||||
if _, err := os.Stat(path); err == nil {
|
if _, err := os.Stat(path); err == nil {
|
||||||
t.Errorf("TearDown() failed, volume path still exists: %s", path)
|
t.Errorf("TearDown() failed, volume path still exists: %s", path)
|
||||||
} else if !os.IsNotExist(err) {
|
} else if !os.IsNotExist(err) {
|
||||||
t.Errorf("SetUp() failed: %v", err)
|
t.Errorf("TearDown() failed: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Test Provisioner
|
// Test Provisioner
|
||||||
|
@ -1042,6 +1042,6 @@ func doTestCleanAndTeardown(plugin volume.VolumePlugin, podUID types.UID, testVo
|
|||||||
if _, err := os.Stat(volumePath); err == nil {
|
if _, err := os.Stat(volumePath); err == nil {
|
||||||
t.Errorf("TearDown() failed, volume path still exists: %s", volumePath)
|
t.Errorf("TearDown() failed, volume path still exists: %s", volumePath)
|
||||||
} else if !os.IsNotExist(err) {
|
} else if !os.IsNotExist(err) {
|
||||||
t.Errorf("SetUp() failed: %v", err)
|
t.Errorf("TearDown() failed: %v", err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -241,7 +241,7 @@ func doTestPlugin(t *testing.T, c *testcase) {
|
|||||||
if _, err := os.Stat(path); err == nil {
|
if _, err := os.Stat(path); err == nil {
|
||||||
t.Errorf("TearDown() failed, volume path still exists: %s", path)
|
t.Errorf("TearDown() failed, volume path still exists: %s", path)
|
||||||
} else if !os.IsNotExist(err) {
|
} else if !os.IsNotExist(err) {
|
||||||
t.Errorf("SetUp() failed: %v", err)
|
t.Errorf("TearDown() failed: %v", err)
|
||||||
}
|
}
|
||||||
checkMounterLog(t, fakeMounter, 3, mount.FakeAction{Action: "unmount", Target: c.expectedPodMountPath, Source: "", FSType: ""})
|
checkMounterLog(t, fakeMounter, 3, mount.FakeAction{Action: "unmount", Target: c.expectedPodMountPath, Source: "", FSType: ""})
|
||||||
|
|
||||||
|
@ -241,7 +241,7 @@ func TestVolumeMounterUnmounter(t *testing.T) {
|
|||||||
if _, err := os.Stat(path); err == nil {
|
if _, err := os.Stat(path); err == nil {
|
||||||
t.Errorf("TearDown() failed, volume path still exists: %s", path)
|
t.Errorf("TearDown() failed, volume path still exists: %s", path)
|
||||||
} else if !os.IsNotExist(err) {
|
} else if !os.IsNotExist(err) {
|
||||||
t.Errorf("SetUp() failed: %v", err)
|
t.Errorf("TearDown() failed: %v", err)
|
||||||
}
|
}
|
||||||
// are we still mapped
|
// are we still mapped
|
||||||
if sio.volume.MappedSdcInfo != nil {
|
if sio.volume.MappedSdcInfo != nil {
|
||||||
|
@ -626,6 +626,6 @@ func doTestCleanAndTeardown(plugin volume.VolumePlugin, podUID types.UID, testVo
|
|||||||
if _, err := os.Stat(volumePath); err == nil {
|
if _, err := os.Stat(volumePath); err == nil {
|
||||||
t.Errorf("TearDown() failed, volume path still exists: %s", volumePath)
|
t.Errorf("TearDown() failed, volume path still exists: %s", volumePath)
|
||||||
} else if !os.IsNotExist(err) {
|
} else if !os.IsNotExist(err) {
|
||||||
t.Errorf("SetUp() failed: %v", err)
|
t.Errorf("TearDown() failed: %v", err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -237,7 +237,7 @@ func TestPlugin(t *testing.T) {
|
|||||||
if _, err := os.Stat(volPath); err == nil {
|
if _, err := os.Stat(volPath); err == nil {
|
||||||
t.Errorf("TearDown() failed, volume path still exists: %s", volPath)
|
t.Errorf("TearDown() failed, volume path still exists: %s", volPath)
|
||||||
} else if !os.IsNotExist(err) {
|
} else if !os.IsNotExist(err) {
|
||||||
t.Errorf("SetUp() failed: %v", err)
|
t.Errorf("TearDown() failed: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if !fakeManager.unmountCalled {
|
if !fakeManager.unmountCalled {
|
||||||
|
@ -144,7 +144,7 @@ func TestPlugin(t *testing.T) {
|
|||||||
if _, err := os.Stat(path); err == nil {
|
if _, err := os.Stat(path); err == nil {
|
||||||
t.Errorf("TearDown() failed, volume path still exists: %s", path)
|
t.Errorf("TearDown() failed, volume path still exists: %s", path)
|
||||||
} else if !os.IsNotExist(err) {
|
} else if !os.IsNotExist(err) {
|
||||||
t.Errorf("SetUp() failed: %v", err)
|
t.Errorf("TearDown() failed: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Test Provisioner
|
// Test Provisioner
|
||||||
|
Loading…
Reference in New Issue
Block a user