libvirtd-pool 672 字节
Newer Older
J
Jim Meyering 已提交
1
#!/bin/sh
2
# Get coverage of virsh pool-define-as XML formatting
J
Jim Meyering 已提交
3

4
. "$(dirname $0)/test-lib.sh"
C
Chris Lalancette 已提交
5

J
Jim Meyering 已提交
6 7
if test "$VERBOSE" = yes; then
  set -x
C
Chris Lalancette 已提交
8
  $abs_top_builddir/tools/virsh --version
J
Jim Meyering 已提交
9 10 11 12 13 14
fi

fail=0

pwd=$(pwd) || fail=1

C
Chris Lalancette 已提交
15
$abs_top_builddir/tools/virsh --connect test:///default \
16 17 18
  pool-define-as --print-xml \
  P dir src-host /src/path /src/dev S /target-path \
  1>out 2>&1
J
Jim Meyering 已提交
19 20 21 22 23

cat <<EOF > pool-list-exp
<pool type='dir'>
  <name>P</name>
  <source>
24 25 26 27
    <host name='src-host'/>
    <dir path='/src/path'/>
    <device path='/src/dev'/>
    <name>S</name>
J
Jim Meyering 已提交
28 29 30 31 32 33 34 35 36 37 38
  </source>
  <target>
    <path>/target-path</path>
  </target>
</pool>

EOF

compare pool-list-exp out || fail=1

exit $fail