Files
libguestfs/cat/test-virt-cat.sh
Richard W.M. Jones d29e9a552f Rewrite virt-cat in C.
With changes in the core API since 1.5, virt-cat was little
more than a Perl wrapper which did some command line argument
processing.  Thus it could easily be rewritten in C.

This version also shares core command line argument processing
with guestfish and guestmount, so the options have changed
slightly (old-style command line *is* supported).

 virt-cat -a disk.img file [file ...]
 virt-cat -d domname file [file ...]

Several other guestfish options are supported including encryption,
and with the new style multiple files can be downloaded.  See the
man page for details.
2010-11-11 16:56:43 +00:00

15 lines
353 B
Bash
Executable File

#!/bin/bash -
export LANG=C
set -e
# Read out the test files from the image using virt-cat.
if [ "$(./virt-cat ../images/fedora.img /etc/test1)" != "abcdefg" ]; then
echo "$0: error: mismatch in file test1"
exit 1
fi
if [ "$(./virt-cat ../images/fedora.img /etc/test2)" != "" ]; then
echo "$0: error: mismatch in file test2"
exit 1
fi