mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
e2e: test 'lease list' command
Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
This commit is contained in:
parent
1f20d5d924
commit
01f1013203
@ -22,6 +22,7 @@ import (
|
||||
)
|
||||
|
||||
func TestCtlV3LeaseGrantTimeToLive(t *testing.T) { testCtl(t, leaseTestGrantTimeToLive) }
|
||||
func TestCtlV3LeaseGrantLeases(t *testing.T) { testCtl(t, leaseTestGrantLeasesList) }
|
||||
func TestCtlV3LeaseKeepAlive(t *testing.T) { testCtl(t, leaseTestKeepAlive) }
|
||||
func TestCtlV3LeaseRevoke(t *testing.T) { testCtl(t, leaseTestRevoke) }
|
||||
|
||||
@ -51,6 +52,26 @@ func leaseTestGrantTimeToLive(cx ctlCtx) {
|
||||
}
|
||||
}
|
||||
|
||||
func leaseTestGrantLeasesList(cx ctlCtx) {
|
||||
id, err := ctlV3LeaseGrant(cx, 10)
|
||||
if err != nil {
|
||||
cx.t.Fatal(err)
|
||||
}
|
||||
|
||||
cmdArgs := append(cx.PrefixArgs(), "lease", "list")
|
||||
proc, err := spawnCmd(cmdArgs)
|
||||
if err != nil {
|
||||
cx.t.Fatal(err)
|
||||
}
|
||||
_, err = proc.Expect(id)
|
||||
if err != nil {
|
||||
cx.t.Fatal(err)
|
||||
}
|
||||
if err = proc.Close(); err != nil {
|
||||
cx.t.Fatal(err)
|
||||
}
|
||||
}
|
||||
|
||||
func leaseTestKeepAlive(cx ctlCtx) {
|
||||
// put with TTL 10 seconds and keep-alive
|
||||
leaseID, err := ctlV3LeaseGrant(cx, 10)
|
||||
|
Loading…
x
Reference in New Issue
Block a user