fix test log info

This commit is contained in:
tanshanshan 2018-08-15 10:19:03 +08:00
parent 6274590518
commit b0696b173b

View File

@ -69,16 +69,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)
} }
@ -113,7 +113,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 {