3 # cd in this command's directory
6 #Getting the env. as passed by the test framework
7 # expected vars are MACADDR, NODE_ISO, HOSTNAME and TARGET_ARCH
9 if [ ! -e ${CONFIG} ];then
10 echo "File for node_iso version not found"
15 # the launcher, depending on local/target archs
16 archs="$(uname-i)+$(TARGET_ARCH)"
18 i386+i386) QEMU= qemu;;
19 i386+x86_64) QEMU= qemu-system-x86_64;;
20 x86_64+i386) QEMU= qemu;;
21 x86_64+x86_64) QEMU= qemu-system-x86_64;;
29 TAP="tap,script=$SCRIPT"
31 #Creating new HDA if needed only
32 #using qcow2 disk image format which is essential to support VM snapshots
36 echo "Creating hard disk (10G) for Qemu install under $HDA"
37 img=$(qemu-img create -f qcow2 $HDA 10G)
39 echo "Can't Create disk image..."
44 echo "New $HDA is created..."
48 #Command for running the Qemu Emulator
49 ARGS="-boot d -net nic,macaddr=${MACADDR} -net $TAP, -cdrom ${NODE_ISO} -hda ${HDA} -m ${RAM} -nographic -pidfile qemu.pid"
50 echo "Running $QEMU $ARGS < /dev/null"
51 exec $QEMU $ARGS < /dev/null