Commit 6964284d authored by Stavros Sachtouris's avatar Stavros Sachtouris

Test server actions with curl

parent 5b8ea76f
...@@ -75,6 +75,98 @@ cat vm.info; ...@@ -75,6 +75,98 @@ cat vm.info;
echo echo
echo echo
echo "STOP the server"
echo "Meaning: kamaki server shutdown"
ACTION="stop"
ACT="${BASE_CMD} -X POST ${VM_URL}?action=${ACTION} -H 'Category: ${ACTION} ;\
scheme=\"http://schemas.ogf.org/occi/infrastructure/compute/action#\"; class=\"action\"'"
echo "$CMD"
eval $ACT
echo "Check server state"
echo $CMD
eval $CMD
STATE=(`awk '/occi.compute.state/{n=split($0,a,"\""); print a[2];}' vm.info`)
WAIT=1;
while [ $STATE != 'inactive' ]
do
echo "Server state is ${STATE}"
echo "wait ${WAIT}\" and check again"
sleep $WAIT;
let "WAIT++";
echo "$CMD";
eval $CMD;
STATE=(`awk '/occi.compute.state/{n=split($0,a,"\""); print a[2];}' vm.info`)
done;
cat vm.info;
echo
echo
echo "START the server"
echo "Meaning: kamaki server start"
ACTION="start"
ACT="${BASE_CMD} -X POST ${VM_URL}?action=${ACTION} -H 'Category: ${ACTION} ;\
scheme=\"http://schemas.ogf.org/occi/infrastructure/compute/action#\"; class=\"action\"'"
echo "$CMD"
eval $ACT
echo "Check server state"
echo $CMD
eval $CMD
STATE=(`awk '/occi.compute.state/{n=split($0,a,"\""); print a[2];}' vm.info`)
WAIT=1;
while [ $STATE != 'active' ]
do
echo "Server state is ${STATE}"
echo "wait ${WAIT}\" and check again"
sleep $WAIT;
let "WAIT++";
echo "$CMD";
eval $CMD;
STATE=(`awk '/occi.compute.state/{n=split($0,a,"\""); print a[2];}' vm.info`)
done;
cat vm.info;
echo
echo
echo "RESTART the server"
echo "Meaning: kamaki server restart"
ACTION="restart"
ACT="${BASE_CMD} -X POST ${VM_URL}?action=${ACTION} -H 'Category: ${ACTION} ;\
scheme=\"http://schemas.ogf.org/occi/infrastructure/compute/action#\"; class=\"action\"'"
echo "$CMD"
eval $ACT
echo "Check server state"
echo $CMD
eval $CMD
STATE=(`awk '/occi.compute.state/{n=split($0,a,"\""); print a[2];}' vm.info`)
WAIT=1;
while [ $STATE != 'inactive' ]
do
echo "Server state is ${STATE}"
echo "wait ${WAIT}\" and check again"
sleep $WAIT;
let "WAIT++";
echo "$CMD";
eval $CMD;
STATE=(`awk '/occi.compute.state/{n=split($0,a,"\""); print a[2];}' vm.info`)
done
cat vm.info
echo
WAIT=1;
while [ $STATE != 'active' ]
do
echo "Server state is ${STATE}"
echo "wait ${WAIT}\" and check again"
sleep $WAIT;
let "WAIT++";
echo "$CMD";
eval $CMD;
STATE=(`awk '/occi.compute.state/{n=split($0,a,"\""); print a[2];}' vm.info`)
done;
cat vm.info;
echo
echo
echo "Delete the server" echo "Delete the server"
echo "Meaning: kamaki server delete ${VM_URL}" echo "Meaning: kamaki server delete ${VM_URL}"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment