Merge pull request #40132 from bruceauyeung/k8s-branch-add-invalid-and-valid-tokens-in-TestValidateToken-testcase

Automatic merge from submit-queue

add test tokens for TestValidateToken

Signed-off-by: bruceauyeung <ouyang.qinhua@zte.com.cn>


**What this PR does / why we need it**:

1. add invalid tokens which token ID and token secret contain special characters such as `*`
2. add valid tokens which  token ID and token secret contain mixed lowercase characters and numeric numbers
pull/6/head
Kubernetes Submit Queue 2017-01-27 18:23:36 -08:00 committed by GitHub
commit 433e7a1fee
1 changed files with 4 additions and 0 deletions

View File

@ -89,6 +89,8 @@ func TestValidateToken(t *testing.T) {
{ID: "12345", Secret: "1234567890123456"},
{ID: "Abcdef", Secret: "1234567890123456"},
{ID: "123456", Secret: "AABBCCDDEEFFGGHH"},
{ID: "abc*ef", Secret: "1234567890123456"},
{ID: "abcdef", Secret: "123456789*123456"},
}
for _, token := range invalidTokens {
@ -100,6 +102,8 @@ func TestValidateToken(t *testing.T) {
validTokens := []*kubeadmapi.TokenDiscovery{
{ID: "abcdef", Secret: "1234567890123456"},
{ID: "123456", Secret: "aabbccddeeffgghh"},
{ID: "abc456", Secret: "1234567890123456"},
{ID: "abcdef", Secret: "123456ddeeffgghh"},
}
for _, token := range validTokens {