mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-21 10:51:29 +00:00
Merge pull request #100741 from mengjiao-liu/fix-test-err
Fix incorrect test code in pkg/volume/csi/csi_attacher_test.go file
This commit is contained in:
commit
8b787f3a22
@ -754,7 +754,7 @@ func TestAttacherWaitForVolumeAttachment(t *testing.T) {
|
||||
if tc.shouldFail && err == nil {
|
||||
t.Error("expecting failure, but err is nil")
|
||||
}
|
||||
if tc.initAttachErr != nil {
|
||||
if tc.initAttachErr != nil && err != nil {
|
||||
if tc.initAttachErr.Message != err.Error() {
|
||||
t.Errorf("expecting error [%v], got [%v]", tc.initAttachErr.Message, err.Error())
|
||||
}
|
||||
@ -1268,7 +1268,7 @@ func TestAttacherMountDevice(t *testing.T) {
|
||||
}
|
||||
return
|
||||
}
|
||||
if err == nil && tc.shouldFail {
|
||||
if tc.shouldFail {
|
||||
t.Errorf("test should fail, but no error occurred")
|
||||
}
|
||||
|
||||
@ -1440,7 +1440,7 @@ func TestAttacherMountDeviceWithInline(t *testing.T) {
|
||||
}
|
||||
return
|
||||
}
|
||||
if err == nil && tc.shouldFail {
|
||||
if tc.shouldFail {
|
||||
t.Errorf("test should fail, but no error occurred")
|
||||
}
|
||||
|
||||
@ -1585,7 +1585,7 @@ func TestAttacherUnmountDevice(t *testing.T) {
|
||||
}
|
||||
return
|
||||
}
|
||||
if err == nil && tc.shouldFail {
|
||||
if tc.shouldFail {
|
||||
t.Errorf("test should fail, but no error occurred")
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user