forked from mnielsen/ec2_tools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test_ec2.sh
executable file
·76 lines (60 loc) · 2.42 KB
/
test_ec2.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# Test suite for the ec2.py module
echo -e "\nRunning test suite for the ec2.py module."
echo "Note that test output needs to be inspected manually."
echo -e "\nThis will shut down all running clusters, including clusters that"
echo "may be running other tasks. Do you want to continue (y/n)?"
read choice
if [ $choice = "y" ]
then
echo "Ok, continuing."
else
echo "Okay, quitting"
exit 0
fi
echo -e "\nTest: python ec2.py show_all"
echo "Starting configuration of EC2:"
python ec2.py show_all
echo -e "\nTest: python ec2.py create alpha 2 m1.small"
echo "Creating a cluster named alpha with 2 m1.small instances"
python ec2.py create alpha 2 m1.small
python ec2.py show_all
echo -e "\nTest: 'create' won't create duplicate clusters"
echo "Code: python ec2.py create alpha 1 m1.small"
echo "Trying to create another cluster named alpha (should fail):"
python ec2.py create alpha 1 m1.small
echo -e "\nTest: python ec2.py create beta 1 m1.large"
echo "Creating a cluster named beta with 1 m1.large instance"
python ec2.py create beta 1 m1.large
python ec2.py show_all
echo -e "\nTest: 'create' won't create clusters with more than 20 instances"
echo "Code: python ec2.py create gamma 27 m1.small"
echo "Trying to create a cluster named gamma with 27 m1.small instances"
python ec2.py create gamma 27 m1.small
echo -e "\nTest: python kill alpha 0"
python ec2.py kill alpha 0
python ec2.py show_all
echo -e "\nTest: 'kill' won't kill instances that aren't available"
echo "python ec2.py kill alpha 1"
python ec2.py kill alpha 1
echo -e "\nTest: python ec2.py add alpha 2"
python ec2.py add alpha 2
python ec2.py show_all
echo -e "\nTest: 'add' won't work on clusters that don't exist"
echo "Code: python ec2.py add gamma 1"
python ec2.py add gamma 1
echo -e "\nTest: python ec2.py shutdown alpha"
python ec2.py shutdown alpha
python ec2.py show_all
echo -e "\nTest: python ec2.py create gamma 2 m1.small"
python ec2.py create gamma 2 m1.small
python ec2.py show_all
echo -e "\nTest: python ec2.py shutdown_all"
python ec2.py shutdown_all
python ec2.py show_all
echo -e "\nTest: Using Amazon's EC2 tools to check all instances have shut down"
echo "Code: ec2-describe-instances | grep running"
echo "Output below should be blank if test passes"
ec2-describe-instances | grep running
echo -e "\nNot tested: show, shutdown, login, ssh, ssh_all, scp, scp_all."
echo "Also not tested were externally exported functions exists(),"
echo "public_dns_names(), and size()."