Skip to content

Commit bde7976

Browse files
committed
Add distributed testing script
1 parent ba3b4bc commit bde7976

1 file changed

Lines changed: 49 additions & 0 deletions

File tree

testing/injectFaults.sh

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
#! /bin/bash
2+
3+
if [ $# -lt 2 ]; then
4+
echo "Usage: injectFaults.sh <BW2 EC2-based DR IP> <SSH Key>"
5+
exit 1
6+
fi
7+
8+
# Local agent failure
9+
echo "Testing local agent failure..."
10+
systemctl stop bw2
11+
sleep 35s
12+
systemctl start bw2
13+
sleep 35s
14+
echo "Complete"
15+
16+
# Remote router failure
17+
echo "Testing remote designated router failure"
18+
ssh -i $2 ubuntu@$1 << EOF
19+
sudo systemctl stop bw2
20+
sleep 35s
21+
sudo systemctl start bw2
22+
EOF
23+
sleep 35s
24+
echo "Complete"
25+
26+
# Second remote router failure, induces local agent failure as well (Due to a bw2 bug)
27+
# DR dies -> agent dies -> agent recovers -> DR recovers
28+
echo "Testing second remote DR failure, induces local agent failure"
29+
ssh -i $2 ubuntu@$1 << EOF
30+
sudo systemctl stop bw2
31+
sleep 1m
32+
sudo systemctl start bw2
33+
EOF
34+
sleep 35s
35+
echo "Complete"
36+
37+
# Local agent failure followed by remote router failure
38+
echo "Testing agent failure followed by DR failure"
39+
systemctl stop bw2
40+
sleep 20s
41+
ssh -i $2 ubuntu@$1 << EOF
42+
sudo systemctl stop bw2
43+
sleep 35s
44+
sudo systemctl start bw2
45+
EOF
46+
sleep 30s
47+
systemctl start bw2
48+
sleep 35s
49+
echo "Complete"

0 commit comments

Comments
 (0)