From df87dba21804de4fa1a214379720371570196169 Mon Sep 17 00:00:00 2001 From: Gyuho Lee Date: Wed, 9 May 2018 15:14:23 -0700 Subject: [PATCH] tests/e2e: use different parameters Signed-off-by: Gyuho Lee --- tests/e2e/ctl_v2_test.go | 8 ++++---- tests/e2e/ctl_v3_auth_test.go | 2 +- tests/e2e/ctl_v3_kv_test.go | 3 ++- tests/e2e/ctl_v3_lock_test.go | 2 +- tests/e2e/ctl_v3_snapshot_test.go | 6 +++--- 5 files changed, 11 insertions(+), 10 deletions(-) diff --git a/tests/e2e/ctl_v2_test.go b/tests/e2e/ctl_v2_test.go index 60d9ce74c..8af4425ee 100644 --- a/tests/e2e/ctl_v2_test.go +++ b/tests/e2e/ctl_v2_test.go @@ -251,7 +251,7 @@ func testCtlV2Backup(t *testing.T, snapCount int, v3 bool) { t.Fatal(err) } - if err := etcdctlSet(epc1, "foo1", "bar"); err != nil { + if err := etcdctlSet(epc1, "foo1", "bar1"); err != nil { t.Fatal(err) } @@ -276,7 +276,7 @@ func testCtlV2Backup(t *testing.T, snapCount int, v3 bool) { epc2 := setupEtcdctlTest(t, &cfg2, false) // check if backup went through correctly - if err := etcdctlGet(epc2, "foo1", "bar", false); err != nil { + if err := etcdctlGet(epc2, "foo1", "bar1", false); err != nil { t.Fatal(err) } @@ -292,10 +292,10 @@ func testCtlV2Backup(t *testing.T, snapCount int, v3 bool) { } // check if it can serve client requests - if err := etcdctlSet(epc2, "foo2", "bar"); err != nil { + if err := etcdctlSet(epc2, "foo2", "bar2"); err != nil { t.Fatal(err) } - if err := etcdctlGet(epc2, "foo2", "bar", false); err != nil { + if err := etcdctlGet(epc2, "foo2", "bar2", false); err != nil { t.Fatal(err) } diff --git a/tests/e2e/ctl_v3_auth_test.go b/tests/e2e/ctl_v3_auth_test.go index db38d5fc6..f0c313e5f 100644 --- a/tests/e2e/ctl_v3_auth_test.go +++ b/tests/e2e/ctl_v3_auth_test.go @@ -968,7 +968,7 @@ func authTestSnapshot(cx ctlCtx) { cx.user, cx.pass = "root", "root" authSetupTestUser(cx) - fpath := "test.snapshot" + fpath := "test-auth.snapshot" defer os.RemoveAll(fpath) // ordinary user cannot save a snapshot diff --git a/tests/e2e/ctl_v3_kv_test.go b/tests/e2e/ctl_v3_kv_test.go index 2e14bea64..0533b067f 100644 --- a/tests/e2e/ctl_v3_kv_test.go +++ b/tests/e2e/ctl_v3_kv_test.go @@ -18,9 +18,10 @@ import ( "fmt" "strings" "testing" + "time" ) -func TestCtlV3Put(t *testing.T) { testCtl(t, putTest) } +func TestCtlV3Put(t *testing.T) { testCtl(t, putTest, withDialTimeout(7*time.Second)) } func TestCtlV3PutNoTLS(t *testing.T) { testCtl(t, putTest, withCfg(configNoTLS)) } func TestCtlV3PutClientTLS(t *testing.T) { testCtl(t, putTest, withCfg(configClientTLS)) } func TestCtlV3PutClientAutoTLS(t *testing.T) { testCtl(t, putTest, withCfg(configClientAutoTLS)) } diff --git a/tests/e2e/ctl_v3_lock_test.go b/tests/e2e/ctl_v3_lock_test.go index 6bcbe4de2..3e1332976 100644 --- a/tests/e2e/ctl_v3_lock_test.go +++ b/tests/e2e/ctl_v3_lock_test.go @@ -84,7 +84,7 @@ func testLock(cx ctlCtx) { if err = holder.Signal(os.Interrupt); err != nil { cx.t.Fatal(err) } - if err = closeWithTimeout(holder, time.Second); err != nil { + if err = closeWithTimeout(holder, 200*time.Millisecond+time.Second); err != nil { cx.t.Fatal(err) } diff --git a/tests/e2e/ctl_v3_snapshot_test.go b/tests/e2e/ctl_v3_snapshot_test.go index 632b05776..0df7a5f9d 100644 --- a/tests/e2e/ctl_v3_snapshot_test.go +++ b/tests/e2e/ctl_v3_snapshot_test.go @@ -43,7 +43,7 @@ func snapshotTest(cx ctlCtx) { cx.t.Fatalf("snapshot: ctlV3Put error (%v)", err) } - fpath := "test.snapshot" + fpath := "test1.snapshot" defer os.RemoveAll(fpath) if err = ctlV3SnapshotSave(cx, fpath); err != nil { @@ -65,7 +65,7 @@ func snapshotTest(cx ctlCtx) { func TestCtlV3SnapshotCorrupt(t *testing.T) { testCtl(t, snapshotCorruptTest) } func snapshotCorruptTest(cx ctlCtx) { - fpath := "test.snapshot" + fpath := "test2.snapshot" defer os.RemoveAll(fpath) if err := ctlV3SnapshotSave(cx, fpath); err != nil { @@ -98,7 +98,7 @@ func snapshotCorruptTest(cx ctlCtx) { func TestCtlV3SnapshotStatusBeforeRestore(t *testing.T) { testCtl(t, snapshotStatusBeforeRestoreTest) } func snapshotStatusBeforeRestoreTest(cx ctlCtx) { - fpath := "test.snapshot" + fpath := "test3.snapshot" defer os.RemoveAll(fpath) if err := ctlV3SnapshotSave(cx, fpath); err != nil {