Skip to content
Snippets Groups Projects
Commit 7ec716ce authored by Timur Safin's avatar Timur Safin Committed by Kirill Yukhin
Browse files

test: make swim*.test tap-compatible

Updated swim.test, swim_errinj.test, swim_proto.test
to activate TAP-compatible mode.

Part of #7618

NO_DOC=internal
NO_CHANGELOG=internal
parent 0c257c93
No related branches found
No related tags found
No related merge requests found
*** main_f ***
1..23
*** swim_test_one_link ***
1..6
ok 1 - no rounds - no fullmesh
ok 2 - one link
ok 3 - self 0 is alive
ok 4 - self 1 is alive
ok 5 - 0 sees 1 as alive
ok 6 - 1 sees 0 as alive
ok 1 - subtests
*** swim_test_one_link: done ***
*** swim_test_sequence ***
1..1
ok 1 - sequence
ok 2 - subtests
*** swim_test_sequence: done ***
*** swim_test_uuid_update ***
1..7
ok 1 - UUID update
ok 2 - old UUID is marked as 'left'
ok 3 - old UUID is dropped after a while
ok 4 - dropped everywhere
ok 5 - two members in each
ok 6 - can not update to an existing UUID - swim_cfg fails
ok 7 - diag says 'exists'
ok 3 - subtests
*** swim_test_uuid_update: done ***
*** swim_test_cfg ***
1..16
ok 1 - first cfg failed - no URI
ok 2 - diag says 'mandatory'
ok 3 - first cfg failed - no UUID
ok 4 - diag says 'mandatory'
ok 5 - configured first time
ok 6 - second time can omit URI, UUID
ok 7 - hearbeat is dynamic
ok 8 - URI is unchanged after recfg with NULL URI
ok 9 - can not use invalid URI
ok 10 - diag says 'invalid uri'
ok 11 - can not use domain names
ok 12 - diag says 'invalid uri'
ok 13 - UNIX sockets are not supported
ok 14 - diag says 'only IP'
ok 15 - can not bind to an occupied port
ok 16 - diag says 'bind'
ok 4 - subtests
*** swim_test_cfg: done ***
*** swim_test_add_remove ***
1..14
ok 1 - can not add an existing member
ok 2 - diag says 'already exists'
ok 3 - can not add a invalid uri
ok 4 - diag says 'invalid uri'
ok 5 - can not remove self
ok 6 - diag says the same
ok 7 - find by UUID works
ok 8 - now remove one element
ok 9 - and it can not be found anymore
ok 10 - remove of a not existing member
ok 11 - after removal the cluster is not in fullmesh
ok 12 - but it is back in 1 step
ok 13 - back in fullmesh after a member removal in the middle of a step
ok 14 - if a referenced member is dropped, it can be detected from the public API
ok 5 - subtests
*** swim_test_add_remove: done ***
*** swim_test_basic_failure_detection ***
1..9
ok 1 - node is added as alive
ok 2 - member still is not suspected after 1 noack
ok 3 - but it is suspected after one more
ok 4 - it is not dead after 2 more noacks
ok 5 - but it is dead after one more
ok 6 - after 2 more unacks the member still is not deleted - dissemination TTD keeps it
ok 7 - but it is dropped after 2 rounds when TTD gets 0
ok 8 - fullmesh is restored
ok 9 - a member is added back on an ACK
ok 6 - subtests
*** swim_test_basic_failure_detection: done ***
*** swim_test_probe ***
1..3
ok 1 - probe validates URI
ok 2 - send probe
ok 3 - receive ACK on probe and get fullmesh
ok 7 - subtests
*** swim_test_probe: done ***
*** swim_test_refute ***
1..6
ok 1 - S2 increments its own incarnation to refute its suspicion
ok 2 - new incarnation has reached S1 with a next round message
ok 3 - after restart S2's version is 0 again
ok 4 - but generation is new
ok 5 - S2 disseminates new incarnation, S1 learns it
ok 6 - and considers S2 alive
ok 8 - subtests
*** swim_test_refute: done ***
*** swim_test_basic_gossip ***
1..4
ok 1 - S1 still thinks that S2 is alive
ok 2 - but one more second, and a second ack timed out - S1 sees S2 as suspected
ok 3 - S3 still thinks that S2 is alive
ok 4 - S3 learns about suspected S2 from S1
ok 9 - subtests
*** swim_test_basic_gossip: done ***
*** swim_test_too_big_packet ***
1..3
ok 1 - despite S1 can not send all the 50 members in a one packet, fullmesh is eventually reached
ok 2 - a dead member is detected in time not depending on cluster size
ok 3 - S26 death is eventually learned by everyone
ok 10 - subtests
*** swim_test_too_big_packet: done ***
*** swim_test_undead ***
1..2
ok 1 - member S2 is dead
ok 2 - but it is never deleted due to the cfg option
ok 11 - subtests
*** swim_test_undead: done ***
*** swim_test_packet_loss ***
1..5
ok 1 - drop rate = 5.00, but the failure is disseminated
ok 2 - drop rate = 10.00, but the failure is disseminated
ok 3 - drop rate = 20.00, but the failure is disseminated
ok 4 - drop rate = 50.00, but the failure is disseminated
ok 5 - drop rate = 90.00, but the failure is disseminated
ok 12 - subtests
*** swim_test_packet_loss: done ***
*** swim_test_quit ***
1..10
ok 1 - 'self' is 'left' immediately after quit
ok 2 - 'quit' is sent to all the members without delays between dispatches
ok 3 - quited member S1 has returned and refuted the old status
ok 4 - another member S2 has taken the quited UUID
ok 5 - S3 did not add S1 back when received its 'quit'
ok 6 - S2 finally got 'quit' message from S1, but with its 'own' UUID - refute it
ok 7 - S3 sees S1 as left
ok 8 - S2 does not see S1 at all
ok 9 - after more time S1 is dropped from S3
ok 10 - and still is not added to S2 - left members can not be added
ok 13 - subtests
*** swim_test_quit: done ***
*** swim_test_uri_update ***
1..2
ok 1 - S1 updated its URI and S2 sees that
ok 2 - S2 still keeps new S1's URI, even received the old one from S3
ok 14 - subtests
*** swim_test_uri_update: done ***
*** swim_test_broadcast ***
1..6
ok 1 - S1 chooses to broadcast with port 2
ok 2 - S2 receives the broadcast from S1
ok 3 - others don't
ok 4 - S1 broadcasts ping without port
ok 5 - now everyone sees S1
ok 6 - fullmesh is reached, and no one link was added explicitly
ok 15 - subtests
*** swim_test_broadcast: done ***
*** swim_test_payload_basic ***
1..11
ok 1 - no payload by default
ok 2 - can not set too big payload
ok 3 - diag says too big
ok 4 - payload is set
ok 5 - version is incremented on each payload update
ok 6 - payload is successfully obtained back
ok 7 - payload is disseminated
ok 8 - payload is changed
ok 9 - version is incremented on each payload update
ok 10 - second payload is disseminated
ok 11 - third payload is disseminated via anti-entropy
ok 16 - subtests
*** swim_test_payload_basic: done ***
*** swim_test_encryption ***
1..3
ok 1 - cluster works with encryption
ok 2 - different encryption keys - can't interact
ok 3 - cluster works after encryption has been disabled
ok 17 - subtests
*** swim_test_encryption: done ***
*** swim_test_slow_net ***
1..0
# slow network leads to idle round steps, they should not produce a new message
ok 18 - subtests
*** swim_test_slow_net: done ***
*** swim_test_triggers ***
1..20
ok 1 - trigger is fired
ok 2 - is not deleted
ok 3 - ctx.member is set
ok 4 - ctx.events is set
ok 5 - self payload is updated
ok 6 - self is set as a member
ok 7 - both version and payload events are presented
ok 8 - suspicion fired a trigger
ok 9 - status suspected
ok 10 - death fired a trigger
ok 11 - status dead
ok 12 - drop fired a trigger
ok 13 - status dropped
ok 14 - dropped member is not presented in the member table
ok 15 - but is in the event context
ok 16 - yielding trigger is fired
ok 17 - non-yielding still is not
ok 18 - trigger is not deleted until all currently sleeping triggers are finished
# now all the triggers are done and deleted
ok 19 - local URI update warns about version update
ok 20 - version is a part of incarnation, so the latter is updated too
ok 19 - subtests
*** swim_test_triggers: done ***
*** swim_test_generation ***
1..3
ok 1 - S1 disseminated its payload to S2
ok 2 - S1 restarted and set another payload. Without generation it could lead to never disseminated new payload.
ok 3 - S2 sees new generation of S1
ok 20 - subtests
*** swim_test_generation: done ***
*** swim_test_dissemination_speed ***
1..2
ok 1 - dissemination work in log time even at the very start of a cluster
ok 2 - dissemination can withstand an event storm
ok 21 - subtests
*** swim_test_dissemination_speed: done ***
*** swim_test_suspect_new_members ***
1..2
ok 1 - S2 dropped S1 as dead
ok 2 - S3 didn't add S1 from S2's messages, because S1 didn't answer on a ping
ok 22 - subtests
*** swim_test_suspect_new_members: done ***
*** swim_test_member_by_uuid ***
1..3
ok 1 - found by UUID
ok 2 - not found by valid UUID
ok 3 - not found by NULL UUID
ok 23 - subtests
*** swim_test_member_by_uuid: done ***
*** main_f: done ***
*** main_f ***
1..2
*** swim_test_payload_refutation ***
1..11
ok 1 - S2 sees new version of S1
ok 2 - S3 does the same
ok 3 - but S2 does not known the new payload
ok 4 - as well as S3
ok 5 - S2 learned S1's payload via anti-entropy
ok 6 - version still is the same
ok 7 - S3 was blocked and does not know anything
ok 8 - version still is the same
ok 9 - S2 keeps the same new S1's payload, S3 did not rewrite it
ok 10 - S3 still does not know anything
ok 11 - S3 learns S1's payload from S2
ok 1 - subtests
*** swim_test_payload_refutation: done ***
*** swim_test_indirect_ping ***
1..2
ok 1 - S1 is never suspected
ok 2 - S2 is never suspected
ok 2 - subtests
*** swim_test_indirect_ping: done ***
*** main_f: done ***
......@@ -34,7 +34,6 @@
#include "tt_uuid.h"
#include "version.h"
#include "msgpuck.h"
#include "unit.h"
#include "swim/swim_proto.h"
#include "swim_test_utils.h"
#include <fcntl.h>
......
*** main ***
1..3
*** swim_test_member_def ***
1..13
ok 1 - not map header
ok 2 - not uint member key
ok 3 - too big member key
ok 4 - STATUS is not uint
ok 5 - invalid STATUS
ok 6 - invalid address
ok 7 - bad port
ok 8 - unexpected buffer end
ok 9 - unexpected buffer end
ok 10 - uuid is nil/undefined
ok 11 - port is 0/undefined
ok 12 - normal member def
ok 13 - zero length bin
ok 1 - subtests
*** swim_test_member_def: done ***
*** swim_test_meta ***
1..8
ok 1 - not map header
ok 2 - not uint meta key
ok 3 - unknown meta key
ok 4 - unexpected end
ok 5 - invalid version
ok 6 - port is 0/undefined
ok 7 - version is 0/undefined
ok 8 - normal meta
ok 2 - subtests
*** swim_test_meta: done ***
*** swim_test_route ***
1..5
ok 1 - route was expected, but map is too short
ok 2 - no route map
ok 3 - empty route map
ok 4 - zero addresses
ok 5 - normal route
ok 3 - subtests
*** swim_test_route: done ***
*** main: done ***
......@@ -32,7 +32,6 @@
*/
#include <stdbool.h>
#include "tt_uuid.h"
#include "unit.h"
#include "fiber.h"
#include "uri/uri.h"
#include "swim/swim.h"
......@@ -41,6 +40,9 @@
#include "fakesys/fakenet.h"
#include "fakesys/fakeev.h"
#define UNIT_TAP_COMPATIBLE 1
#include "unit.h"
struct swim_cluster;
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment