From a968c1f5b392cdca89d346f4e46fb28a8e0cc6b3 Mon Sep 17 00:00:00 2001 From: Marek Siarkowicz Date: Fri, 24 Nov 2023 12:20:22 +0100 Subject: [PATCH] Add a simple test ensuring membership is properly bootstrapped Signed-off-by: Marek Siarkowicz --- tests/e2e/ctl_v3_member_test.go | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/tests/e2e/ctl_v3_member_test.go b/tests/e2e/ctl_v3_member_test.go index 01bf71c5726..bd045e5f63b 100644 --- a/tests/e2e/ctl_v3_member_test.go +++ b/tests/e2e/ctl_v3_member_test.go @@ -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) +}