Displaying 5 results from an estimated 5 matches for "cleanup_after_test".
2010 Jan 12
1
[PATCH] Adds the qemu log to the autotest output.
...DIR=$(mktemp -d)
+
 warn() { printf '%s: %s\n' "$ME" "$*" >&2; }
-die() {  warn "$*"; exit 1; }
+die() { warn "$*"; show_libvirt_log; exit 1; }
 debug() { if $debugging; then log "[DEBUG] %s" "$*"; fi }
 
 trap '__st=$?; cleanup_after_testing; exit $__st' 1 2 3 13 15
@@ -69,6 +70,15 @@ Usage: $ME [-n test_name] [LOGFILE]
 EOF
 }
 
+# $1 - the nodename
+show_libvirt_log () {
+    local logfile=/var/log/libvirt/qemu/$1.log
+
+    printf "\n[${logfile}]\n"
+    sudo cat $logfile
+    printf "[${logfile}]\n\n"
+}...
2009 Jul 21
2
[PATCH node-image] Adds a preserve option for autotest VMs.
If the -p option is provided, then no VMs are destroyed. Instead they,
and their related networks, are left intact.
Signed-off-by: Darryl L. Pierce <dpierce at redhat.com>
---
 autotest.sh |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)
diff --git a/autotest.sh b/autotest.sh
index c9f8a2d..b72ec98 100755
--- a/autotest.sh
+++ b/autotest.sh
@@ -219,6 +219,9 @@
2009 Jul 21
1
[PATCH node-image] Moved all temporary files into a single work directory to clean up.
...exit 3'
 add_test "test_stateful_pxe"
 test_stateful_pxe () {
     local nodename="${vm_prefix}-stateful-pxe"
-    local workdir=$(mktemp -d)
+    local workdir=$WORKDIR
     local ipaddress=${NODE_ADDRESS}
 
     for var in nodename workdir ipaddress; do
@@ -683,6 +684,7 @@ cleanup_after_testing () {
         destroy_node $vm
     done
     stop_networking
+    rm -rf $WORKDIR
 }
 
 # check commandline options
@@ -715,7 +717,7 @@ set +u
 if [ $# -gt 0 -a -n "$1" ]; then RESULTS=$1; else RESULTS=autotest.log; fi
 set -u
 
-result_file=$(mktemp)
+result_file=$WORKDIR/results.log...
2010 Mar 26
3
[PATCH node] Update autobuild and autotest scripts for new build structure
...have
+# an ISO file.
+
+ME=$(basename "$0")
+WORKDIR=$(mktemp -d)
+warn() { printf '%s: %s\n' "$ME" "$*" >&2; }
+die() {  warn "$*"; exit 1; }
+debug() { if $debugging; then log "[DEBUG] %s" "$*"; fi }
+
+trap '__st=$?; cleanup_after_testing; exit $__st' 1 2 3 13 15
+trap 'cleanup_after_testing' 0
+
+# set -e
+# set -u
+
+log () {
+    date=$(date)
+    printf "${date} $*\n"
+}
+
+usage () {
+    cat <<EOF
+Usage: $ME [-n test_name] [LOGFILE]
+  -i: set the ISO filename (defualt: ovirt-node-image.iso)
+...
2009 May 19
1
[PATCH node-image] Fixing the autotest script.
...-        exit 1
+	send_log "\nMarker not found.\n\n"
+	exit 1
     } eof {
-        send_log "Unexpected end of file."
-        exit 2
+	send_log "Unexpected end of file."
+	exit 2
     }
 }
 
@@ -676,13 +674,15 @@ setup_for_testing () {
 
 # cleans up any loose ends
 cleanup_after_testing () {
+    debug "Cleaning up"
     stop_dnsmasq
     stop_networking
     # destroy any running vms
     vm_list=$(sudo virsh list --all | awk '/'${vm_prefix}-'/ { print $2 }')
     test -n "$vm_list" && for vm in $vm_list; do
-        destroy_node $vm...