github.com/aergoio/aergo@v1.3.1/consensus/impl/raftv2/test/test_member.sh (about) 1 #!/usr/bin/env bash 2 echo "================= raft member add/remove test ====================" 3 source test_common.sh 4 5 BP_NAME="" 6 7 #rm BP*.toml 8 #./aergoconf-gen.sh 10001 tmpl.toml 5 9 #clean.sh 10 #./inittest.sh 11 rm BP11004* BP11005* 12 13 echo "kill_svr & clean 11004~11007" 14 kill_svr.sh 15 for i in 11004 11005 11006 11007; do 16 rm -rf ./data/$i 17 rm -rf ./BP$i.toml 18 done 19 20 TEST_SKIP_GENESIS=0 make_node.sh 21 RUN_TEST_SCRIPT set_system_admin.sh 22 23 date 24 echo "" 25 echo "========= add aergo4 =========" 26 add_member.sh aergo4 27 if [ "$?" != "0" ];then 28 echo "fail to add" 29 exit 100 30 fi 31 checkSync 10001 10004 120 32 33 date 34 echo "" 35 echo "========= add aergo5 =========" 36 add_member.sh aergo5 37 if [ "$?" != "0" ];then 38 echo "fail to add" 39 exit 100 40 fi 41 checkSync 10001 10005 120 42 43 44 date 45 echo "" 46 echo "========= add aergo6 =========" 47 add_member.sh aergo6 48 if [ "$?" != "0" ];then 49 echo "fail to add" 50 exit 100 51 fi 52 checkSync 10001 10006 120 result 53 54 55 date 56 echo "" 57 echo "========= add aergo7 =========" 58 add_member.sh aergo7 59 if [ "$?" != "0" ];then 60 echo "fail to add" 61 exit 100 62 fi 63 checkSync 10001 10007 120 64 65 date 66 echo "" 67 echo "========= rm aergo7 =========" 68 rm_member.sh aergo7 69 if [ "$?" != "0" ];then 70 echo "fail to rm" 71 exit 100 72 fi 73 rm BP11007* 74 checkSync 10001 10006 60 75 76 echo "" 77 echo "========= rm aergo6 =========" 78 rm_member.sh aergo6 79 if [ "$?" != "0" ];then 80 echo "fail to rm" 81 exit 100 82 fi 83 rm BP11006* 84 checkSync 10001 10005 60 85 86 echo "" 87 echo "========= rm aergo5 =========" 88 rm_member.sh aergo5 89 if [ "$?" != "0" ];then 90 echo "fail to rm" 91 exit 100 92 fi 93 rm BP11005* 94 checkSync 10001 10004 60 95 96 echo "" 97 echo "========= rm aergo4 =========" 98 rm_member.sh aergo4 99 if [ "$?" != "0" ];then 100 echo "fail to rm" 101 exit 100 102 fi 103 rm BP11004* 104 checkSync 10001 10003 60 105 106 echo "" 107 echo "========= check if reorg occured =======" 108 checkReorg