From 01f101320329c44c4eca638870bd0f6f08cb2761 Mon Sep 17 00:00:00 2001 From: Gyu-Ho Lee Date: Mon, 14 Aug 2017 12:18:43 -0700 Subject: [PATCH] e2e: test 'lease list' command Signed-off-by: Gyu-Ho Lee --- e2e/ctl_v3_lease_test.go | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/e2e/ctl_v3_lease_test.go b/e2e/ctl_v3_lease_test.go index d27060a6430..34571ac9f17 100644 --- a/e2e/ctl_v3_lease_test.go +++ b/e2e/ctl_v3_lease_test.go @@ -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)