6 $1 -h|--host=<hostname> -e|--engine=<vmengine> -c|--config=<config>
7 config use the syntax used in test/config/default file
12 scriptdir=`dirname $0`/../scripts
13 configdir=`dirname $0`/../config
15 # Loading default config
16 if [ -f $configdir/default ]
20 echo "Something went wrong, could not find default config: $configdir/default"
24 options=`getopt -o h:e:c: -l host:,engine:,config: -- "$@"`
29 eval set -- "$options"
34 -e|--engine) VMENGINE=$2; shift 2;;
35 -h|--host) HOST=$2; shift 2;;
36 -c|--config) CONFIG=$2; shift 2;;
42 # Loading specific config
43 if [ -f $configdir/`hostname` ]
45 echo "Using specific config: $configdir/`hostname`"
46 . $configdir/`hostname`
48 echo "Using default config"
51 # Host can be defined by env var
54 echo "host not defined"
59 BASEHOST=`echo $HOST|cut -d. -f1`
63 eval "$BASEHOST=$CONFIG"
66 # Now let's look if host/engine is defined in config
67 IFS=: ; VARS=`eval echo \\\$$BASEHOST` ; unset IFS ;
72 echo "$BASEHOST=`eval echo \\\$$BASEHOST`"
73 export HOST BASEHOST $BASEHOST
77 # Here VM engine must be defined by env var
82 echo "VM engine not defined"
88 # Start script for this engine must exist
89 if [ ! -x $scriptdir/${VMENGINE}/start ]
91 echo "Don't know how to run ${VMENGINE} engine"
92 echo "$scriptdir/${VMENGINE}/start not found"
95 $scriptdir/${VMENGINE}/start
98 # Loop until engine is up and ssh is running
99 ssh -o 'StrictHostKeyChecking=no' "root@$HOST" uname -a
101 for loop in 1 2 3 4 5 6 7 8 9
104 if [ $ret -ne 0 ];then
107 ssh -o 'StrictHostKeyChecking=no' "root@$HOST" uname -a