mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 03:41:45 +00:00
Update kubeadm test TestValidateToken
- Remove some duplicate testcases - Add token to error message
This commit is contained in:
parent
323f34858d
commit
89fa53f064
@ -33,9 +33,6 @@ func TestValidateToken(t *testing.T) {
|
||||
token string
|
||||
expected bool
|
||||
}{
|
||||
{"772ef5.6b6baab1d4a0a171", true},
|
||||
{".6b6baab1d4a0a171", false},
|
||||
{"772ef5.", false},
|
||||
{"772ef5.6b6baab1d4a0a171", true},
|
||||
{".6b6baab1d4a0a171", false},
|
||||
{"772ef5.", false},
|
||||
@ -45,7 +42,8 @@ func TestValidateToken(t *testing.T) {
|
||||
err := ValidateToken(rt.token, nil).ToAggregate()
|
||||
if (err == nil) != rt.expected {
|
||||
t.Errorf(
|
||||
"failed ValidateToken:\n\texpected: %t\n\t actual: %t",
|
||||
"failed ValidateToken:\n\ttoken: %q\n\t expected: %t, got: %t",
|
||||
rt.token,
|
||||
rt.expected,
|
||||
(err == nil),
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user