fix unit test for cert

pull/5530/head
Medya Gh 2019-10-08 17:33:19 -07:00
parent 25e3d870e5
commit 83f736d9ff
1 changed files with 3 additions and 3 deletions

View File

@ -62,9 +62,9 @@ func TestSetupCerts(t *testing.T) {
certStorePath := path.Join(SSLCertStoreDir, dst) certStorePath := path.Join(SSLCertStoreDir, dst)
certNameHash := "abcdef" certNameHash := "abcdef"
remoteCertHashLink := path.Join(SSLCertStoreDir, fmt.Sprintf("%s.0", certNameHash)) remoteCertHashLink := path.Join(SSLCertStoreDir, fmt.Sprintf("%s.0", certNameHash))
cmdMap[fmt.Sprintf("sudo ln -s '%s' '%s'", certFile, certStorePath)] = "1" cmdMap[fmt.Sprintf("/bin/bash -c sudo ln -s '%s' '%s'", certFile, certStorePath)] = "1"
cmdMap[fmt.Sprintf("openssl x509 -hash -noout -in '%s'", certFile)] = certNameHash cmdMap[fmt.Sprintf("/bin/bash -c openssl x509 -hash -noout -in '%s'", certFile)] = certNameHash
cmdMap[fmt.Sprintf("sudo ln -s '%s' '%s'", certStorePath, remoteCertHashLink)] = "1" cmdMap[fmt.Sprintf("/bin/bash -c sudo ln -s '%s' '%s'", certStorePath, remoteCertHashLink)] = "1"
} }
f := command.NewFakeCommandRunner() f := command.NewFakeCommandRunner()
f.SetCommandToOutput(cmdMap) f.SetCommandToOutput(cmdMap)