e2e: test 'lease list' command
@@ -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)
