ovirt-node 2.2.0 release
[ovirt-node.git] / autotest.sh
blob962ea04ecd4acffc3c1dc7bb819ab13168117917
1 #!/bin/bash
3 # oVirt node autotest script
5 # Copyright (C) 2009 Red Hat, Inc.
6 # Written by Darryl L. Pierce <dpierce@redhat.com>
8 # This program is free software; you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License as published by
10 # the Free Software Foundation; version 2 of the License.
12 # This program is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU General Public License for more details.
17 # You should have received a copy of the GNU General Public License
18 # along with this program; if not, write to the Free Software
19 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
20 # MA 02110-1301, USA. A copy of the GNU General Public License is
21 # also available at http://www.gnu.org/copyleft/gpl.html.
23 # To include autotesting on the build system, you need to insert the
24 # following snippet *BEFORE* the text that reads "Output Stages":
25 # ---8<[begin]---
26 # # Integration test
27 # {
28 # name = integration
29 # label = Test group
30 # module = Test::AutoBuild::Stage::Test
31 # # Don't abort entire cycle if the module test fails
32 # critical = 0
33 # }
34 # ---8<[end]---
36 # This will, for each module whose autobuild.sh is run, to have a matching
37 # autotest.sh to run as well.
39 # To run these tests locally, you will need to open port 69 TCP and UDP and have
40 # an ISO file.
42 exit 0
44 ME=$(basename "$0")
45 WORKDIR=$(mktemp -d)
46 warn() { printf '%s: %s\n' "$ME" "$*" >&2; }
47 die() { warn "$*"; exit 1; }
48 debug() { if $debugging; then log "[DEBUG] %s" "$*"; fi }
50 trap '__st=$?; cleanup_after_testing; exit $__st' 1 2 3 13 15
51 trap 'cleanup_after_testing' 0
53 # set -e
54 # set -u
56 log () {
57 date=$(date)
58 printf "${date} $*\n"
61 usage () {
62 cat <<EOF
63 Usage: $ME [-n test_name] [LOGFILE]
64 -i: set the ISO filename (defualt: ovirt-node-image.iso)
65 -n: the name of the specific autotest to run (default: run all autotests)
66 -d: enable more verbose output (default: disabled)
67 -t: change the timeout between markers (in ms, default: 120)
68 -v: enable tracing (default: disabled)
69 -w: launch virt-viewer for each VM (default: no window shown)
70 -h: display this help and exit
71 EOF
74 # $1 - the test function to call
75 execute_test () {
76 local testname=$1
78 if [ -z $testname ]; then die "Missing test name"; fi
80 log "Executing test: $testname"
82 eval $testname
84 rc=$?
85 log "Completed test: $testname [result=$rc]"
87 if [ $rc -ne 0 ]; then
88 log "Build fails smoke tests."
91 return $rc
94 # setup a node for pxeboot
95 # $1 - the working directory
96 # $2 - kernel arguments; if present then they replace all default flags
97 setup_pxeboot () {
98 local workdir=$1
99 local kernelargs=$2
100 local pxedefault=$workdir/tftpboot/pxelinux.cfg/default
102 debug "setup for pxeboot: isofile=${isofile} workdir=${workdir} kernelargs='${kernelargs}' pxedefault=${pxedefault}"
103 (cd $workdir && sudo livecd-iso-to-pxeboot $isofile) > /dev/null 2>&1
104 sudo chmod -R 777 $workdir
106 # set default kernel arguments if none were provided
107 # the defaults boot in standalone mode
108 if [ -z "$kernelargs" ]; then
109 kernelargs="standalone"
112 local definition="DEFAULT pxeboot"
113 definition="${definition}\nTIMEOUT 20"
114 definition="${definition}\nPROMPT 0"
115 definition="${definition}\nLABEL pxeboot"
116 definition="${definition}\n KERNEL vmlinuz0"
117 definition="${definition}\n IPAPPEND 2"
118 definition="${definition}\n APPEND rootflags=loop initrd=initrd0.img root=/${isoname} rootfstype=auto console=tty0 check console=ttyS0,115200n8 $kernelargs"
120 debug "pxeboot definition=\n${definition}"
121 sudo bash -c "printf \"${definition}\" > $pxedefault"
124 # Starts a simple instance of dnsmasq.
125 # $1 - the iface on which dnsmasq works
126 # $2 - the root for tftp files
127 # $3 - the mac address for the node (ignored if blank)
128 # $4 - the nodename
129 start_dnsmasq () {
130 local iface=$1
131 local tftproot=$2
132 local macaddress=$3
133 local nodename=$4
134 local pidfile=$2/dnsmasq.pid
136 stop_dnsmasq
137 debug "Starting dnsmasq"
138 dns_startup="sudo /usr/sbin/dnsmasq --read-ethers
139 --dhcp-range=${NETWORK}.100,${NETWORK}.254,255.255.255.0,24h
140 --conf-file=
141 --interface=${iface}
142 --bind-interfaces
143 --except-interface=lo
144 --dhcp-boot=tftpboot/pxelinux.0
145 --enable-tftp
146 --tftp-root=${tftproot}
147 --log-facility=$WORKDIR/dnsmasq-${nodename}.log
148 --log-queries
149 --log-dhcp
150 --pid-file=${pidfile}"
151 if [ -n "$macaddress" ]; then
152 dns_startup="${dns_startup} --dhcp-host=${macaddress},${NODE_ADDRESS}"
154 # start dnsmasq
155 eval $dns_startup
156 debug "pidfile=$pidfile"
157 DNSMASQ_PID=$(sudo cat $pidfile)
158 debug "DNSMASQ_PID=${DNSMASQ_PID}"
161 # Kills the running instance of dnsmasq.
162 stop_dnsmasq () {
163 if [ -n "${DNSMASQ_PID-}" -a "${DNSMASQ_PID-}" != "0" ]; then
164 local check=$(ps -ef | awk "/${DNSMASQ_PID}/"' { if ($2 ~ '"${DNSMASQ_PID}"') print $2 }')
166 if [[ "${check}" == "${DNSMASQ_PID}" ]]; then
167 sudo kill -9 $DNSMASQ_PID
168 return
171 DNSMASQ_PID="0"
174 # Creates a virt network.
175 # $1 - the node name
176 # $2 - the network interface name
177 # $3 - use DHCP (any value)
178 # $4 - start dnsmsq (def. false)
179 start_networking () {
180 local nodename=$1
181 local ifacename=$2
182 local use_dhcp=${3-false}
183 local start_dnsmasq=${4-false}
184 local workdir=$5
185 local definition=""
186 local network=$NETWORK
187 local xmlfile=$WORKDIR/$nodename-$ifacename.xml
189 debug "start_networking ()"
190 for var in nodename ifacename use_dhcp start_dnsmasq workdir network xmlfile; do
191 eval debug "::$var: \$$var"
192 done
194 definition="<network>\n<name>${ifacename}</name>\n<forward mode='nat' />\n<bridge name='${ifacename}' stp='on' forwardDelay='0' />"
195 definition="${definition}\n<ip address='${network}.1' netmask='255.255.255.0'>"
196 if $use_dhcp; then
197 definition="${definition}\n<dhcp>\n<range start='${network}.100' end='${network}.199' />\n</dhcp>"
199 definition="${definition}\n</ip>\n</network>"
201 debug "Saving network definition file to: ${xmlfile}\n"
202 sudo printf "${definition}" > $xmlfile
203 sudo virsh net-define $xmlfile > /dev/null 2>&1
204 debug "Starting network."
205 sudo virsh net-start $ifacename > /dev/null 2>&1
207 if [ "${use_dhcp}" == "false" ]; then
208 if $start_dnsmasq; then
209 start_dnsmasq $ifacename $workdir "" $nodename
214 # Destroys the test network interface
215 # $1 - the network name
216 # $2 - stop dnsmasq (def. false)
217 stop_networking () {
218 local networkname=${1-}
219 local stop_dnsmasq=${2-true}
221 # if no network was supplied, then check for the global network
222 if [ -z "$networkname" ]; then
223 networkname=${NETWORK_NAME-}
226 # exit if preserve was enabled
227 if $preserve_vm; then return; fi
229 if [ -n "${networkname}" ]; then
230 debug "Destroying network interface: ${networkname}"
231 check=$(sudo virsh net-list --all)
232 if [[ "${check}" =~ "${networkname}" ]]; then
233 if [[ "{$check}" =~ active ]]; then
234 sudo virsh net-destroy $networkname > /dev/null 2>&1
236 sudo virsh net-undefine $networkname > /dev/null 2>&1
240 if $stop_dnsmasq; then
241 stop_dnsmasq
245 # creates a HD disk file
246 # $1 - filename for disk file
247 # $2 - size (##M or ##G)
248 create_hard_disk () {
249 local filename=$1
250 local size=$2
252 debug "Creating hard disk: filename=${filename} size=${size}"
253 sudo qemu-img create -f raw $filename "${size}M" > /dev/null 2>&1
254 sudo chcon -t virt_image_t $filename > /dev/null 2>&1
257 # Creates the XML for a virtual machine.
258 # $1 - the file to write the xml
259 # $2 - the node name
260 # $3 - memory size (in kb)
261 # $4 - boot device
262 # $5 - the local hard disk (if blank then no disk is used)
263 # $6 - the cdrom disk (if blank then no cdrom is used)
264 # $7 - the network bridge (if blank then 'default' is used)
265 # $8 - optional arguments
266 define_node () {
267 local filename=$1
268 local nodename=$2
269 local memory=$3
270 local boot_device=$4
271 local harddrive=$5
272 local cddrive=$6
273 local bridge=${7-default}
274 local options=${8-}
275 local result=""
277 # flexible options
278 # define defaults, then allow the caller to override them as needed
279 local arch=$(uname -i)
280 local serial="true"
281 local vncport="-1"
282 local bootdev='hd'
284 # first destroy the node
285 destroy_node $nodename
287 if [ -n "$options" ]; then eval "$options"; fi
289 debug "define_node ()"
290 for var in filename nodename memory harddrive cddrive bridge options arch serial vncport bootdev; do
291 eval debug "::$var: \$$var"
292 done
294 result="<domain type='kvm'>\n<name>${nodename}</name>\n<memory>${memory}</memory>\n <vcpu>1</vcpu>"
296 # begin the os section
297 # inject the boot device
298 result="${result}\n<os>\n<type arch='${arch}' machine='pc'>hvm</type>"
299 result="${result}\n<boot dev='${boot_device}' />"
300 result="${result}\n</os>"
302 # virtual machine features
303 result="${result}\n<features>"
304 result="${result}\n<acpi />"
305 if [ -z "${noapic-}" ]; then result="${result}\n<apic />"; fi
306 result="${result}\n<pae /></features>"
307 result="${result}\n<clock offset='utc' />"
308 result="${result}\n<on_poweroff>destroy</on_poweroff>"
309 result="${result}\n<on_reboot>restart</on_reboot>"
310 result="${result}\n<on_crash>restart</on_crash>"
312 # add devices
313 result="${result}\n<devices>"
314 # inject the hard disk if defined
315 if [ -n "$harddrive" ]; then
316 debug "Adding a hard drive to the node"
317 result="${result}\n<disk type='file' device='disk'>"
318 result="${result}\n<source file='$harddrive' />"
319 result="${result}\n<target dev='vda' bus='virtio' />"
320 result="${result}\n</disk>"
322 # inject the cdrom drive if defined
323 if [ -n "$cddrive" ]; then
324 debug "Adding a CDROM drive to the node"
325 result="${result}\n<disk type='file' device='cdrom'>"
326 result="${result}\n<source file='${cddrive}' />"
327 result="${result}\n<target dev='hdc' bus='ide' />"
328 result="${result}\n</disk>"
330 # inject the bridge network
331 result="${result}\n<interface type='network'>"
332 result="${result}\n<source network='${bridge}' />"
333 result="${result}\n</interface>"
334 # inject the serial port
335 if [ -n "$serial" ]; then
336 result="${result}\n<serial type='pty' />"
338 # inject the vnc port
339 if [ -n "$vncport" ]; then
340 result="${result}\n<console type='pty' />"
341 result="${result}\n<graphics type='vnc' port='${vncport}' autoport='yes' keyman='en-us' />"
343 # finish the device section
344 result="${result}\n</devices>"
346 result="${result}\n</domain>"
348 debug "Node definition: ${filename}"
349 sudo printf "$result" > $filename
351 # now define the vm
352 sudo virsh define $filename > /dev/null 2>&1
354 if [ $? != 0 ]; then die "Unable to define virtual machine: $nodename"; fi
357 # $1 - the node name
358 # $2 - the boot device (def. "hd")
359 # $3 - the memory size in kb (def. 524288)
360 # $4 - hard disk size (if blank then no hard disk)
361 # $5 - the cd drive image file (if blank then no cd drive)
362 # $6 - option arguments
363 configure_node () {
364 local nodename=$1
365 local boot_device=$2
366 local memory=$3
367 local hdsize=$4
368 local hdfile=""
369 local cdfile=$5
370 local args=$6
371 local nodefile=$WORKDIR/$nodename.xml
373 if [ -z "${boot_device}" ]; then boot_device="hd"; fi
374 if [ -z "${memory}" ]; then memory="524288"; fi
376 debug "configure_node ()"
377 for var in nodename boot_device memory hdsize hdfile cdfile args nodefile; do
378 eval debug "::$var: \$$var"
379 done
381 # create the hard disk file
382 if [ -n "${hdsize}" ]; then
383 hdfile=$WORKDIR/$nodename-hd.img
384 create_hard_disk $hdfile $hdsize
387 define_node $nodefile $nodename "${memory}" "${boot_device}" "${hdfile}" "${cdfile}" $IFACE_NAME "${args}"
390 # $1 - the node name
391 # $2 - undefine the node (def. true)
392 destroy_node () {
393 local nodename=$1
394 local undefine=${2-true}
396 # if preserving nodes then exit
397 if $preserve_vm; then return; fi
399 if [ -n "${nodename}" ]; then
400 check=$(sudo virsh list --all)
401 if [[ "${check}" =~ "${nodename}" ]]; then
402 if [[ "${check}" =~ running ]]; then
403 sudo virsh destroy $nodename > /dev/null 2>&1
405 if $undefine; then
406 sudo virsh undefine $nodename > /dev/null 2>&1
412 # for each test created, add it to the follow array:
413 tests=''; testcount=0;
415 # $1 - test name
416 add_test () {
417 tests="${tests} $1"
420 # $1 - node name
421 start_virt_viewer () {
422 local nodename=$1
424 sudo virt-viewer $nodename > /dev/null 2>&1&
427 # $1 - the node's name
428 # $2 - kernel arguments
429 # $3 - working directory
430 boot_with_pxe () {
431 local nodename=$1
432 local kernel_args=$2
433 local workdir=$3
435 debug "boot_with_pxe ()"
436 debug "- workdir: ${workdir}"
437 debug "- nodename: ${nodename}"
438 debug "- kernel_args: ${kernel_args}"
440 setup_pxeboot $workdir "${kernel_args}"
442 sudo virsh start $nodename > /dev/null 2>&1
443 if $show_viewer; then
444 start_virt_viewer $nodename
448 # $1 - the node's name
449 boot_from_hd () {
450 local nodename=$1
452 debug "boot_from_hd ()"
453 debug "::nodename: ${nodename}"
455 sudo virsh start $nodename > /dev/null 2>&1
456 if $show_viewer; then
457 start_virt_viewer $nodename
461 # $1 - the node name
462 # $2 - the old boot device
463 # $3 - the new boot device
464 substitute_boot_device () {
465 local nodename=$1
466 local old_device=$2
467 local new_device=$3
468 local new_node_file=$WORKDIR/$nodename-new.xml
470 if [ -n "${nodename}" ]; then
471 local xml=$(sudo virsh dumpxml $nodename | sed "s/boot dev='"${old_device}"'/boot dev='"${new_device}"'/")
473 sudo printf "${xml}" > $new_node_file
475 sudo virsh define $new_node_file
479 add_test "test_stateless_pxe"
480 test_stateless_pxe () {
481 local nodename="${vm_prefix}-stateless-pxe"
482 local workdir=$WORKDIR
484 start_networking $nodename $IFACE_NAME false true $workdir
486 configure_node "${nodename}" "network" "" "10000" "" "local noapic=true"
487 boot_with_pxe "${nodename}" "standalone firstboot=no" "${workdir}"
489 expect -c '
490 set timeout '${timeout_period}'
492 log_file -noappend stateless-pxe.log
494 spawn sudo virsh console '"${nodename}"'
496 expect {
497 -exact "Linux version" { send_log "\n\nMarker 1\n\n"; exp_continue }
498 -exact "Starting ovirt-early:" { send_log "\n\nMarker 2\n\n"; exp_continue }
499 -exact "Starting ovirt:" { send_log "\n\nMarker 3\n\n"; exp_continue }
500 -exact "Starting ovirt-post:" { send_log "\n\nMarker 4\n\n"; exp_continue }
501 -re "localhost.*login:" { send_log "\n\nMarker 5\n\n"; exit }
502 timeout {
503 send_log "\nTimeout waiting for marker..\n\n"
504 exit 1
505 } eof {
506 send_log "Unexpected end of file."
507 exit 2
511 send_log "\n\nUnexpected end of interaction.\n\n"
512 exit 3'
513 result=$?
515 destroy_node $nodename
516 stop_networking $IFACE_NAME true
518 return $result
521 add_test "test_stateless_pxe_with_nohd"
522 test_stateless_pxe_with_nohd () {
523 local nodename="${vm_prefix}-stateless-pxe-nohd"
524 local workdir=$WORKDIR
526 start_networking $nodename $IFACE_NAME false true $workdir
528 configure_node "${nodename}" "network" "" "" "" "local noapic=true"
529 boot_with_pxe "${nodename}" "firstboot=no" "${workdir}"
531 expect -c '
532 set timeout '${timeout_period}'
534 log_file -noappend stateless-pxe.log
536 spawn sudo virsh console '"${nodename}"'
538 expect {
539 -exact "Linux version" { send_log "\n\nMarker 1\n\n"; exp_continue }
540 -exact "Starting ovirt-early:" { send_log "\n\nMarker 2\n\n"; exp_continue }
541 -exact "Starting ovirt:" { send_log "\n\nMarker 3\n\n"; exp_continue }
542 -exact "Starting ovirt-post:" { send_log "\n\nMarker 4\n\n"; exp_continue }
543 -re "localhost.*login:" { send_log "\n\nMarker 5\n\n"; exit }
544 timeout {
545 send_log "\nTimeout waiting for marker..\n\n"
546 exit 1
547 } eof {
548 send_log "Unexpected end of file."
549 exit 2
553 send_log "\n\nUnexpected end of interaction.\n\n"
554 exit 3'
556 result=$?
558 destroy_node $nodename
559 stop_networking $IFACE_NAME true
561 return $result
564 add_test "test_stateful_pxe"
565 test_stateful_pxe () {
566 local nodename="${vm_prefix}-stateful-pxe"
567 local workdir=$WORKDIR
568 local ipaddress=${NODE_ADDRESS}
570 for var in nodename workdir ipaddress; do
571 eval debug "::\$$var: $var"
572 done
574 start_networking $nodename $IFACE_NAME false true $workdir
576 configure_node "${nodename}" "network" "" "10000" "" "local noapic=true"
577 boot_with_pxe "${nodename}" "standalone storage_init=/dev/vda local_boot ip=${ipaddress}" ${workdir}
579 # verify the booting and installation
580 expect -c '
581 set timeout '${timeout_period}'
582 log_file -noappend stateful-pxe.log
584 spawn sudo virsh console '"${nodename}"'
586 expect {
587 -exact "Linux version" { send_log "\n\nMarker 1\n\n"; exp_continue }
588 -exact "Starting ovirt-early:" { send_log "\n\nMarker 2\n\n"; exp_continue }
589 -exact "Starting ovirt:" { send_log "\n\nMarker 3\n\n"; exp_continue }
590 -exact "Starting ovirt-post:" { send_log "\n\nMarker 4\n\n"; exp_continue }
591 -exact "Starting ovirt-firstpost:" { send_log "\n\nMarker 5\n\n"; exp_continue }
592 -exact "Starting partitioning of /dev/vda" { send_log "\n\nMarker 6\n\n"; exp_continue }
593 -exact "Restarting system" { send_log "\n\nMarker 7\n\n"; exit }
594 timeout {
595 send_log "\nTimeout waiting for marker..\n\n"
596 exit 1
597 } eof {
598 send_log "Unexpected end of file."
599 exit 2
603 send_log "\n\nUnexpected end of interaction.\n\n"
604 exit 3'
605 result=$?
607 # only continue if we're in a good state
608 if [ $result -eq 0 ]; then
609 destroy_node "${nodename}" false
610 substitute_boot_device "${nodename}" "network" "hd"
611 boot_from_hd "${nodename}"
613 expect -c '
614 set timeout '${timeout_period}'
615 log_file stateful-pxe.log
617 send_log "Restarted node, booting from hard disk.\n"
619 spawn sudo virsh console '"${nodename}"'
621 expect {
622 -re "localhost.*login:" { send_log "\n\nLogin marker found\n\n"; exit }
624 timeout {
625 send_log "\nMarker not found.\n\n"
626 exit 1
627 } eof {
628 send_log "Unexpected end of file."
629 exit 2
633 send_log "\n\nUnexpected end of interaction.\n\n"
635 exit 3
638 expect -c '
639 set timeout 3
640 log_file stateful-pxe.log
642 spawn ping -c 3 '"${ipaddress}"'
644 expect {
645 -exact "64 bytes from '"${ipaddress}"'" { send_log "\n\nGot ping response!\n"; send_log "\n\nNetworking verified!\n"; exit }
647 timeout {
648 send_log "\nMarker not found.\n\n"
649 exit 1
650 } eof {
651 send_log "Unexpected end of file."
652 exit 2
656 send_log "\n\nUnexpected end of interaction.\n\n"
658 exit 3'
660 result=$?
663 destroy_node $nodename
664 stop_networking $IFACE_NAME true
666 return $result
670 # configures the environment for testing
671 setup_for_testing () {
672 debug "WORKDIR=${WORKDIR}"
673 debug "isofile=${isofile}"
674 debug "isoname=${isoname}"
675 IFACE_NAME=testbr$$
676 debug "IFACE_NAME=${IFACE_NAME}"
677 NETWORK=192.168.$(echo "scale=0; print $$ % 255" | bc -l)
678 debug "NETWORK=${NETWORK}"
679 NODE_ADDRESS=$NETWORK.100
680 debug "NODE_ADDRESS=${NODE_ADDRESS}"
681 DNSMASQ_PID=0
682 debug "preserve_vm=${preserve_vm}"
685 # cleans up any loose ends
686 cleanup_after_testing () {
687 debug "Cleaning up"
688 stop_dnsmasq
689 stop_networking
690 # destroy any running vms
691 vm_list=$(sudo virsh list --all | awk '/'${vm_prefix}-'/ { print $2 }')
692 test -n "$vm_list" && for vm in $vm_list; do
693 destroy_node $vm
694 done
695 stop_networking "${IFACE_NAME}" true
697 # do not delete the work directory if preserve was specified
698 if $preserve_vm; then return; fi
700 rm -rf $WORKDIR
703 # check commandline options
704 test=''
705 debugging=false
706 isofile="${PWD}/ovirt-node-image.iso"
707 show_viewer=false
708 vm_prefix="$$"
709 preserve_vm=false
710 timeout_period="120"
712 while getopts di:n:pt:vwh c; do
713 case $c in
714 d) debugging=true;;
715 i) isofile=($OPTARG);;
716 n) tests=($OPTARG);;
717 p) preserve_vm=true;;
718 t) timeout_period=($OPTARG);;
719 v) set -v;;
720 w) show_viewer=true;;
721 h) usage; exit 0;;
722 '?') die "invalid option \`-$OPTARG'";;
723 :) die "missing argument to \`-$OPTARG' option";;
724 *) die "internal error";;
725 esac
726 done
728 isoname=$(basename $isofile)
729 isofile="$(cd `dirname $isofile`; pwd)/${isoname}"
731 if ! [ -s "${isofile}" ]; then
732 die "Missing or invalid file: ${isofile}"
735 shift $(($OPTIND - 1))
737 set +u
738 if [ $# -gt 0 -a -n "$1" ]; then RESULTS=$1; else RESULTS=autotest.log; fi
739 set -u
741 result_file=$WORKDIR/results.log
742 debug "result_file=${result_file}"
744 log "Logging results to file: ${RESULTS}"
746 setup_for_testing
748 log "Begin Testing: ${isoname}"
749 log "Tests: ${tests}"
750 log "Timeout: ${timeout_period} ms"
752 for test in ${tests}; do
753 execute_test $test
754 result=$?
756 cleanup_after_testing
758 if [ $result != 0 ]; then
759 echo "${result}" > $result_file
760 break
762 done
764 log "End Testing: ${isoname}"
766 } | sudo tee --append $RESULTS
768 if [ -s "$result_file" ]; then
769 exit $(cat $result_file)