File: virt-admin-self-test

package info (click to toggle)
libvirt 5.0.0-4%2Bdeb10u1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 251,264 kB
  • sloc: ansic: 573,843; xml: 168,347; sh: 9,976; python: 4,883; perl: 3,953; makefile: 3,323; ml: 465
file content (48 lines) | stat: -rwxr-xr-x 1,299 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/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

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

test_intro "$0"
$abs_top_builddir/tools/${binary} ${extra_args} self-test > /dev/null
status=$?
test_result 1 "$0" ${status}

if test "${status}" != "0" ; then
   fail=1
fi

test_final $counter $fail

(exit $fail); exit $fail