exit 0
fi
-if ! xmlstarlet --help >/dev/null 2>&1; then
- echo "SKIPPING virt-sysprep test, because xmlstarlet is not installed."
- exit 0
-fi
-
rm -f test.img guestfish
qemu-img create -f qcow2 -o backing_file=../images/fedora.img test.img
# Run virt-inspector and grab inspection information about this guest.
virt-inspector "${params[@]}" > $tmpdir/xml
-xmlstarlet sel -t -c \
+virt-inspector --xpath \
"string(/operatingsystems/operatingsystem[position()=1]/name)" \
- $tmpdir/xml > $tmpdir/type
-xmlstarlet sel -t -c \
+ < $tmpdir/xml > $tmpdir/type
+virt-inspector --xpath \
"string(/operatingsystems/operatingsystem[position()=1]/distro)" \
- $tmpdir/xml > $tmpdir/distro ||:
-xmlstarlet sel -t -c \
+ < $tmpdir/xml > $tmpdir/distro ||:
+virt-inspector --xpath \
"string(/operatingsystems/operatingsystem[position()=1]/package_format)" \
- $tmpdir/xml > $tmpdir/package_format ||:
-xmlstarlet sel -t -c \
+ < $tmpdir/xml > $tmpdir/package_format ||:
+virt-inspector --xpath \
"string(/operatingsystems/operatingsystem[position()=1]/package_management)" \
- $tmpdir/xml > $tmpdir/package_management ||:
+ < $tmpdir/xml > $tmpdir/package_management ||:
type="$(cat $tmpdir/type)"
distro="$(cat $tmpdir/distro)"