Skip to content

Commit

Permalink
Add a simple test ensuring membership is properly bootstrapped
Browse files Browse the repository at this point in the history
Signed-off-by: Marek Siarkowicz <[email protected]>
  • Loading branch information
serathius committed Nov 24, 2023
1 parent c975f24 commit a968c1f
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions tests/e2e/ctl_v3_member_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -291,3 +291,21 @@ func ctlV3MemberUpdate(cx ctlCtx, memberID, peerURL string) error {
cmdArgs := append(cx.PrefixArgs(), "member", "update", memberID, fmt.Sprintf("--peer-urls=%s", peerURL))
return e2e.SpawnWithExpectWithEnv(cmdArgs, cx.envMap, expect.ExpectedResponse{Value: " updated in cluster "})
}

func TestRemoveNonExistingMember(t *testing.T) {
e2e.BeforeTest(t)
ctx := context.Background()

cfg := e2e.ConfigStandalone(*e2e.NewConfig())
epc, err := e2e.NewEtcdProcessCluster(ctx, t, e2e.WithConfig(cfg))
assert.NoError(t, err)
defer epc.Close()
c := epc.Etcdctl()

_, err = c.MemberRemove(ctx, 1)
assert.Error(t, err)

// Ensure that membership is properly bootstrapped.
err = epc.Restart(ctx)
assert.NoError(t, err)
}

0 comments on commit a968c1f

Please sign in to comment.