From e379106d3bd0989207dc67c7312e89a9e4e4b578 Mon Sep 17 00:00:00 2001 From: Micah Anderson Date: Thu, 9 Apr 2015 12:54:46 -0400 Subject: 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 --- leap-platform-test | 39 ++++++++++++++++++++++++++------------- 1 file 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 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 deploy node(s) - reset_deploy reset and deploy node(s) - test run leap test + bootstrap 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 deploy node(s) + destroy_deploy destroy vms, init, and deploy + reset_deploy reset and deploy node(s) + test 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;; -- cgit v1.2.3