-#!/bin/bash
+#!/usr/bin/env bash
#
# Test case for loading a saved VM state from a qcow2 image
#
seq="$(basename $0)"
echo "QA output created by $seq"
-here="$PWD"
status=1 # failure is the default!
_cleanup()
. ./common.rc
. ./common.filter
-# This tests qocw2-specific low-level functionality
+# This tests qcow2-specific low-level functionality
_supported_fmt qcow2
_supported_proto generic
-_supported_os Linux
+# Internal snapshots are (currently) impossible with refcount_bits=1,
+# and generally impossible with external data files
+_unsupported_imgopts 'compat=0.10' 'refcount_bits=1[^0-9]' data_file
-IMGOPTS="compat=1.1"
IMG_SIZE=128K
case "$QEMU_DEFAULT_MACHINE" in
_make_test_img $IMG_SIZE
# Give qemu some time to boot before saving the VM state
- bash -c 'sleep 1; echo -e "savevm 0\nquit"' | _qemu $extra_args
+ { sleep 1; printf "savevm 0\nquit\n"; } | _qemu $extra_args
# Now try to continue from that VM state (this should just work)
- echo quit | _qemu $extra_args -loadvm 0
+ { sleep 1; printf "loadvm 0\nloadvm 0\nquit\n"; } | _qemu $extra_args -S
done
# success, all done