Fix actual vs expected data comparison order to get correct diff +++/--- output

This commit is contained in:
Daniel P. Berrange 2009-01-20 12:03:40 +00:00
parent ead04dcbe8
commit 0466ff28f2
6 changed files with 16 additions and 10 deletions

View File

@ -1,3 +1,9 @@
Tue Jan 20 12:03:53 GMT 2009 Daniel P. Berrange <berrange@redhat.com>
* tests/cpuset, tests/read-bufsiz, tests/start, tests/undefine,
tests/vcpupin: Switch order of expected vs actual data in diff
comparison, so output on failure makes sense.
Tue Jan 20 12:01:53 GMT 2009 Daniel P. Berrange <berrange@redhat.com>
Thread local error handling

View File

@ -40,6 +40,6 @@ libvir: Domain Config error : failed Xen syscall topology cpuset syntax error
error: Failed to define domain from xml-invalid
EOF
compare out exp || fail=1
compare exp out || fail=1
(exit $fail); exit $fail

View File

@ -37,7 +37,7 @@ for i in before after; do
virsh --connect test:///default define $in > out || fail=1
printf "Domain test defined from $in\n\n" > exp || fail=1
compare out exp || fail=1
compare exp out || fail=1
done
(exit $fail); exit $fail

View File

@ -34,9 +34,9 @@ virsh -c $test_url start test > out 2> err && fail=1
# stdout gets a newline
echo > exp || fail=1
compare out exp || fail=1
compare exp out || fail=1
echo 'error: Domain is already active' > exp || fail=1
compare err exp || fail=1
compare exp err || fail=1
(exit $fail); exit $fail

View File

@ -9,7 +9,7 @@
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# but WITHEXP ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
@ -32,7 +32,7 @@ cat <<\EOF > exp || fail=1
libvir: Test error : internal error Domain 'test' is still running
error: Failed to undefine domain test
EOF
compare out exp || fail=1
compare exp out || fail=1
# A different diagnostic when specifying a domain ID
virsh -q -c test:///default undefine 1 > out 2>&1
@ -41,7 +41,7 @@ cat <<\EOF > exp || fail=1
error: a running domain like 1 cannot be undefined;
to undefine, first shutdown then undefine using its name or UUID
EOF
compare out exp || fail=1
compare exp out || fail=1
# Succeed, now: first shut down, then undefine, both via name.
virsh -q -c test:///default 'shutdown test; undefine test' > out 2>&1
@ -50,6 +50,6 @@ cat <<\EOF > exp || fail=1
Domain test is being shutdown
Domain test has been undefined
EOF
compare out exp || fail=1
compare exp out || fail=1
(exit $fail); exit $fail

View File

@ -32,7 +32,7 @@ cat <<\EOF > exp || fail=1
error: vcpupin: Invalid or missing vCPU number.
EOF
compare out exp || fail=1
compare exp out || fail=1
# An out-of-range vCPU number deserves a diagnostic, too.
virsh --connect test:///default vcpupin test 100 0,1 > out 2>&1
@ -41,6 +41,6 @@ cat <<\EOF > exp || fail=1
error: vcpupin: Invalid vCPU number.
EOF
compare out exp || fail=1
compare exp out || fail=1
(exit $fail); exit $fail