Merge pull request #67412 from tanshanshan/little815

fix test log info
This commit is contained in:
k8s-ci-robot 2018-10-12 19:13:14 -07:00 committed by GitHub
commit b9468c7084
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -68,16 +68,16 @@ func TestUpdateSymlinkNewFileNotExist(t *testing.T) {
pairNamePrefix: "kubelet", pairNamePrefix: "kubelet",
} }
if err := s.updateSymlink(oldPairFile); err != nil { if err := s.updateSymlink(oldPairFile); err != nil {
t.Errorf("Got %v, wanted successful update of the symlink to point to %q", err, oldPairFile) t.Errorf("Got error %v, wanted successful update of the symlink to point to %q", err, oldPairFile)
} }
if _, err := os.Stat(oldPairFile); err != nil { if _, err := os.Stat(oldPairFile); err != nil {
t.Errorf("Got %v, wanted file %q to be there.", oldPairFile, err) t.Errorf("Got error %v, wanted file %q to be there.", err, oldPairFile)
} }
currentPairFile := filepath.Join(dir, "kubelet-current.pem") currentPairFile := filepath.Join(dir, "kubelet-current.pem")
if fi, err := os.Lstat(currentPairFile); err != nil { if fi, err := os.Lstat(currentPairFile); err != nil {
t.Errorf("Got %v, wanted file %q to be there", currentPairFile, err) t.Errorf("Got error %v, wanted file %q to be there", err, currentPairFile)
} else if fi.Mode()&os.ModeSymlink != os.ModeSymlink { } else if fi.Mode()&os.ModeSymlink != os.ModeSymlink {
t.Errorf("Got %q not a symlink.", currentPairFile) t.Errorf("Got %q not a symlink.", currentPairFile)
} }
@ -112,7 +112,7 @@ func TestUpdateSymlinkNoSymlink(t *testing.T) {
} }
if _, err := os.Stat(pairFile); err != nil { if _, err := os.Stat(pairFile); err != nil {
t.Errorf("Got error %v, wanted file %q to be there", pairFile, err) t.Errorf("Got error %v, wanted file %q to be there", err, pairFile)
} }
currentPairFile := filepath.Join(dir, "kubelet-current.pem") currentPairFile := filepath.Join(dir, "kubelet-current.pem")
if fi, err := os.Lstat(currentPairFile); err != nil { if fi, err := os.Lstat(currentPairFile); err != nil {