2016-06-18 01:28:12 +08:00
|
|
|
#!/bin/sh
|
|
|
|
# run virsh self-test to make sure command option structures are valid
|
|
|
|
|
|
|
|
# Copyright (C) 2016 Red Hat, Inc.
|
|
|
|
|
|
|
|
# This program is free software: you can redistribute it and/or modify
|
|
|
|
# it under the terms of the GNU General Public License as published by
|
|
|
|
# the Free Software Foundation, either version 2 of the License, or
|
|
|
|
# (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
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with this program. If not, see
|
|
|
|
# <http://www.gnu.org/licenses/>.
|
|
|
|
|
|
|
|
. "$(dirname $0)/test-lib.sh"
|
|
|
|
|
|
|
|
fail=0
|
|
|
|
|
2016-09-14 16:08:48 +08:00
|
|
|
basename=$(basename $0)
|
|
|
|
|
|
|
|
if test "x$basename" = "xvirsh-self-test" ; then
|
|
|
|
binary=virsh
|
|
|
|
extra_args="-c test:///default"
|
|
|
|
elif test "x$basename" = "xvirt-admin-self-test" ; then
|
|
|
|
binary=virt-admin
|
|
|
|
extra_args=""
|
|
|
|
else
|
|
|
|
echo "Unknown binary: $basename";
|
|
|
|
exit 1
|
|
|
|
fi
|
2016-06-18 01:28:12 +08:00
|
|
|
|
2016-09-14 16:08:48 +08:00
|
|
|
test_intro "$0"
|
|
|
|
$abs_top_builddir/tools/${binary} ${extra_args} self-test > /dev/null
|
2016-06-18 01:28:12 +08:00
|
|
|
status=$?
|
2016-09-14 16:08:48 +08:00
|
|
|
test_result 1 "$0" ${status}
|
2016-06-18 01:28:12 +08:00
|
|
|
|
2016-09-14 16:08:48 +08:00
|
|
|
if test "${status}" != "0" ; then
|
2016-06-18 01:28:12 +08:00
|
|
|
fail=1
|
|
|
|
fi
|
|
|
|
|
|
|
|
test_final $counter $fail
|
|
|
|
|
|
|
|
(exit $fail); exit $fail
|