fix: tests refactoring (#1950)

Signed-off-by: Alexei Dodon <adodon@cisco.com>
This commit is contained in:
Alexei Dodon
2023-10-26 11:20:39 +03:00
committed by GitHub
parent a3d8202345
commit d2fbd273ba
16 changed files with 624 additions and 504 deletions
+1 -9
View File
@@ -11,7 +11,6 @@ import (
"time"
. "github.com/smartystreets/goconvey/convey"
"golang.org/x/crypto/bcrypt"
cli "zotregistry.io/zot/pkg/cli/server"
test "zotregistry.io/zot/pkg/test/common"
@@ -32,14 +31,7 @@ func TestConfigReloader(t *testing.T) {
username := "alice"
password := "alice"
hash, err := bcrypt.GenerateFromPassword([]byte(password), 10)
if err != nil {
panic(err)
}
usernameAndHash := fmt.Sprintf("%s:%s", username, string(hash))
htpasswdPath := test.MakeHtpasswdFileFromString(usernameAndHash)
htpasswdPath := test.MakeHtpasswdFileFromString(test.GetCredString(username, password))
defer os.Remove(htpasswdPath)
defer os.Remove(logFile.Name()) // clean up