tests/e2e: fix "authLeaseTestLeaseRevoke"
Signed-off-by: Gyuho Lee <leegyuho@amazon.com>release-3.4
parent
6af8ce6c60
commit
5877763990
|
@ -786,8 +786,19 @@ func authLeaseTestLeaseRevoke(cx ctlCtx) {
|
|||
cx.user, cx.pass = "root", "root"
|
||||
authSetupTestUser(cx)
|
||||
|
||||
if err := leaseTestRevoke(cx); err != nil {
|
||||
cx.t.Fatalf("authLeaseTestLeaseRevoke: error (%v)", err)
|
||||
// put with TTL 10 seconds and revoke
|
||||
leaseID, err := ctlV3LeaseGrant(cx, 10)
|
||||
if err != nil {
|
||||
cx.t.Fatalf("ctlV3LeaseGrant error (%v)", err)
|
||||
}
|
||||
if err := ctlV3Put(cx, "key", "val", leaseID); err != nil {
|
||||
cx.t.Fatalf("ctlV3Put error (%v)", err)
|
||||
}
|
||||
if err := ctlV3LeaseRevoke(cx, leaseID); err != nil {
|
||||
cx.t.Fatalf("ctlV3LeaseRevoke error (%v)", err)
|
||||
}
|
||||
if err := ctlV3GetWithErr(cx, []string{"key"}, []string{"retrying of unary invoker failed"}); err != nil { // expect errors
|
||||
cx.t.Fatalf("ctlV3GetWithErr error (%v)", err)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -329,6 +329,16 @@ func ctlV3Get(cx ctlCtx, args []string, kvs ...kv) error {
|
|||
return spawnWithExpects(cmdArgs, lines...)
|
||||
}
|
||||
|
||||
// ctlV3GetWithErr runs "get" command expecting no output but error
|
||||
func ctlV3GetWithErr(cx ctlCtx, args []string, errs []string) error {
|
||||
cmdArgs := append(cx.PrefixArgs(), "get")
|
||||
cmdArgs = append(cmdArgs, args...)
|
||||
if !cx.quorum {
|
||||
cmdArgs = append(cmdArgs, "--consistency", "s")
|
||||
}
|
||||
return spawnWithExpects(cmdArgs, errs...)
|
||||
}
|
||||
|
||||
func ctlV3Del(cx ctlCtx, args []string, num int) error {
|
||||
cmdArgs := append(cx.PrefixArgs(), "del")
|
||||
cmdArgs = append(cmdArgs, args...)
|
||||
|
|
Loading…
Reference in New Issue