提交 5158ac58 编写于 作者: K Kevin Wolf

Merge remote-tracking branch 'mreitz/tags/pull-block-for-kevin-2016-04-12' into queue-block

Block patches for 2.6-rc2.

# gpg: Signature made Tue Apr 12 18:08:20 2016 CEST using RSA key ID E838ACAD
# gpg: Good signature from "Max Reitz <mreitz@redhat.com>"

* mreitz/tags/pull-block-for-kevin-2016-04-12:
  qemu-iotests: iotests.py: get rid of __all__
  qemu-iotests: 068: don't require KVM
  qemu-iotests: 148: properly skip test if quorum support is missing
  qemu-iotests: iotests.VM: remove qtest socket on error
  qemu-iotests: fix 051 on non-PC architectures
  qemu-iotests: check: don't place files with predictable names in /tmp
Signed-off-by: NKevin Wolf <kwolf@redhat.com>
...@@ -145,7 +145,7 @@ QEMU X.Y.Z monitor - type 'help' for more information ...@@ -145,7 +145,7 @@ QEMU X.Y.Z monitor - type 'help' for more information
Testing: -drive driver=null-co,cache=invalid_value Testing: -drive driver=null-co,cache=invalid_value
QEMU_PROG: -drive driver=null-co,cache=invalid_value: invalid cache option QEMU_PROG: -drive driver=null-co,cache=invalid_value: invalid cache option
Testing: -drive file=TEST_DIR/t.qcow2,cache=writeback,backing.file.filename=TEST_DIR/t.qcow2.base,backing.cache.no-flush=on,backing.cache.writeback=on,backing.node-name=backing,backing.file.node-name=backing-file,file.node-name=file,if=none,id=drive0 -nodefaults Testing: -drive file=TEST_DIR/t.qcow2,cache=writeback,backing.file.filename=TEST_DIR/t.qcow2.base,backing.cache.no-flush=on,backing.node-name=backing,backing.file.node-name=backing-file,file.node-name=file,if=none,id=drive0 -nodefaults
QEMU X.Y.Z monitor - type 'help' for more information QEMU X.Y.Z monitor - type 'help' for more information
(qemu) iininfinfoinfo info binfo blinfo bloinfo blocinfo block (qemu) iininfinfoinfo info binfo blinfo bloinfo blocinfo block
drive0 (NODE_NAME): TEST_DIR/t.qcow2 (qcow2) drive0 (NODE_NAME): TEST_DIR/t.qcow2 (qcow2)
...@@ -165,7 +165,7 @@ backing-file: TEST_DIR/t.qcow2.base (file, read-only) ...@@ -165,7 +165,7 @@ backing-file: TEST_DIR/t.qcow2.base (file, read-only)
Cache mode: writeback, ignore flushes Cache mode: writeback, ignore flushes
(qemu) qququiquit (qemu) qququiquit
Testing: -drive file=TEST_DIR/t.qcow2,cache=writethrough,backing.file.filename=TEST_DIR/t.qcow2.base,backing.cache.no-flush=on,backing.cache.writeback=on,backing.node-name=backing,backing.file.node-name=backing-file,file.node-name=file,if=none,id=drive0 -nodefaults Testing: -drive file=TEST_DIR/t.qcow2,cache=writethrough,backing.file.filename=TEST_DIR/t.qcow2.base,backing.cache.no-flush=on,backing.node-name=backing,backing.file.node-name=backing-file,file.node-name=file,if=none,id=drive0 -nodefaults
QEMU X.Y.Z monitor - type 'help' for more information QEMU X.Y.Z monitor - type 'help' for more information
(qemu) iininfinfoinfo info binfo blinfo bloinfo blocinfo block (qemu) iininfinfoinfo info binfo blinfo bloinfo blocinfo block
drive0 (NODE_NAME): TEST_DIR/t.qcow2 (qcow2) drive0 (NODE_NAME): TEST_DIR/t.qcow2 (qcow2)
...@@ -185,7 +185,7 @@ backing-file: TEST_DIR/t.qcow2.base (file, read-only) ...@@ -185,7 +185,7 @@ backing-file: TEST_DIR/t.qcow2.base (file, read-only)
Cache mode: writeback, ignore flushes Cache mode: writeback, ignore flushes
(qemu) qququiquit (qemu) qququiquit
Testing: -drive file=TEST_DIR/t.qcow2,cache=unsafe,backing.file.filename=TEST_DIR/t.qcow2.base,backing.cache.no-flush=on,backing.cache.writeback=on,backing.node-name=backing,backing.file.node-name=backing-file,file.node-name=file,if=none,id=drive0 -nodefaults Testing: -drive file=TEST_DIR/t.qcow2,cache=unsafe,backing.file.filename=TEST_DIR/t.qcow2.base,backing.cache.no-flush=on,backing.node-name=backing,backing.file.node-name=backing-file,file.node-name=file,if=none,id=drive0 -nodefaults
QEMU X.Y.Z monitor - type 'help' for more information QEMU X.Y.Z monitor - type 'help' for more information
(qemu) iininfinfoinfo info binfo blinfo bloinfo blocinfo block (qemu) iininfinfoinfo info binfo blinfo bloinfo blocinfo block
drive0 (NODE_NAME): TEST_DIR/t.qcow2 (qcow2) drive0 (NODE_NAME): TEST_DIR/t.qcow2 (qcow2)
...@@ -205,8 +205,8 @@ backing-file: TEST_DIR/t.qcow2.base (file, read-only) ...@@ -205,8 +205,8 @@ backing-file: TEST_DIR/t.qcow2.base (file, read-only)
Cache mode: writeback, ignore flushes Cache mode: writeback, ignore flushes
(qemu) qququiquit (qemu) qququiquit
Testing: -drive file=TEST_DIR/t.qcow2,cache=invalid_value,backing.file.filename=TEST_DIR/t.qcow2.base,backing.cache.no-flush=on,backing.cache.writeback=on,backing.node-name=backing,backing.file.node-name=backing-file,file.node-name=file,if=none,id=drive0 -nodefaults Testing: -drive file=TEST_DIR/t.qcow2,cache=invalid_value,backing.file.filename=TEST_DIR/t.qcow2.base,backing.cache.no-flush=on,backing.node-name=backing,backing.file.node-name=backing-file,file.node-name=file,if=none,id=drive0 -nodefaults
QEMU_PROG: -drive file=TEST_DIR/t.qcow2,cache=invalid_value,backing.file.filename=TEST_DIR/t.qcow2.base,backing.cache.no-flush=on,backing.cache.writeback=on,backing.node-name=backing,backing.file.node-name=backing-file,file.node-name=file,if=none,id=drive0: invalid cache option QEMU_PROG: -drive file=TEST_DIR/t.qcow2,cache=invalid_value,backing.file.filename=TEST_DIR/t.qcow2.base,backing.cache.no-flush=on,backing.node-name=backing,backing.file.node-name=backing-file,file.node-name=file,if=none,id=drive0: invalid cache option
=== Specifying the protocol layer === === Specifying the protocol layer ===
......
...@@ -53,7 +53,7 @@ _make_test_img $IMG_SIZE ...@@ -53,7 +53,7 @@ _make_test_img $IMG_SIZE
case "$QEMU_DEFAULT_MACHINE" in case "$QEMU_DEFAULT_MACHINE" in
s390-ccw-virtio) s390-ccw-virtio)
platform_parm="-no-shutdown -machine accel=kvm" platform_parm="-no-shutdown"
;; ;;
*) *)
platform_parm="" platform_parm=""
......
...@@ -79,9 +79,6 @@ sector = "%d" ...@@ -79,9 +79,6 @@ sector = "%d"
self.assert_qmp(event, 'data/sector-num', sector) self.assert_qmp(event, 'data/sector-num', sector)
def testQuorum(self): def testQuorum(self):
if not 'quorum' in iotests.qemu_img_pipe('--help'):
return
# Generate an error and get an event # Generate an error and get an event
self.vm.hmp_qemu_io("drive0", "aio_read %d %d" % self.vm.hmp_qemu_io("drive0", "aio_read %d %d" %
(offset * sector_size, sector_size)) (offset * sector_size, sector_size))
...@@ -139,4 +136,5 @@ class TestFifoQuorumEvents(TestQuorumEvents): ...@@ -139,4 +136,5 @@ class TestFifoQuorumEvents(TestQuorumEvents):
read_pattern = 'fifo' read_pattern = 'fifo'
if __name__ == '__main__': if __name__ == '__main__':
iotests.verify_quorum()
iotests.main(supported_fmts=["raw"]) iotests.main(supported_fmts=["raw"])
...@@ -19,7 +19,6 @@ ...@@ -19,7 +19,6 @@
# Control script for QA # Control script for QA
# #
tmp=/tmp/$$
status=0 status=0
needwrap=true needwrap=true
try=0 try=0
...@@ -130,6 +129,8 @@ fi ...@@ -130,6 +129,8 @@ fi
# exit 1 # exit 1
#fi #fi
tmp="${TEST_DIR}"/$$
_wallclock() _wallclock()
{ {
date "+%H %M %S" | $AWK_PROG '{ print $1*3600 + $2*60 + $3 }' date "+%H %M %S" | $AWK_PROG '{ print $1*3600 + $2*60 + $3 }'
...@@ -146,8 +147,8 @@ _wrapup() ...@@ -146,8 +147,8 @@ _wrapup()
# for hangcheck ... # for hangcheck ...
# remove files that were used by hangcheck # remove files that were used by hangcheck
# #
[ -f /tmp/check.pid ] && rm -rf /tmp/check.pid [ -f "${TEST_DIR}"/check.pid ] && rm -rf "${TEST_DIR}"/check.pid
[ -f /tmp/check.sts ] && rm -rf /tmp/check.sts [ -f "${TEST_DIR}"/check.sts ] && rm -rf "${TEST_DIR}"/check.sts
if $showme if $showme
then then
...@@ -197,8 +198,8 @@ END { if (NR > 0) { ...@@ -197,8 +198,8 @@ END { if (NR > 0) {
needwrap=false needwrap=false
fi fi
rm -f /tmp/*.out /tmp/*.err /tmp/*.time rm -f "${TEST_DIR}"/*.out "${TEST_DIR}"/*.err "${TEST_DIR}"/*.time
rm -f /tmp/check.pid /tmp/check.sts rm -f "${TEST_DIR}"/check.pid "${TEST_DIR}"/check.sts
rm -f $tmp.* rm -f $tmp.*
} }
...@@ -208,16 +209,16 @@ trap "_wrapup; exit \$status" 0 1 2 3 15 ...@@ -208,16 +209,16 @@ trap "_wrapup; exit \$status" 0 1 2 3 15
# Save pid of check in a well known place, so that hangcheck can be sure it # Save pid of check in a well known place, so that hangcheck can be sure it
# has the right pid (getting the pid from ps output is not reliable enough). # has the right pid (getting the pid from ps output is not reliable enough).
# #
rm -rf /tmp/check.pid rm -rf "${TEST_DIR}"/check.pid
echo $$ >/tmp/check.pid echo $$ > "${TEST_DIR}"/check.pid
# for hangcheck ... # for hangcheck ...
# Save the status of check in a well known place, so that hangcheck can be # Save the status of check in a well known place, so that hangcheck can be
# sure to know where check is up to (getting test number from ps output is # sure to know where check is up to (getting test number from ps output is
# not reliable enough since the trace stuff has been introduced). # not reliable enough since the trace stuff has been introduced).
# #
rm -rf /tmp/check.sts rm -rf "${TEST_DIR}"/check.sts
echo "preamble" >/tmp/check.sts echo "preamble" > "${TEST_DIR}"/check.sts
# don't leave old full output behind on a clean run # don't leave old full output behind on a clean run
rm -f check.full rm -f check.full
...@@ -285,7 +286,7 @@ do ...@@ -285,7 +286,7 @@ do
rm -f core $seq.notrun rm -f core $seq.notrun
# for hangcheck ... # for hangcheck ...
echo "$seq" >/tmp/check.sts echo "$seq" > "${TEST_DIR}"/check.sts
start=`_wallclock` start=`_wallclock`
$timestamp && echo -n " ["`date "+%T"`"]" $timestamp && echo -n " ["`date "+%T"`"]"
......
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
# #
import errno
import os import os
import re import re
import subprocess import subprocess
...@@ -28,10 +29,6 @@ import qmp ...@@ -28,10 +29,6 @@ import qmp
import qtest import qtest
import struct import struct
__all__ = ['imgfmt', 'imgproto', 'test_dir' 'qemu_img', 'qemu_io',
'VM', 'QMPTestCase', 'notrun', 'main', 'verify_image_format',
'verify_platform', 'filter_test_dir', 'filter_win32',
'filter_qemu_io', 'filter_chown', 'log']
# This will not work if arguments contain spaces but is necessary if we # This will not work if arguments contain spaces but is necessary if we
# want to support the override options that ./check supports. # want to support the override options that ./check supports.
...@@ -247,7 +244,8 @@ class VM(object): ...@@ -247,7 +244,8 @@ class VM(object):
self._qmp.accept() self._qmp.accept()
self._qtest.accept() self._qtest.accept()
except: except:
os.remove(self._monitor_path) _remove_if_exists(self._monitor_path)
_remove_if_exists(self._qtest_path)
raise raise
def shutdown(self): def shutdown(self):
...@@ -409,6 +407,15 @@ class QMPTestCase(unittest.TestCase): ...@@ -409,6 +407,15 @@ class QMPTestCase(unittest.TestCase):
event = self.wait_until_completed(drive=drive) event = self.wait_until_completed(drive=drive)
self.assert_qmp(event, 'data/type', 'mirror') self.assert_qmp(event, 'data/type', 'mirror')
def _remove_if_exists(path):
'''Remove file object at path if it exists'''
try:
os.remove(path)
except OSError as exception:
if exception.errno == errno.ENOENT:
return
raise
def notrun(reason): def notrun(reason):
'''Skip this test suite''' '''Skip this test suite'''
# Each test in qemu-iotests has a number ("seq") # Each test in qemu-iotests has a number ("seq")
...@@ -426,6 +433,11 @@ def verify_platform(supported_oses=['linux']): ...@@ -426,6 +433,11 @@ def verify_platform(supported_oses=['linux']):
if True not in [sys.platform.startswith(x) for x in supported_oses]: if True not in [sys.platform.startswith(x) for x in supported_oses]:
notrun('not suitable for this OS: %s' % sys.platform) notrun('not suitable for this OS: %s' % sys.platform)
def verify_quorum():
'''Skip test suite if quorum support is not available'''
if 'quorum' not in qemu_img_pipe('--help'):
notrun('quorum support missing')
def main(supported_fmts=[], supported_oses=['linux']): def main(supported_fmts=[], supported_oses=['linux']):
'''Run tests''' '''Run tests'''
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册