summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMicah Anderson <micah@riseup.net>2015-04-09 12:54:46 -0400
committerMicah Anderson <micah@riseup.net>2015-04-09 12:54:46 -0400
commite379106d3bd0989207dc67c7312e89a9e4e4b578 (patch)
treeeed9fc9eeb5dfdec05c4f2b7d03764e7dca2c73c
parentaee0b7f834df78db370aaa81ab0143fc82a97f33 (diff)
add destroy_deploy function that will remove the vagrant nodes (with
leap local destroy $vm), then run a bootstrap_nodes() on the nodes, which will do a leap local start on the node, then a leap node init, and then a leap deploy. This should do a full cycle test
-rwxr-xr-xleap-platform-test39
1 files changed, 26 insertions, 13 deletions
diff --git a/leap-platform-test b/leap-platform-test
index 1e0ff6e..44c38cd 100755
--- a/leap-platform-test
+++ b/leap-platform-test
@@ -12,21 +12,22 @@ This script runs the leap platform deploy tests
OPTIONS
- -c|--config file specify config file
- -a|--all run command on all nodes
- -V|--versions show versions/git revision of leap_cli and leap_platoform in provider dir
- -h|--help show help
+ -c|--config file specify config file
+ -a|--all run command on all nodes
+ -V|--versions show versions/git revision of leap_cli and leap_platoform in provider dir
+ -h|--help show help
COMMANDS
- bootstrap <node(s)> bootstrap node(s):
- - leap local start
- - leap node int
- - sets up hostname and runs apt-get dist-upgrade
- - leap local save
- create_provider creates a provider instance
- deploy <node(s)> deploy node(s)
- reset_deploy <node(s)> reset and deploy node(s)
- test <node(s)> run leap test
+ bootstrap <node(s)> bootstrap node(s):
+ - leap local start
+ - leap node int
+ - sets up hostname and runs apt-get dist-upgrade
+ - leap local save
+ create_provider creates a provider instance
+ deploy <node(s)> deploy node(s)
+ destroy_deploy <node(s)> destroy vms, init, and deploy
+ reset_deploy <node(s)> reset and deploy node(s)
+ test <node(s)> run leap test
EOF
}
@@ -51,6 +52,12 @@ add_nodes() {
done
}
+destroy_vms() {
+ for vm in "$@"
+ do
+ $LEAP_CMD local destroy $vm
+ done
+}
bootstrap_nodes() {
@@ -243,6 +250,11 @@ reset_deploy() {
}
+destroy_deploy() {
+ destroy_vms "$@"
+ bootstrap_nodes "$@"
+}
+
ssh_up () {
nc -w 4 "$1" 22 > /dev/null
return $?
@@ -414,6 +426,7 @@ case $cmd in
bootstrap) bootstrap_nodes "$nodes";;
create_provider) create_provider;;
deploy) deploy "$nodes";;
+ destroy_deploy) destroy_deploy "$nodes";;
reset_deploy) reset_deploy "$nodes";;
test) run_tests "$nodes";;
(*) usage; echo "Please specify a command."; exit 1;;