@@ -117,6 +117,20 @@ Describe "Etcd Member Join Script Tests"
117117 ' "Name" : ""' \
118118 ' "PeerURL" : "http://ETCD-1.ETCD-HEADLESS.DEFAULT.SVC.CLUSTER.LOCAL.:2380"' ' '
119119 ;;
120+ duplicate-canonical-owners)
121+ printf ' %s\n' \
122+ ' "ID" : 0' \
123+ ' "Name" : "etcd-0"' \
124+ ' "PeerURL" : "http://etcd-0.etcd-headless.default.svc.cluster.local:2380"' \
125+ ' "ClientURL" : "http://etcd-0.etcd-headless.default.svc.cluster.local:2379"' ' ' \
126+ ' "ID" : 1' \
127+ ' "Name" : "etcd-1"' \
128+ ' "PeerURL" : "http://etcd-1.etcd-headless.default.svc.cluster.local:2380"' \
129+ ' "ClientURL" : "http://etcd-1.etcd-headless.default.svc.cluster.local:2379"' ' ' \
130+ ' "ID" : 2' \
131+ ' "Name" : ""' \
132+ ' "PeerURL" : "http://ETCD-1.ETCD-HEADLESS.DEFAULT.SVC.CLUSTER.LOCAL.:2380"' ' '
133+ ;;
120134 unstarted-target-only)
121135 printf ' %s\n' \
122136 ' "ID" : 1' \
@@ -315,6 +329,30 @@ Describe "Etcd Member Join Script Tests"
315329 The output should eq " name-conflict"
316330 End
317331
332+ It " fails closed when started and unstarted members share a canonical peer URL"
333+ write_fields \
334+ ' "ID" : 1' ' "Name" : "etcd-1"' \
335+ ' "PeerURL" : "http://etcd-1.example:2380"' ' ' \
336+ ' "ID" : 2' ' "Name" : ""' \
337+ ' "PeerURL" : "http://ETCD-1.EXAMPLE.:2380"' ' '
338+ When call classify_fixture " $TEST_DIR /member-list.fields" etcd-1 \
339+ http://etcd-1.example:2380
340+ The status should be failure
341+ The output should eq " "
342+ End
343+
344+ It " fails closed when two unstarted members share a canonical peer URL"
345+ write_fields \
346+ ' "ID" : 1' ' "Name" : ""' \
347+ ' "PeerURL" : "http://etcd-1.example:2380"' ' ' \
348+ ' "ID" : 2' ' "Name" : ""' \
349+ ' "PeerURL" : "http://ETCD-1.EXAMPLE.:2380"' ' '
350+ When call classify_fixture " $TEST_DIR /member-list.fields" etcd-1 \
351+ http://etcd-1.example:2380
352+ The status should be failure
353+ The output should eq " "
354+ End
355+
318356 It " classifies the same name with another URL as a name conflict"
319357 write_fields \
320358 ' "ID" : 1' \
@@ -359,12 +397,13 @@ Describe "Etcd Member Join Script Tests"
359397 The output should eq " name-conflict"
360398 End
361399
362- It " gives an exact member plus same-URL foreign-name ghost a conflict verdict "
400+ It " fails closed for exact and foreign-name owners of the same peer URL "
363401 write_fields \
364402 ' "ID" : 1' ' "Name" : "etcd-1"' ' "PeerURL" : "http://target:2380"' ' ' \
365403 ' "ID" : 2' ' "Name" : "other"' ' "PeerURL" : "http://target:2380"' ' '
366404 When call classify_fixture " $TEST_DIR /member-list.fields" etcd-1 http://target:2380
367- The output should eq " peer-conflict"
405+ The status should be failure
406+ The output should eq " "
368407 End
369408
370409 It " accepts an exact member when one of multiple peer URLs matches"
@@ -669,6 +708,16 @@ Describe "Etcd Member Join Script Tests"
669708 The contents of file " $MEMBER_JOIN_READ_COUNT " should eq " 1"
670709 End
671710
711+ It " fails closed before mutation when canonical target ownership is ambiguous"
712+ set_member_states duplicate-canonical-owners
713+ When call add_member
714+ The status should be failure
715+ The error should include " phase: member-list-invalid"
716+ The error should include " next-retry-safe: no"
717+ The contents of file " $MEMBER_JOIN_CALL_LOG " should eq " "
718+ The contents of file " $MEMBER_JOIN_READ_COUNT " should eq " 1"
719+ End
720+
672721 It " closes an exact replay even when the target is the only current contact"
673722 set_member_states exact-only
674723 When call add_member
0 commit comments