From: Mark Tearle Date: Sun, 29 Mar 2015 10:02:48 +0000 (+0800) Subject: Initial scaffold for test scripts X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;h=712674f9fdeeb9ae3a135d43612246e8c1e8188e;p=uccvend-vagrant.git Initial scaffold for test scripts --- diff --git a/scripts/BuildAndInstall.sh b/scripts/BuildAndInstall.sh new file mode 100755 index 0000000..a586415 --- /dev/null +++ b/scripts/BuildAndInstall.sh @@ -0,0 +1,54 @@ +#!/bin/bash + +# BuildAndInstall.sh + +# This script will build the various bits of the UCC Vend infrastructure +# and run their install scripts + +# error handling +abort() +{ + echo >&2 '*** ABORTED ***' + echo "An error occurred. Exiting..." >&2 + exit 1 +} + +trap 'abort' 0 + +set -e + +# If an error occurs, the abort() function will be called. +#---------------------------------------------------------- + + +CODEDIR=/vagrant/code + +# build and install dispense + +cd $CODEDIR/opendispense2/src + +make +sudo make install + +# build SNACKROM + +cd $CODEDIR/uccvend-snackrom/ROM2 + +make + +# vendserver + +cd $CODEDIR/uccvend-vendserver + +python setup.py build +sudo python setup.py install + +# virtualsnack +# virtualcoke + +# for the moment, until these are changed to use setuptools, left +# in /vagrant/code + +# Done! +trap : 0 + diff --git a/scripts/InitialConfig.sh b/scripts/InitialConfig.sh new file mode 100755 index 0000000..ab17ded --- /dev/null +++ b/scripts/InitialConfig.sh @@ -0,0 +1,35 @@ +#!/bin/bash + +# InitialConfig.sh + +# This script will set up some initial users with some +# credit and add them to various groups to allow them to do various things + +# error handling +abort() +{ + echo >&2 '*** ABORTED ***' + echo "An error occurred. Exiting..." >&2 + exit 1 +} + +trap 'abort' 0 + +set -e + +# If an error occurs, the abort() function will be called. +#---------------------------------------------------------- + +# Setup some users + +# alice - run of the mill UCC user +# bob - wheel member +# chuck - committee member +# dave - expired user +# eve - second run of mill UCC user +# murphy - wheel and coke/door member + + +# Done! +trap : 0 + diff --git a/scripts/RunTestEnvironment.sh b/scripts/RunTestEnvironment.sh new file mode 100755 index 0000000..01dd906 --- /dev/null +++ b/scripts/RunTestEnvironment.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +# InitialConfig.sh + +# This script will run a test environment inside tmux + +# error handling +abort() +{ + echo >&2 '*** ABORTED ***' + echo "An error occurred. Exiting..." >&2 + exit 1 +} + +trap 'abort' 0 + +set -e + +# If an error occurs, the abort() function will be called. +#---------------------------------------------------------- + + +# Done! +trap : 0 +