summaryrefslogtreecommitdiffstats
path: root/regressions
diff options
context:
space:
mode:
authorRichard Jones <rjones@redhat.com>2010-01-29 09:02:14 +0000
committerRichard Jones <rjones@redhat.com>2010-01-29 09:02:14 +0000
commit2a224424acc47dc0f50fe605463bf2936fceb27c (patch)
treecd23b7a802f9fd2dd128e0f6c4d5edd0e0f415b0 /regressions
parent3cd7ce75f1ce5048a4d9f6aeaf66aff3194e1096 (diff)
downloadlibguestfs-2a224424acc47dc0f50fe605463bf2936fceb27c.tar.gz
libguestfs-2a224424acc47dc0f50fe605463bf2936fceb27c.tar.xz
libguestfs-2a224424acc47dc0f50fe605463bf2936fceb27c.zip
Fix regressions/rhbz557655.sh when debugging is enabled (v2).
The previous fix didn't cope with ordinary warnings emitted by qemu (eg. "open /dev/kvm: No such file or directory"). This is a hopefully more complete fix for the problem. See also commit 3cd7ce75f1ce5048a4d9f6aeaf66aff3194e1096.
Diffstat (limited to 'regressions')
-rw-r--r--regressions/rhbz557655-expected.stderr (renamed from regressions/rhbz557655-expected.out)8
-rw-r--r--regressions/rhbz557655-expected.stdout8
-rwxr-xr-xregressions/rhbz557655.sh21
3 files changed, 23 insertions, 14 deletions
diff --git a/regressions/rhbz557655-expected.out b/regressions/rhbz557655-expected.stderr
index 7d37e842..ea560e83 100644
--- a/regressions/rhbz557655-expected.out
+++ b/regressions/rhbz557655-expected.stderr
@@ -1,8 +1,3 @@
-0
-16
-8
--1073741824
-1073741823
set-memsize: memsize: integer out of range
set-memsize: memsize: integer out of range
set-memsize: memsize: integer out of range
@@ -11,9 +6,6 @@ set-memsize: memsize: invalid integer parameter (xstrtol returned 4)
set-memsize: memsize: invalid integer parameter (xstrtol returned 2)
set-memsize: memsize: invalid integer parameter (xstrtol returned 2)
set-memsize: memsize: invalid integer parameter (xstrtol returned 2)
-1234
-1234
-1234
libguestfs: error: truncate_size: ftruncate: /test: File too large
truncate-size: size: invalid integer parameter (xstrtoll returned 1)
truncate-size: size: invalid integer parameter (xstrtoll returned 4)
diff --git a/regressions/rhbz557655-expected.stdout b/regressions/rhbz557655-expected.stdout
new file mode 100644
index 00000000..80bc8bc3
--- /dev/null
+++ b/regressions/rhbz557655-expected.stdout
@@ -0,0 +1,8 @@
+0
+16
+8
+-1073741824
+1073741823
+1234
+1234
+1234
diff --git a/regressions/rhbz557655.sh b/regressions/rhbz557655.sh
index aa74bc19..85cfb1e8 100755
--- a/regressions/rhbz557655.sh
+++ b/regressions/rhbz557655.sh
@@ -21,11 +21,10 @@
# "guestfish number parsing should not use atoi, should support '0...' for octal and '0x...' for hexadecimal"
set -e
-rm -f test.out
+rm -f test.out test.err
export LANG=C
-unset LIBGUESTFS_DEBUG
-../fish/guestfish >> test.out 2>&1 <<EOF
+../fish/guestfish >> test.out 2>> test.err <<EOF
# set-memsize is just a convenient non-daemon function that
# takes a single integer argument.
set-memsize 0
@@ -50,7 +49,7 @@ get-memsize
-set-memsize 123L
EOF
-../fish/guestfish >> test.out 2>&1 <<EOF
+../fish/guestfish >> test.out 2>> test.err <<EOF
alloc test1.img 10M
run
part-disk /dev/sda mbr
@@ -80,5 +79,15 @@ filesize /test
-truncate-size /test 123L
EOF
-diff -u test.out rhbz557655-expected.out
-rm test.out test1.img
+# If we are running with debugging enabled (or even if not), then
+# other messages and warnings can end up in the test.err (stderr) log.
+# Thus filter out only lines we expect. 'proc 200' is the procedure
+# number of truncate_size.
+mv test.err test.err~
+grep -E 'set[-_]memsize|truncate[-_]size' test.err~ |
+ grep -Ev 'proc 200' > test.err
+rm test.err~
+
+diff -u test.out rhbz557655-expected.stdout
+diff -u test.err rhbz557655-expected.stderr
+rm test.out test.err test1.img