diff --git a/unit-tests/001_init-catchup.txt b/unit-tests/001_init-catchup.txt index 102864b..c67fb52 100644 --- a/unit-tests/001_init-catchup.txt +++ b/unit-tests/001_init-catchup.txt @@ -1,48 +1,37 @@ # vim: ft=sh et : ticket: state ST_INIT last_ack_ballot 1 new_ballot 2012 # No message0 # expecting catchup query # outgoing packet: expect this data outgoing0: header.cmd CMD_CATCHUP header.result RLT_SUCCESS -# ignore "bad" catchup data -message1: - header.from booth_conf->site[2].site_id - header.cmd CMR_CATCHUP - header.result 243521741 - -outgoing1: - header.cmd CMD_CATCHUP - header.result RLT_SUCCESS - - # should be accepted message2: # valid CMR_CATCHUP header.cmd CMR_CATCHUP header.result RLT_SUCCESS header.from booth_conf->site[2].site_id ticket.ballot 2062 ticket.prev_ballot 2052 ticket.owner -1 # nothing goes out # after a delay, check final state finally: # should be overwritten last_ack_ballot 2052 # should not be - a OP_PREPARING would fetch the new value new_ballot 2012 # too low-level # proposal_acknowledges 5 diff --git a/unit-tests/002_bad_packets.txt b/unit-tests/002_bad_packets.txt new file mode 100644 index 0000000..b00c497 --- /dev/null +++ b/unit-tests/002_bad_packets.txt @@ -0,0 +1,34 @@ +# vim: ft=sh et : +# +# This test is mostly concerned with ignoring invalid packets. +# We're expecting catchup queries. + + +ticket: + state ST_INIT + last_ack_ballot 1 + new_ballot 2012 + + +# defaults +message: + header.cmd CMR_CATCHUP + ticket.ballot 99 + ticket.prev_ballot 98 + + +message0: "bad result code" + header.from booth_conf->site[2].site_id + header.result 243521741 + +outgoing0: + state ST_INIT + + +message1: "bad sender" + header.from 71 + header.result 0 + +outgoing1: + state ST_INIT +