浏览代码

etcdctl: Adding e2e tests for userAddTest

Jonathan Bazan 9 年之前
父节点
当前提交
d51a7dba43
共有 1 个文件被更改,包括 12 次插入0 次删除
  1. 12 0
      e2e/ctl_v3_user_test.go

+ 12 - 0
e2e/ctl_v3_user_test.go

@@ -39,6 +39,18 @@ func userAddTest(cx ctlCtx) {
 			expectedStr: "User username created",
 			stdIn:       []string{"password"},
 		},
+		// Adds a user name using the usertest:password syntax.
+		{
+			args:        []string{"add", "usertest:password"},
+			expectedStr: "User usertest created",
+			stdIn:       []string{},
+		},
+		// Tries to add a user with empty username.
+		{
+			args:        []string{"add", ":password"},
+			expectedStr: "empty user name is not allowed.",
+			stdIn:       []string{},
+		},
 		// Tries to add a user name that already exists.
 		{
 			args:        []string{"add", "username", "--interactive=false"},