29 lines
537 B
Go
29 lines
537 B
Go
|
package main
|
||
|
|
||
|
import (
|
||
|
"testing"
|
||
|
)
|
||
|
|
||
|
func TestAll(t *testing.T) {
|
||
|
test_pass := "Aa:'w\\v_ eK "
|
||
|
err := setAuthSecret(test_pass)
|
||
|
if err != nil {
|
||
|
t.Errorf("Cannot setAuthSecret: %s", err)
|
||
|
}
|
||
|
|
||
|
cred, err := getAuthSecret()
|
||
|
if err != nil {
|
||
|
t.Errorf("Cannot getAuthSecret: %s", err)
|
||
|
}
|
||
|
|
||
|
if string(cred.CredentialBlob) != test_pass {
|
||
|
t.Errorf("Retrieved credentials are not equal: %s != %s", test_pass, cred.CredentialBlob)
|
||
|
}
|
||
|
|
||
|
delAuthSecret()
|
||
|
_, err = getAuthSecret()
|
||
|
if err == nil {
|
||
|
t.Error("Unabled to del auth secret")
|
||
|
}
|
||
|
}
|