Fix unit tests.

This commit is contained in:
Mariano Cano 2021-11-24 11:43:24 -08:00
parent c3f98fd04d
commit d35848f7a9
2 changed files with 4 additions and 4 deletions

View file

@ -310,7 +310,7 @@ func TestAuthority_Sign(t *testing.T) {
extraOpts: extraOpts, extraOpts: extraOpts,
signOpts: _signOpts, signOpts: _signOpts,
err: errors.New("requested duration of 25h0m0s is more than the authorized maximum certificate duration of 24h1m0s"), err: errors.New("requested duration of 25h0m0s is more than the authorized maximum certificate duration of 24h1m0s"),
code: http.StatusBadRequest, code: http.StatusForbidden,
} }
}, },
"fail validate sans when adding common name not in claims": func(t *testing.T) *signTest { "fail validate sans when adding common name not in claims": func(t *testing.T) *signTest {
@ -323,7 +323,7 @@ func TestAuthority_Sign(t *testing.T) {
extraOpts: extraOpts, extraOpts: extraOpts,
signOpts: signOpts, signOpts: signOpts,
err: errors.New("certificate request does not contain the valid DNS names - got [test.smallstep.com smallstep test], want [test.smallstep.com]"), err: errors.New("certificate request does not contain the valid DNS names - got [test.smallstep.com smallstep test], want [test.smallstep.com]"),
code: http.StatusBadRequest, code: http.StatusForbidden,
} }
}, },
"fail rsa key too short": func(t *testing.T) *signTest { "fail rsa key too short": func(t *testing.T) *signTest {

View file

@ -200,8 +200,8 @@ ZEp7knvU2psWRw==
return &signTest{ return &signTest{
ca: ca, ca: ca,
body: string(body), body: string(body),
status: http.StatusBadRequest, status: http.StatusForbidden,
errMsg: errs.BadRequestPrefix, errMsg: errs.ForbiddenPrefix,
} }
}, },
"ok": func(t *testing.T) *signTest { "ok": func(t *testing.T) *signTest {