#!/bin/sh
: ${srcdir=.}
-. $srcdir/schematestutils.sh
+. $srcdir/test-lib.sh
+. $abs_srcdir/schematestutils.sh
DIRS="capabilityschemadata xencapsdata"
SCHEMA="capability.rng"
# Get coverage of libvirtd's config-parsing code.
test -z "$srcdir" && srcdir=$(pwd)
-test -z "$abs_top_srcdir" && abs_top_srcdir=$(pwd)/..
-test -z "$abs_top_builddir" && abs_top_builddir=$(pwd)/..
+LC_ALL=C
+. "$srcdir/test-lib.sh"
-if test "$VERBOSE" = yes; then
- set -x
+if test "$verbose" = yes; then
$abs_top_builddir/daemon/libvirtd --version
fi
-. "$srcdir/test-lib.sh"
+test_intro "$this_test"
test -z "$CONFIG_HEADER" && CONFIG_HEADER="$abs_top_builddir/config.h"
# time and running libvirtd with the resulting config. Each libvirtd
# invocation must fail.
n=$(wc -l < tmp.conf)
-i=1
+i=0
+fail=0
while :; do
+ i=$(expr $i + 1)
+
param_name=$(sed -n "$i"'s/ = .*//p' tmp.conf)
- printf "testing with corrupted config: $param_name\n" 1>&2
rhs=$(sed -n "$i"'s/.* = \(.*\)/\1/p' tmp.conf)
f=in$i.conf
case $rhs in
# Check that the diagnostic we want appears
grep "$msg" err 1>/dev/null 2>&1
RET=$?
+ test_result $i "corrupted config $param_name" $RET
test "$RET" = "0" || fail=1
-
- i=$(expr $i + 1)
done
# Run with the unmodified config file.
|| fail=1
mv k tmp.conf || fail=1
-printf "running libvirtd with a valid config file ($sleep_secs seconds)\n" 1>&2
$abs_top_builddir/daemon/libvirtd --pid-file=pid-file --config=tmp.conf > log 2>&1 & pid=$!
sleep $sleep_secs
kill $pid
+RET=0
# Expect an orderly shut-down and successful exit.
-wait $pid || fail=1
+wait $pid || RET=1
+
+test_result $i "valid config file (sleeping $sleep_secs seconds)" $RET
+test $RET = 0 || fail=1
+
+test_final $i $fail
# "cat log" would print this for non-root:
# Cannot set group when not running as root
#!/bin/sh
: ${srcdir=.}
-. $srcdir/schematestutils.sh
+. $srcdir/test-lib.sh
+. $abs_srcdir/schematestutils.sh
DIRS="domainschemadata qemuxml2argvdata sexpr2xmldata xmconfigdata xml2sexprdata"
SCHEMA="domain.rng"
k = virDiskNameToIndex(name);
if (k != i) {
- if (virtTestGetDebug() > 0) {
+ if (virTestGetDebug() > 0) {
fprintf(stderr, "\nExpect [%d]\n", i);
fprintf(stderr, "Actual [%d]\n", k);
}
static int
-verifyFired(int handle, int timer)
+verifyFired(const char *name, int handle, int timer)
{
int handleFired = 0;
int timerFired = 0;
for (i = 0 ; i < NUM_FDS ; i++) {
if (handles[i].fired) {
if (i != handle) {
- fprintf(stderr, "FAIL Handle %d fired, but expected %d\n", i, handle);
+ virtTestResult(name, 1, "Handle %d fired, but expected %d\n", i, handle);
return EXIT_FAILURE;
} else {
if (handles[i].error != EV_ERROR_NONE) {
- fprintf(stderr, "FAIL Handle %d fired, but had error %d\n", i,
- handles[i].error);
+ virtTestResult(name, 1, "Handle %d fired, but had error %d\n", i,
+ handles[i].error);
return EXIT_FAILURE;
}
handleFired = 1;
}
} else {
if (i == handle) {
- fprintf(stderr, "FAIL Handle %d should have fired, but didn't\n", handle);
+ virtTestResult(name, 1, "Handle %d should have fired, but didn't\n", handle);
return EXIT_FAILURE;
}
}
}
if (handleFired != 1 && handle != -1) {
- fprintf(stderr, "FAIL Something wierd happened, expecting handle %d\n", handle);
+ virtTestResult(name, 1, "Something wierd happened, expecting handle %d\n", handle);
return EXIT_FAILURE;
}
for (i = 0 ; i < NUM_TIME ; i++) {
if (timers[i].fired) {
if (i != timer) {
- fprintf(stderr, "FAIL Timer %d fired, but expected %d\n", i, timer);
+ virtTestResult(name, 1, "Timer %d fired, but expected %d\n", i, timer);
return EXIT_FAILURE;
} else {
if (timers[i].error != EV_ERROR_NONE) {
- fprintf(stderr, "FAIL Timer %d fired, but had error %d\n", i,
- timers[i].error);
+ virtTestResult(name, 1, "Timer %d fired, but had error %d\n", i,
+ timers[i].error);
return EXIT_FAILURE;
}
timerFired = 1;
}
} else {
if (i == timer) {
- fprintf(stderr, "FAIL Timer %d should have fired, but didn't\n", timer);
+ virtTestResult(name, 1, "Timer %d should have fired, but didn't\n", timer);
return EXIT_FAILURE;
}
}
}
if (timerFired != 1 && timer != -1) {
- fprintf(stderr, "FAIL Something wierd happened, expecting timer %d\n", timer);
+ virtTestResult(name, 1, "Something wierd happened, expecting timer %d\n", timer);
return EXIT_FAILURE;
}
return EXIT_SUCCESS;
}
static void
-startJob(const char *msg, int *test)
+startJob(void)
{
- fprintf(stderr, "%2d: %s ", (*test)++, msg);
eventThreadRunOnce = 1;
eventThreadJobDone = 0;
pthread_cond_signal(&eventThreadRunCond);
}
static int
-finishJob(int handle, int timer)
+finishJob(const char *name, int handle, int timer)
{
struct timespec waitTime;
int rc;
while (!eventThreadJobDone && rc == 0)
rc = pthread_cond_timedwait(&eventThreadJobCond, &eventThreadMutex, &waitTime);
if (rc != 0) {
- fprintf(stderr, "FAIL Timed out waiting for pipe event\n");
+ virtTestResult(name, 1, "Timed out waiting for pipe event\n");
return EXIT_FAILURE;
}
- if (verifyFired(handle, timer) != EXIT_SUCCESS)
+ if (verifyFired(name, handle, timer) != EXIT_SUCCESS)
return EXIT_FAILURE;
- fprintf(stderr, "OK\n");
+ virtTestResult(name, 0, NULL);
return EXIT_SUCCESS;
}
int i;
pthread_t eventThread;
char one = '1';
- int test = 1;
progname = argv[0];
/* First time, is easy - just try triggering one of our
* registered handles */
- startJob("Simple write", &test);
+ startJob();
if (safewrite(handles[1].pipeFD[1], &one, 1) != 1)
return EXIT_FAILURE;
- if (finishJob(1, -1) != EXIT_SUCCESS)
+ if (finishJob("Simple write", 1, -1) != EXIT_SUCCESS)
return EXIT_FAILURE;
resetAll();
/* Now lets delete one before starting poll(), and
* try triggering another handle */
virEventRemoveHandleImpl(handles[0].watch);
- startJob("Deleted before poll", &test);
+ startJob();
if (safewrite(handles[1].pipeFD[1], &one, 1) != 1)
return EXIT_FAILURE;
- if (finishJob(1, -1) != EXIT_SUCCESS)
+ if (finishJob("Deleted before poll", 1, -1) != EXIT_SUCCESS)
return EXIT_FAILURE;
resetAll();
/* NB: this case is subject to a bit of a race condition.
* We yield & sleep, and pray that the other thread gets
* scheduled before we run EventRemoveHandleImpl */
- startJob("Interrupted during poll", &test);
+ startJob();
pthread_mutex_unlock(&eventThreadMutex);
sched_yield();
usleep(100 * 1000);
pthread_mutex_lock(&eventThreadMutex);
virEventRemoveHandleImpl(handles[1].watch);
- if (finishJob(-1, -1) != EXIT_SUCCESS)
+ if (finishJob("Interrupted during poll", -1, -1) != EXIT_SUCCESS)
return EXIT_FAILURE;
resetAll();
* before poll() exits for the first safewrite(). We don't
* see a hard failure in other cases, so nothing to worry
* about */
- startJob("Deleted during dispatch", &test);
+ startJob();
handles[2].delete = handles[3].watch;
if (safewrite(handles[2].pipeFD[1], &one, 1) != 1
|| safewrite(handles[3].pipeFD[1], &one, 1) != 1)
return EXIT_FAILURE;
- if (finishJob(2, -1) != EXIT_SUCCESS)
+ if (finishJob("Deleted during dispatch", 2, -1) != EXIT_SUCCESS)
return EXIT_FAILURE;
resetAll();
/* Extreme fun, lets delete ourselves during dispatch */
- startJob("Deleted during dispatch", &test);
+ startJob();
handles[2].delete = handles[2].watch;
if (safewrite(handles[2].pipeFD[1], &one, 1) != 1)
return EXIT_FAILURE;
- if (finishJob(2, -1) != EXIT_SUCCESS)
+ if (finishJob("Deleted during dispatch", 2, -1) != EXIT_SUCCESS)
return EXIT_FAILURE;
resetAll();
/* Run a timer on its own */
virEventUpdateTimeoutImpl(timers[1].timer, 100);
- startJob("Firing a timer", &test);
- if (finishJob(-1, 1) != EXIT_SUCCESS)
+ startJob();
+ if (finishJob("Firing a timer", -1, 1) != EXIT_SUCCESS)
return EXIT_FAILURE;
virEventUpdateTimeoutImpl(timers[1].timer, -1);
* try triggering another timer */
virEventUpdateTimeoutImpl(timers[1].timer, 100);
virEventRemoveTimeoutImpl(timers[0].timer);
- startJob("Deleted before poll", &test);
- if (finishJob(-1, 1) != EXIT_SUCCESS)
+ startJob();
+ if (finishJob("Deleted before poll", -1, 1) != EXIT_SUCCESS)
return EXIT_FAILURE;
virEventUpdateTimeoutImpl(timers[1].timer, -1);
/* NB: this case is subject to a bit of a race condition.
* We yield & sleep, and pray that the other thread gets
* scheduled before we run EventRemoveTimeoutImpl */
- startJob("Interrupted during poll", &test);
+ startJob();
pthread_mutex_unlock(&eventThreadMutex);
sched_yield();
usleep(100 * 1000);
pthread_mutex_lock(&eventThreadMutex);
virEventRemoveTimeoutImpl(timers[1].timer);
- if (finishJob(-1, -1) != EXIT_SUCCESS)
+ if (finishJob("Interrupted during poll", -1, -1) != EXIT_SUCCESS)
return EXIT_FAILURE;
resetAll();
* about */
virEventUpdateTimeoutImpl(timers[2].timer, 100);
virEventUpdateTimeoutImpl(timers[3].timer, 100);
- startJob("Deleted during dispatch", &test);
+ startJob();
timers[2].delete = timers[3].timer;
- if (finishJob(-1, 2) != EXIT_SUCCESS)
+ if (finishJob("Deleted during dispatch", -1, 2) != EXIT_SUCCESS)
return EXIT_FAILURE;
virEventUpdateTimeoutImpl(timers[2].timer, -1);
/* Extreme fun, lets delete ourselves during dispatch */
virEventUpdateTimeoutImpl(timers[2].timer, 100);
- startJob("Deleted during dispatch", &test);
+ startJob();
timers[2].delete = timers[2].timer;
- if (finishJob(-1, 2) != EXIT_SUCCESS)
+ if (finishJob("Deleted during dispatch", -1, 2) != EXIT_SUCCESS)
return EXIT_FAILURE;
for (i = 0 ; i < NUM_FDS ; i++)
VIR_EVENT_HANDLE_READABLE,
testPipeReader,
&handles[1], NULL);
- startJob("Write duplicate", &test);
+ startJob();
if (safewrite(handles[1].pipeFD[1], &one, 1) != 1)
return EXIT_FAILURE;
- if (finishJob(1, -1) != EXIT_SUCCESS)
+ if (finishJob("Write duplicate", 1, -1) != EXIT_SUCCESS)
return EXIT_FAILURE;
//pthread_kill(eventThread, SIGTERM);
#!/bin/sh
: ${srcdir=.}
-. $srcdir/schematestutils.sh
+. $srcdir/test-lib.sh
+. $abs_srcdir/schematestutils.sh
DIRS="interfaceschemadata"
SCHEMA="interface.rng"
#!/bin/sh
: ${srcdir=.}
-. $srcdir/schematestutils.sh
+. $srcdir/test-lib.sh
+. $abs_srcdir/schematestutils.sh
DIRS="../src/network networkxml2xmlin networkxml2xmlout"
SCHEMA="network.rng"
#!/bin/sh
: ${srcdir=.}
-. $srcdir/schematestutils.sh
+. $srcdir/test-lib.sh
+. $abs_srcdir/schematestutils.sh
DIRS="nodedevschemadata"
SCHEMA="nodedev.rng"
#!/bin/sh
-test -z "$srcdir" && srcdir=`pwd`
-test -z "$abs_srcdir" && abs_srcdir=`pwd`
-
check_schema () {
DIRS=$1
-SCHEMA="$srcdir/../docs/schemas/$2"
+SCHEMA="$abs_srcdir/../docs/schemas/$2"
+
+test_intro $this_test
n=0
f=0
for xml in $XML
do
n=`expr $n + 1`
- printf "%4d) %.60s " $n $(basename $(dirname $xml))"/"$(basename $xml)
cmd="xmllint --relaxng $SCHEMA --noout $xml"
result=`$cmd 2>&1`
ret=$?
- if test $ret = 0; then
- echo "OK"
- else
- echo "FAILED"
+
+ test_result $n $(basename $(dirname $xml))"/"$(basename $xml) $ret
+ if test "$verbose" = "1" -a $ret != 0 ; then
echo -e "$cmd\n$result"
+ fi
+ if test "$ret" != 0 ; then
f=`expr $f + 1`
fi
done
done
-echo "Validated $n files, $f failed"
+
+test_final $n $f
ret=0
test $f != 0 && ret=255
if (actual == expect) {
return 0;
} else {
- if (virtTestGetDebug())
+ if (virTestGetDebug())
fprintf(stderr, "Expect %-6d Actual %-6d\n", expect, actual);
return -1;
}
* register a handler to stop error messages cluttering
* up display
*/
- if (!virtTestGetDebug())
+ if (!virTestGetDebug())
virSetErrorFunc(NULL, testQuietError);
#define DO_TEST(dev, num) \
#!/bin/sh
: ${srcdir=.}
-. $srcdir/schematestutils.sh
+. $srcdir/test-lib.sh
+. $abs_srcdir/schematestutils.sh
DIRS="storagepoolxml2xmlin storagepoolxml2xmlout"
SCHEMA="storagepool.rng"
#!/bin/sh
: ${srcdir=.}
-. $srcdir/schematestutils.sh
+. $srcdir/test-lib.sh
+. $abs_srcdir/schematestutils.sh
DIRS="storagevolxml2xmlin storagevolxml2xmlout"
SCHEMA="storagevol.rng"
# source this file; set up for tests
+test -z "$abs_srcdir" && abs_srcdir=$(pwd)
+test -z "$abs_builddir" && abs_builddir=$(pwd)
+test -z "$abs_top_srcdir" && abs_top_srcdir=$(pwd)/..
+test -z "$abs_top_builddir" && abs_top_builddir=$(pwd)/..
+test -z "$LC_ALL" && LC_ALL=C
+
# Skip this test if the shell lacks support for functions.
unset function_test
eval 'function_test() { return 11; }; function_test'
(exit 77); exit 77
fi
+test_intro()
+{
+ name=$1
+ if test "$verbose" = "0" ; then
+ echo "TEST: $name"
+ echo -n " "
+ fi
+}
+
+test_result()
+{
+ counter=$1
+ name=$2
+ status=$3
+ if test "$verbose" = "0" ; then
+ mod=`eval "expr \( $counter - 1 \) % 40"`
+ if test "$counter" != 1 -a "$mod" = 0 ; then
+ printf " %-3d\n" `eval "expr $counter - 1"`
+ echo -n " "
+ fi
+ if test "$status" = "0" ; then
+ echo -n "."
+ else
+ echo -n "!"
+ fi
+ else
+ if test "$status" = "0" ; then
+ printf "%3d) %-60s ... OK\n" "$counter" "$name"
+ else
+ printf "%3d) %-60s ... FAILED\n" "$counter" "$name"
+ fi
+ fi
+}
+
+test_final()
+{
+ counter=$1
+ status=$2
+
+ if test "$verbose" = "0" ; then
+ mod=`eval "expr \( $counter + 1 \) % 40"`
+ for i in `seq $mod 40`
+ do
+ echo -n " "
+ done
+ if test "$status" = "0" ; then
+ printf " %-3d OK\n" $counter
+ else
+ printf " %-3d FAILED\n" $counter
+ fi
+ fi
+}
+
skip_test_()
{
echo "$0: skipping test: $@" 1>&2
this_test_() { echo "./$0" | sed 's,.*/,,'; }
this_test=$(this_test_)
+verbose=0
+if test -n "$VIR_TEST_DEBUG" -o -n "$VIR_TEST_VERBOSE" ; then
+ verbose=1
+fi
+
# This is a stub function that is run upon trap (upon regular exit and
# interrupt). Override it with a per-test function, e.g., to unmount
# a partition, or to undo any other global state changes.
#!/bin/sh
test -z "$srcdir" && srcdir=$(pwd)
-test -z "$abs_top_srcdir" && abs_top_srcdir=$(pwd)/..
-test -z "$abs_top_builddir" && abs_top_builddir=$(pwd)/..
-test -z "$abs_srcdir" && abs_srcdir=$(pwd)
-test -z "$abs_builddir" && abs_builddir=$(pwd)
-
-if test "$VERBOSE" = yes; then
- set -x
- $abs_top_builddir/tools/virsh --version
-fi
. "$srcdir/test-lib.sh"
-set -e
+test_intro $this_test
fail=0
-i=1
+i=0
data_dir=$abs_srcdir/confdata
for f in $(cd "$data_dir" && echo *.conf)
do
+ i=`expr $i + 1`
"$abs_builddir/conftest" "$data_dir/$f" > "$f-actual"
expected="$data_dir"/`echo "$f" | sed s+\.conf$+\.out+`
if compare "$expected" "$f-actual"; then
- msg=OK
+ ret=0
else
- msg=FAILED
+ ret=1
fail=1
fi
- printf "%2d) %-60s ... %s\n" $i "$f" $msg
- i=`expr $i + 1`
+ test_result $i "$f" $ret
done
+test_final $i $fail
+
(exit $fail); exit $fail
((int) ((T)->tv_usec - (U)->tv_usec))) / 1000.0)
static unsigned int testDebug = -1;
+static unsigned int testVerbose = -1;
static unsigned int testOOM = 0;
static unsigned int testCounter = 0;
return (double) (sum / nitems);
}
+
+void virtTestResult(const char *name, int ret, const char *msg, ...)
+{
+ va_list vargs;
+ va_start(vargs, msg);
+
+ testCounter++;
+ if (virTestGetVerbose()) {
+ fprintf(stderr, "%3d) %-60s ", testCounter, name);
+ if (ret == 0)
+ fprintf(stderr, "OK\n");
+ else {
+ fprintf(stderr, "FAILED\n");
+ if (msg) {
+ vfprintf(stderr, msg, vargs);
+ }
+ }
+ } else {
+ if (testCounter != 1 &&
+ !((testCounter-1) % 40)) {
+ fprintf(stderr, " %-3d\n", (testCounter-1));
+ fprintf(stderr, " ");
+ }
+ if (ret == 0)
+ fprintf(stderr, ".");
+ else
+ fprintf(stderr, "!");
+ }
+
+ va_end(vargs);
+}
+
/*
* Runs test and count average time (if the nloops is grater than 1)
*
testCounter++;
if (testOOM < 2) {
- fprintf(stderr, "%2d) %-65s ... ", testCounter, title);
- fflush(stderr);
+ if (virTestGetVerbose())
+ fprintf(stderr, "%2d) %-65s ... ", testCounter, title);
}
if (nloops > 1 && (ts = calloc(nloops,
}
}
if (testOOM < 2) {
- if (ret == 0 && ts)
- fprintf(stderr, "OK [%.5f ms]\n",
- virtTestCountAverage(ts, nloops));
- else if (ret == 0)
- fprintf(stderr, "OK\n");
- else
- fprintf(stderr, "FAILED\n");
+ if (virTestGetVerbose()) {
+ if (ret == 0 && ts)
+ fprintf(stderr, "OK [%.5f ms]\n",
+ virtTestCountAverage(ts, nloops));
+ else if (ret == 0)
+ fprintf(stderr, "OK\n");
+ else
+ fprintf(stderr, "FAILED\n");
+ } else {
+ if (testCounter != 1 &&
+ !((testCounter-1) % 40)) {
+ fprintf(stderr, " %-3d\n", (testCounter-1));
+ fprintf(stderr, " ");
+ }
+ if (ret == 0)
+ fprintf(stderr, ".");
+ else
+ fprintf(stderr, "!");
+ }
}
free(ts);
const char *actualStart = actual;
const char *actualEnd = actual + (strlen(actual)-1);
- if (!virtTestGetDebug())
+ if (!virTestGetDebug())
return 0;
- if (virtTestGetDebug() < 2) {
+ if (virTestGetDebug() < 2) {
/* Skip to first character where they differ */
while (*expectStart && *actualStart &&
*actualStart == *expectStart) {
}
#endif
-unsigned int
-virtTestGetDebug() {
- char *debugStr;
- unsigned int debug;
-
- if (testDebug != -1)
- return testDebug;
+static unsigned int
+virTestGetFlag(const char *name) {
+ char *flagStr;
+ unsigned int flag;
- testDebug = 0;
-
- if ((debugStr = getenv("VIR_TEST_DEBUG")) == NULL)
+ if ((flagStr = getenv(name)) == NULL)
return 0;
- if (virStrToLong_ui(debugStr, NULL, 10, &debug) < 0)
+ if (virStrToLong_ui(flagStr, NULL, 10, &flag) < 0)
return 0;
- testDebug = debug;
+ return flag;
+}
+
+unsigned int
+virTestGetDebug() {
+ if (testDebug == -1)
+ testDebug = virTestGetFlag("VIR_TEST_DEBUG");
return testDebug;
}
+unsigned int
+virTestGetVerbose() {
+ if (testVerbose == -1)
+ testVerbose = virTestGetFlag("VIR_TEST_VERBOSE");
+ return testVerbose || virTestGetDebug();
+}
+
int virtTestMain(int argc,
char **argv,
int (*func)(int, char **))
int worker = 0;
#endif
+ fprintf(stderr, "TEST: %s\n", STRPREFIX(argv[0], "./") ? argv[0] + 2 : argv[0]);
+ if (!virTestGetVerbose())
+ fprintf(stderr, " ");
+
if (virThreadInitialize() < 0 ||
virErrorInitialize() < 0 ||
virRandomInitialize(time(NULL) ^ getpid()))
goto cleanup;
#if TEST_OOM_TRACE
- if (virtTestGetDebug())
+ if (virTestGetDebug())
virAllocTestHook(virtTestErrorHook, NULL);
#endif
approxAlloc = virAllocTestCount();
testCounter++;
- if (virtTestGetDebug())
+ if (virTestGetDebug())
fprintf(stderr, "%d) OOM...\n", testCounter);
else
fprintf(stderr, "%d) OOM of %d allocs ", testCounter, approxAlloc);
if (mp &&
(n % mp) != (worker - 1))
continue;
- if (!virtTestGetDebug()) {
+ if (!virTestGetDebug()) {
if (mp)
fprintf(stderr, "%d", worker);
else
}
}
- if (virtTestGetDebug())
+ if (virTestGetDebug())
fprintf(stderr, " ... OOM of %d allocs", approxAlloc);
if (ret == EXIT_SUCCESS)
#endif
virResetLastError();
+ if (!virTestGetVerbose()) {
+ int i;
+ for (i = (testCounter % 40) ; i < 40 ; i++)
+ fprintf(stderr, " ");
+ fprintf(stderr, " %-3d %s\n", testCounter, ret == 0 ? "OK" : "FAIL");
+ }
return ret;
}
double virtTestCountAverage(double *items,
int nitems);
+void virtTestResult(const char *name, int ret, const char *msg, ...);
int virtTestRun(const char *title,
int nloops,
int (*body)(const void *data),
const char *expect,
const char *actual);
-unsigned int virtTestGetDebug(void);
+unsigned int virTestGetDebug(void);
+unsigned int virTestGetVerbose(void);
int virtTestMain(int argc,
char **argv,
NULL) == NULL)
goto cleanup;
- if (virtTestGetDebug()) {
+ if (virTestGetDebug()) {
char *caps_str;
caps_str = virCapabilitiesFormatXML(caps);
# along with this program. If not, see <http://www.gnu.org/licenses/>.
test -z "$srcdir" && srcdir=$(pwd)
-test -z "$abs_top_srcdir" && abs_top_srcdir=$(pwd)/..
-test -z "$abs_top_builddir" && abs_top_builddir=$(pwd)/..
-
-if test "$VERBOSE" = yes; then
- set -x
- $abs_top_builddir/tools/virsh --version
-fi
. "$srcdir/test-lib.sh"
cmds=$(sed -n 's/^ \([^ ][^ ]*\) .*/\1/p' cmds) || framework_failure
test -n "$cmds" || framework_failure
+test_intro "virsh-all"
+
+counter=0
for i in $cmds; do
- echo testing $i... 1>&2
- # For now, just run the command and ignore output and exit status.
+ counter=`eval "expr $counter + 1"`
+
+ # For now, just run the command and ignore output
$abs_top_builddir/tools/virsh -c $test_url $i < /dev/null > /dev/null 2>&1
+ # Temporarily ignoring exit status
+ #status=$?
+ status=0
+ test_result $counter $i $status
+
+ if test "$status" = "1" ; then
+ fail=1
+ fi
done
+test_final $counter $fail
+
(exit $fail); exit $fail