expunge=true
have_test_arg=false
cachemode=false
+aiomode=false
tmp="${TEST_DIR}"/$$
rm -f $tmp.list $tmp.tmp $tmp.sed
export IMGPROTO=file
export IMGOPTS=""
export CACHEMODE="writeback"
+export AIOMODE="threads"
export QEMU_IO_OPTIONS=""
export QEMU_IO_OPTIONS_NO_FMT=""
export CACHEMODE_IS_DEFAULT=true
CACHEMODE_IS_DEFAULT=false
cachemode=false
continue
+ elif $aiomode
+ then
+ AIOMODE="$r"
+ aiomode=false
+ continue
fi
xpand=true
-n show me, do not run tests
-o options -o options to pass to qemu-img create/convert
-c mode cache mode
+ -i mode AIO mode
-makecheck pretty print output for make check
testlist options
cachemode=true
xpand=false
;;
+ -i)
+ aiomode=true
+ xpand=false
+ ;;
-T) # deprecated timestamp option
xpand=false
;;
-
-v)
verbose=true
xpand=false
# Set qemu-io cache mode with $CACHEMODE we have
QEMU_IO_OPTIONS="$QEMU_IO_OPTIONS --cache $CACHEMODE"
+# Set qemu-io aio mode with $AIOMODE we have
+QEMU_IO_OPTIONS="$QEMU_IO_OPTIONS --aio $AIOMODE"
QEMU_IO_OPTIONS_NO_FMT="$QEMU_IO_OPTIONS"
if [ "$IMGOPTSSYNTAX" != "true" ]; then
sock_dir = os.environ.get('SOCK_DIR')
output_dir = os.environ.get('OUTPUT_DIR', '.')
cachemode = os.environ.get('CACHEMODE')
+aiomode = os.environ.get('AIOMODE')
qemu_default_machine = os.environ.get('QEMU_DEFAULT_MACHINE')
socket_scm_helper = os.environ.get('SOCKET_SCM_HELPER', 'socket_scm_helper')
options.append('file=%s' % path)
options.append('format=%s' % format)
options.append('cache=%s' % cachemode)
+ options.append('aio=%s' % aiomode)
if opts:
options.append(opts)
if supported_cache_modes and (cachemode not in supported_cache_modes):
notrun('not suitable for this cache mode: %s' % cachemode)
+def verify_aio_mode(supported_aio_modes=[]):
+ if supported_aio_modes and (aiomode not in supported_aio_modes):
+ notrun('not suitable for this aio mode: %s' % aiomode)
+
def supports_quorum():
return 'quorum' in qemu_img_pipe('--help')
def execute_test(test_function=None,
supported_fmts=[], supported_oses=['linux'],
- supported_cache_modes=[], unsupported_fmts=[],
- supported_protocols=[], unsupported_protocols=[]):
+ supported_cache_modes=[], supported_aio_modes={},
+ unsupported_fmts=[], supported_protocols=[],
+ unsupported_protocols=[]):
"""Run either unittest or script-style tests."""
# We are using TEST_DIR and QEMU_DEFAULT_MACHINE as proxies to
verify_protocol(supported_protocols, unsupported_protocols)
verify_platform(supported_oses)
verify_cache_mode(supported_cache_modes)
+ verify_aio_mode(supported_aio_modes)
if debug:
output = sys.stdout