Commit 02e8ffe1 authored by linyouchong's avatar linyouchong

fix incorrect log

parent f4fb38a2
...@@ -168,7 +168,7 @@ func TestPlugin(t *testing.T) { ...@@ -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) { ...@@ -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) { ...@@ -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) { ...@@ -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 ...@@ -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() { ...@@ -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) { ...@@ -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) { ...@@ -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) { ...@@ -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 { ...@@ -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) { ...@@ -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) { ...@@ -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) { ...@@ -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) { ...@@ -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) { ...@@ -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 ...@@ -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)
} }
} }
...@@ -157,7 +157,7 @@ func doTestPlugin(t *testing.T, spec *volume.Spec) { ...@@ -157,7 +157,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)
} }
} }
......
...@@ -236,7 +236,7 @@ func TestVolumeMounterUnmounter(t *testing.T) { ...@@ -236,7 +236,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 ...@@ -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) { ...@@ -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) { ...@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment