aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin Wolf <kwolf@redhat.com>2016-04-15 17:59:42 +0200
committerKevin Wolf <kwolf@redhat.com>2016-04-15 17:59:42 +0200
commitcdc8845331cf789636dfa88dc47e22fcdaef4057 (patch)
treecb982c9869a1919426e1b74366f5788c744bea31
parent90c647db8d59e47c9000affc0d81754eb346e939 (diff)
parentd1129a8ad96af6bc47404490769a637bcd860493 (diff)
downloadqemu-cdc8845331cf789636dfa88dc47e22fcdaef4057.zip
qemu-cdc8845331cf789636dfa88dc47e22fcdaef4057.tar.gz
qemu-cdc8845331cf789636dfa88dc47e22fcdaef4057.tar.bz2
Merge remote-tracking branch 'mreitz/tags/pull-block-for-kevin-2016-04-15' into queue-block
Block patches for 2.6.0-rc3. # gpg: Signature made Fri Apr 15 17:57:30 2016 CEST using RSA key ID E838ACAD # gpg: Good signature from "Max Reitz <mreitz@redhat.com>" * mreitz/tags/pull-block-for-kevin-2016-04-15: nbd: Don't kill server on client that doesn't request TLS nbd: fix assert() on qemu-nbd stop nbd: Don't fail handshake on NBD_OPT_LIST descriptions qemu-iotests: 041: More robust assertion on quorum node qemu-iotests: place valgrind log file in scratch dir qemu-iotests: tests: do not set unused tmp variable qemu-iotests: common.rc: drop unused _do() qemu-iotests: drop unused _within_tolerance() filter Signed-off-by: Kevin Wolf <kwolf@redhat.com>
-rw-r--r--nbd/client.c23
-rw-r--r--nbd/server.c15
-rw-r--r--qemu-nbd.c2
-rwxr-xr-xtests/qemu-iotests/0011
-rwxr-xr-xtests/qemu-iotests/0021
-rwxr-xr-xtests/qemu-iotests/0031
-rwxr-xr-xtests/qemu-iotests/0041
-rwxr-xr-xtests/qemu-iotests/0051
-rwxr-xr-xtests/qemu-iotests/0071
-rwxr-xr-xtests/qemu-iotests/0081
-rwxr-xr-xtests/qemu-iotests/0091
-rwxr-xr-xtests/qemu-iotests/0101
-rwxr-xr-xtests/qemu-iotests/0111
-rwxr-xr-xtests/qemu-iotests/0121
-rwxr-xr-xtests/qemu-iotests/0131
-rwxr-xr-xtests/qemu-iotests/0141
-rwxr-xr-xtests/qemu-iotests/0151
-rwxr-xr-xtests/qemu-iotests/0171
-rwxr-xr-xtests/qemu-iotests/0181
-rwxr-xr-xtests/qemu-iotests/0191
-rwxr-xr-xtests/qemu-iotests/0201
-rwxr-xr-xtests/qemu-iotests/0211
-rwxr-xr-xtests/qemu-iotests/0221
-rwxr-xr-xtests/qemu-iotests/0231
-rwxr-xr-xtests/qemu-iotests/0241
-rwxr-xr-xtests/qemu-iotests/0251
-rwxr-xr-xtests/qemu-iotests/0261
-rwxr-xr-xtests/qemu-iotests/0271
-rwxr-xr-xtests/qemu-iotests/0281
-rwxr-xr-xtests/qemu-iotests/0291
-rwxr-xr-xtests/qemu-iotests/0311
-rwxr-xr-xtests/qemu-iotests/0321
-rwxr-xr-xtests/qemu-iotests/0331
-rwxr-xr-xtests/qemu-iotests/0341
-rwxr-xr-xtests/qemu-iotests/0351
-rwxr-xr-xtests/qemu-iotests/0361
-rwxr-xr-xtests/qemu-iotests/0371
-rwxr-xr-xtests/qemu-iotests/0381
-rwxr-xr-xtests/qemu-iotests/0391
-rwxr-xr-xtests/qemu-iotests/04112
-rwxr-xr-xtests/qemu-iotests/0421
-rwxr-xr-xtests/qemu-iotests/0431
-rwxr-xr-xtests/qemu-iotests/0461
-rwxr-xr-xtests/qemu-iotests/0471
-rwxr-xr-xtests/qemu-iotests/0491
-rwxr-xr-xtests/qemu-iotests/0501
-rwxr-xr-xtests/qemu-iotests/0511
-rwxr-xr-xtests/qemu-iotests/0521
-rwxr-xr-xtests/qemu-iotests/0531
-rwxr-xr-xtests/qemu-iotests/0541
-rwxr-xr-xtests/qemu-iotests/0581
-rwxr-xr-xtests/qemu-iotests/0591
-rwxr-xr-xtests/qemu-iotests/0601
-rwxr-xr-xtests/qemu-iotests/0611
-rwxr-xr-xtests/qemu-iotests/0621
-rwxr-xr-xtests/qemu-iotests/0631
-rwxr-xr-xtests/qemu-iotests/0641
-rwxr-xr-xtests/qemu-iotests/0661
-rwxr-xr-xtests/qemu-iotests/0671
-rwxr-xr-xtests/qemu-iotests/0681
-rwxr-xr-xtests/qemu-iotests/0691
-rwxr-xr-xtests/qemu-iotests/0701
-rwxr-xr-xtests/qemu-iotests/0711
-rwxr-xr-xtests/qemu-iotests/0721
-rwxr-xr-xtests/qemu-iotests/0731
-rwxr-xr-xtests/qemu-iotests/0751
-rwxr-xr-xtests/qemu-iotests/0761
-rwxr-xr-xtests/qemu-iotests/0771
-rwxr-xr-xtests/qemu-iotests/0781
-rwxr-xr-xtests/qemu-iotests/0791
-rwxr-xr-xtests/qemu-iotests/0801
-rwxr-xr-xtests/qemu-iotests/0811
-rwxr-xr-xtests/qemu-iotests/0821
-rwxr-xr-xtests/qemu-iotests/0831
-rwxr-xr-xtests/qemu-iotests/0841
-rwxr-xr-xtests/qemu-iotests/0861
-rwxr-xr-xtests/qemu-iotests/0871
-rwxr-xr-xtests/qemu-iotests/0881
-rwxr-xr-xtests/qemu-iotests/0891
-rwxr-xr-xtests/qemu-iotests/0901
-rwxr-xr-xtests/qemu-iotests/0921
-rwxr-xr-xtests/qemu-iotests/0941
-rwxr-xr-xtests/qemu-iotests/0971
-rwxr-xr-xtests/qemu-iotests/0981
-rwxr-xr-xtests/qemu-iotests/0991
-rwxr-xr-xtests/qemu-iotests/1001
-rwxr-xr-xtests/qemu-iotests/1011
-rwxr-xr-xtests/qemu-iotests/1021
-rwxr-xr-xtests/qemu-iotests/1031
-rwxr-xr-xtests/qemu-iotests/1041
-rwxr-xr-xtests/qemu-iotests/1051
-rwxr-xr-xtests/qemu-iotests/1071
-rwxr-xr-xtests/qemu-iotests/1081
-rwxr-xr-xtests/qemu-iotests/1091
-rwxr-xr-xtests/qemu-iotests/1101
-rwxr-xr-xtests/qemu-iotests/1111
-rwxr-xr-xtests/qemu-iotests/1121
-rwxr-xr-xtests/qemu-iotests/1131
-rwxr-xr-xtests/qemu-iotests/1141
-rwxr-xr-xtests/qemu-iotests/1151
-rwxr-xr-xtests/qemu-iotests/1161
-rwxr-xr-xtests/qemu-iotests/1171
-rwxr-xr-xtests/qemu-iotests/1191
-rwxr-xr-xtests/qemu-iotests/1201
-rwxr-xr-xtests/qemu-iotests/1211
-rwxr-xr-xtests/qemu-iotests/1221
-rwxr-xr-xtests/qemu-iotests/1231
-rwxr-xr-xtests/qemu-iotests/1281
-rwxr-xr-xtests/qemu-iotests/1301
-rwxr-xr-xtests/qemu-iotests/1311
-rwxr-xr-xtests/qemu-iotests/1331
-rwxr-xr-xtests/qemu-iotests/1341
-rwxr-xr-xtests/qemu-iotests/1351
-rwxr-xr-xtests/qemu-iotests/1371
-rwxr-xr-xtests/qemu-iotests/1381
-rwxr-xr-xtests/qemu-iotests/1401
-rwxr-xr-xtests/qemu-iotests/1411
-rwxr-xr-xtests/qemu-iotests/1421
-rwxr-xr-xtests/qemu-iotests/1431
-rwxr-xr-xtests/qemu-iotests/1451
-rwxr-xr-xtests/qemu-iotests/1501
-rw-r--r--tests/qemu-iotests/common.config2
-rw-r--r--tests/qemu-iotests/common.filter101
-rw-r--r--tests/qemu-iotests/common.rc46
-rw-r--r--tests/qemu-iotests/iotests.py14
125 files changed, 54 insertions, 278 deletions
diff --git a/nbd/client.c b/nbd/client.c
index 6777e58..48f2a21 100644
--- a/nbd/client.c
+++ b/nbd/client.c
@@ -192,13 +192,18 @@ static int nbd_receive_list(QIOChannel *ioc, char **name, Error **errp)
return -1;
}
} else if (type == NBD_REP_SERVER) {
+ if (len < sizeof(namelen) || len > NBD_MAX_BUFFER_SIZE) {
+ error_setg(errp, "incorrect option length");
+ return -1;
+ }
if (read_sync(ioc, &namelen, sizeof(namelen)) != sizeof(namelen)) {
error_setg(errp, "failed to read option name length");
return -1;
}
namelen = be32_to_cpu(namelen);
- if (len != (namelen + sizeof(namelen))) {
- error_setg(errp, "incorrect option mame length");
+ len -= sizeof(namelen);
+ if (len < namelen) {
+ error_setg(errp, "incorrect option name length");
return -1;
}
if (namelen > 255) {
@@ -214,6 +219,20 @@ static int nbd_receive_list(QIOChannel *ioc, char **name, Error **errp)
return -1;
}
(*name)[namelen] = '\0';
+ len -= namelen;
+ if (len) {
+ char *buf = g_malloc(len + 1);
+ if (read_sync(ioc, buf, len) != len) {
+ error_setg(errp, "failed to read export description");
+ g_free(*name);
+ g_free(buf);
+ *name = NULL;
+ return -1;
+ }
+ buf[len] = '\0';
+ TRACE("Ignoring export description: %s", buf);
+ g_free(buf);
+ }
} else {
error_setg(errp, "Unexpected reply type %x expected %x",
type, NBD_REP_SERVER);
diff --git a/nbd/server.c b/nbd/server.c
index 2a4dd10..a13a691 100644
--- a/nbd/server.c
+++ b/nbd/server.c
@@ -449,11 +449,19 @@ static int nbd_negotiate_options(NBDClient *client)
client->ioc = QIO_CHANNEL(tioc);
break;
+ case NBD_OPT_EXPORT_NAME:
+ /* No way to return an error to client, so drop connection */
+ TRACE("Option 0x%x not permitted before TLS", clientflags);
+ return -EINVAL;
+
default:
TRACE("Option 0x%x not permitted before TLS", clientflags);
+ if (nbd_negotiate_drop_sync(client->ioc, length) != length) {
+ return -EIO;
+ }
nbd_negotiate_send_rep(client->ioc, NBD_REP_ERR_TLS_REQD,
clientflags);
- return -EINVAL;
+ break;
}
} else if (fixedNewstyle) {
switch (clientflags) {
@@ -471,6 +479,9 @@ static int nbd_negotiate_options(NBDClient *client)
return nbd_negotiate_handle_export_name(client, length);
case NBD_OPT_STARTTLS:
+ if (nbd_negotiate_drop_sync(client->ioc, length) != length) {
+ return -EIO;
+ }
if (client->tlscreds) {
TRACE("TLS already enabled");
nbd_negotiate_send_rep(client->ioc, NBD_REP_ERR_INVALID,
@@ -480,7 +491,7 @@ static int nbd_negotiate_options(NBDClient *client)
nbd_negotiate_send_rep(client->ioc, NBD_REP_ERR_POLICY,
clientflags);
}
- return -EINVAL;
+ break;
default:
TRACE("Unsupported option 0x%x", clientflags);
if (nbd_negotiate_drop_sync(client->ioc, length) != length) {
diff --git a/qemu-nbd.c b/qemu-nbd.c
index b5751f8..2c9754e 100644
--- a/qemu-nbd.c
+++ b/qemu-nbd.c
@@ -215,7 +215,7 @@ static int find_partition(BlockBackend *blk, int partition,
static void termsig_handler(int signum)
{
- state = TERMINATE;
+ atomic_cmpxchg(&state, RUNNING, TERMINATE);
qemu_notify_event();
}
diff --git a/tests/qemu-iotests/001 b/tests/qemu-iotests/001
index 4e164694..ffd14e2 100755
--- a/tests/qemu-iotests/001
+++ b/tests/qemu-iotests/001
@@ -25,7 +25,6 @@ seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
-tmp=/tmp/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/002 b/tests/qemu-iotests/002
index 6a865aa..d4f8e91 100755
--- a/tests/qemu-iotests/002
+++ b/tests/qemu-iotests/002
@@ -25,7 +25,6 @@ seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
-tmp=/tmp/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/003 b/tests/qemu-iotests/003
index 98638d4..19889b9 100755
--- a/tests/qemu-iotests/003
+++ b/tests/qemu-iotests/003
@@ -25,7 +25,6 @@ seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
-tmp=/tmp/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/004 b/tests/qemu-iotests/004
index 2ad77ed..67e1beb 100755
--- a/tests/qemu-iotests/004
+++ b/tests/qemu-iotests/004
@@ -25,7 +25,6 @@ seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
-tmp=/tmp/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/005 b/tests/qemu-iotests/005
index ba1236d..4447377 100755
--- a/tests/qemu-iotests/005
+++ b/tests/qemu-iotests/005
@@ -28,7 +28,6 @@ seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
-tmp=/tmp/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/007 b/tests/qemu-iotests/007
index 7b5aff5..fa543ee 100755
--- a/tests/qemu-iotests/007
+++ b/tests/qemu-iotests/007
@@ -25,7 +25,6 @@ seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
-tmp=/tmp/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/008 b/tests/qemu-iotests/008
index 2d28efd..8e89d74 100755
--- a/tests/qemu-iotests/008
+++ b/tests/qemu-iotests/008
@@ -25,7 +25,6 @@ seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
-tmp=/tmp/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/009 b/tests/qemu-iotests/009
index 57a43f5..16e4475 100755
--- a/tests/qemu-iotests/009
+++ b/tests/qemu-iotests/009
@@ -25,7 +25,6 @@ seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
-tmp=/tmp/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/010 b/tests/qemu-iotests/010
index 896a005..151dac2 100755
--- a/tests/qemu-iotests/010
+++ b/tests/qemu-iotests/010
@@ -25,7 +25,6 @@ seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
-tmp=/tmp/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/011 b/tests/qemu-iotests/011
index 1c5158a..f8d044e 100755
--- a/tests/qemu-iotests/011
+++ b/tests/qemu-iotests/011
@@ -25,7 +25,6 @@ seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
-tmp=/tmp/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/012 b/tests/qemu-iotests/012
index 7c5b689..d1d3f22 100755
--- a/tests/qemu-iotests/012
+++ b/tests/qemu-iotests/012
@@ -27,7 +27,6 @@ seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
-tmp=/tmp/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/013 b/tests/qemu-iotests/013
index ea3cab9..d013f87 100755
--- a/tests/qemu-iotests/013
+++ b/tests/qemu-iotests/013
@@ -25,7 +25,6 @@ seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
-tmp=/tmp/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/014 b/tests/qemu-iotests/014
index b23c2db..2ea79e8 100755
--- a/tests/qemu-iotests/014
+++ b/tests/qemu-iotests/014
@@ -27,7 +27,6 @@ seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
-tmp=/tmp/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/015 b/tests/qemu-iotests/015
index 6f26095..aaf9c3f 100755
--- a/tests/qemu-iotests/015
+++ b/tests/qemu-iotests/015
@@ -25,7 +25,6 @@ seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
-tmp=/tmp/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/017 b/tests/qemu-iotests/017
index 3af3cdf..e3f9e75 100755
--- a/tests/qemu-iotests/017
+++ b/tests/qemu-iotests/017
@@ -25,7 +25,6 @@ seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
-tmp=/tmp/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/018 b/tests/qemu-iotests/018
index 07b2de9..1d39d35 100755
--- a/tests/qemu-iotests/018
+++ b/tests/qemu-iotests/018
@@ -25,7 +25,6 @@ seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
-tmp=/tmp/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/019 b/tests/qemu-iotests/019
index 0937b5c..24a789a 100755
--- a/tests/qemu-iotests/019
+++ b/tests/qemu-iotests/019
@@ -27,7 +27,6 @@ seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
-tmp=/tmp/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/020 b/tests/qemu-iotests/020
index 6625b55..9c4a68c 100755
--- a/tests/qemu-iotests/020
+++ b/tests/qemu-iotests/020
@@ -25,7 +25,6 @@ seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
-tmp=/tmp/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/021 b/tests/qemu-iotests/021
index 1c69024..11e8ed7 100755
--- a/tests/qemu-iotests/021
+++ b/tests/qemu-iotests/021
@@ -25,7 +25,6 @@ seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
-tmp=/tmp/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/022 b/tests/qemu-iotests/022
index d35b816..2452a9f 100755
--- a/tests/qemu-iotests/022
+++ b/tests/qemu-iotests/022
@@ -27,7 +27,6 @@ seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
-tmp=/tmp/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/023 b/tests/qemu-iotests/023
index 9ad06b9..497ae1e 100755
--- a/tests/qemu-iotests/023
+++ b/tests/qemu-iotests/023
@@ -25,7 +25,6 @@ seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
-tmp=/tmp/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/024 b/tests/qemu-iotests/024
index 2c2d148..e0d77ce 100755
--- a/tests/qemu-iotests/024
+++ b/tests/qemu-iotests/024
@@ -25,7 +25,6 @@ seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
-tmp=/tmp/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/025 b/tests/qemu-iotests/025
index 467a4b7..c41370f 100755
--- a/tests/qemu-iotests/025
+++ b/tests/qemu-iotests/025
@@ -25,7 +25,6 @@ seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
-tmp=/tmp/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/026 b/tests/qemu-iotests/026
index ba1047c..f5a7f02 100755
--- a/tests/qemu-iotests/026
+++ b/tests/qemu-iotests/026
@@ -25,7 +25,6 @@ seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
-tmp=/tmp/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/027 b/tests/qemu-iotests/027
index 3fa81b8..08593da 100755
--- a/tests/qemu-iotests/027
+++ b/tests/qemu-iotests/027
@@ -25,7 +25,6 @@ seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
-tmp=/tmp/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/028 b/tests/qemu-iotests/028
index 4909b9b..7783e57 100755
--- a/tests/qemu-iotests/028
+++ b/tests/qemu-iotests/028
@@ -28,7 +28,6 @@ seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
-tmp=/tmp/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/029 b/tests/qemu-iotests/029
index b9cd826..e639ac0 100755
--- a/tests/qemu-iotests/029
+++ b/tests/qemu-iotests/029
@@ -25,7 +25,6 @@ seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
-tmp=/tmp/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/031 b/tests/qemu-iotests/031
index 2a77ba8..1e08abc 100755
--- a/tests/qemu-iotests/031
+++ b/tests/qemu-iotests/031
@@ -25,7 +25,6 @@ seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
-tmp=/tmp/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/032 b/tests/qemu-iotests/032
index b1ba5c3..24bcb52 100755
--- a/tests/qemu-iotests/032
+++ b/tests/qemu-iotests/032
@@ -27,7 +27,6 @@ seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
-tmp=/tmp/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/033 b/tests/qemu-iotests/033
index 912373d..16edcf2 100755
--- a/tests/qemu-iotests/033
+++ b/tests/qemu-iotests/033
@@ -25,7 +25,6 @@ seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
-tmp=/tmp/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/034 b/tests/qemu-iotests/034
index c769dd8..c711cfc 100755
--- a/tests/qemu-iotests/034
+++ b/tests/qemu-iotests/034
@@ -25,7 +25,6 @@ seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
-tmp=/tmp/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/035 b/tests/qemu-iotests/035
index ebe9b8c..efc38e4 100755
--- a/tests/qemu-iotests/035
+++ b/tests/qemu-iotests/035
@@ -26,7 +26,6 @@ seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
-tmp=/tmp/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/036 b/tests/qemu-iotests/036
index c4cc91b..ce638d6 100755
--- a/tests/qemu-iotests/036
+++ b/tests/qemu-iotests/036
@@ -28,7 +28,6 @@ seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
-tmp=/tmp/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/037 b/tests/qemu-iotests/037
index 5862451..c476b82 100755
--- a/tests/qemu-iotests/037
+++ b/tests/qemu-iotests/037
@@ -25,7 +25,6 @@ seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
-tmp=/tmp/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/038 b/tests/qemu-iotests/038
index 34fe698..d99a150 100755
--- a/tests/qemu-iotests/038
+++ b/tests/qemu-iotests/038
@@ -25,7 +25,6 @@ seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
-tmp=/tmp/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/039 b/tests/qemu-iotests/039
index 9e9b379..1f483396 100755
--- a/tests/qemu-iotests/039
+++ b/tests/qemu-iotests/039
@@ -28,7 +28,6 @@ seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
-tmp=/tmp/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/041 b/tests/qemu-iotests/041
index c7da95d..b1c542f 100755
--- a/tests/qemu-iotests/041
+++ b/tests/qemu-iotests/041
@@ -810,8 +810,7 @@ class TestRepairQuorum(iotests.QMPTestCase):
self.assert_qmp(result, 'return', {})
self.complete_and_wait(drive="quorum0")
- result = self.vm.qmp('query-named-block-nodes')
- self.assert_qmp(result, 'return[0]/file', quorum_repair_img)
+ self.assert_has_block_node("repair0", quorum_repair_img)
# TODO: a better test requiring some QEMU infrastructure will be added
# to check that this file is really driven by quorum
self.vm.shutdown()
@@ -833,8 +832,7 @@ class TestRepairQuorum(iotests.QMPTestCase):
self.cancel_and_wait(drive="quorum0", force=True)
# here we check that the last registered quorum file has not been
# swapped out and unref
- result = self.vm.qmp('query-named-block-nodes')
- self.assert_qmp(result, 'return[1]/file', quorum_img3)
+ self.assert_has_block_node(None, quorum_img3)
self.vm.shutdown()
def test_cancel_after_ready(self):
@@ -850,10 +848,9 @@ class TestRepairQuorum(iotests.QMPTestCase):
self.assert_qmp(result, 'return', {})
self.wait_ready_and_cancel(drive="quorum0")
- result = self.vm.qmp('query-named-block-nodes')
# here we check that the last registered quorum file has not been
# swapped out and unref
- self.assert_qmp(result, 'return[1]/file', quorum_img3)
+ self.assert_has_block_node(None, quorum_img3)
self.vm.shutdown()
self.assertTrue(iotests.compare_images(quorum_img2, quorum_repair_img),
'target image does not match source after mirroring')
@@ -974,8 +971,7 @@ class TestRepairQuorum(iotests.QMPTestCase):
self.assert_qmp(result, 'return', {})
self.complete_and_wait(drive="quorum0")
- result = self.vm.qmp('query-named-block-nodes')
- self.assert_qmp(result, 'return[0]/file', quorum_repair_img)
+ self.assert_has_block_node("repair0", quorum_repair_img)
# TODO: a better test requiring some QEMU infrastructure will be added
# to check that this file is really driven by quorum
self.vm.shutdown()
diff --git a/tests/qemu-iotests/042 b/tests/qemu-iotests/042
index 94ce3a9..351b283 100755
--- a/tests/qemu-iotests/042
+++ b/tests/qemu-iotests/042
@@ -25,7 +25,6 @@ seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
-tmp=/tmp/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/043 b/tests/qemu-iotests/043
index b316b97..1c6c22d 100755
--- a/tests/qemu-iotests/043
+++ b/tests/qemu-iotests/043
@@ -25,7 +25,6 @@ seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
-tmp=/tmp/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/046 b/tests/qemu-iotests/046
index e0be46c..e528b67 100755
--- a/tests/qemu-iotests/046
+++ b/tests/qemu-iotests/046
@@ -25,7 +25,6 @@ seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
-tmp=/tmp/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/047 b/tests/qemu-iotests/047
index c35cd09..1b8f3d4 100755
--- a/tests/qemu-iotests/047
+++ b/tests/qemu-iotests/047
@@ -26,7 +26,6 @@ seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
-tmp=/tmp/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/049 b/tests/qemu-iotests/049
index 93aa0ea..fff0760 100755
--- a/tests/qemu-iotests/049
+++ b/tests/qemu-iotests/049
@@ -25,7 +25,6 @@ seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
-tmp=/tmp/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/050 b/tests/qemu-iotests/050
index 13006dd..03b4a5d 100755
--- a/tests/qemu-iotests/050
+++ b/tests/qemu-iotests/050
@@ -25,7 +25,6 @@ seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
-tmp=/tmp/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/051 b/tests/qemu-iotests/051
index 88b3d91..630cb7a 100755
--- a/tests/qemu-iotests/051
+++ b/tests/qemu-iotests/051
@@ -25,7 +25,6 @@ seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
-tmp=/tmp/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/052 b/tests/qemu-iotests/052
index 61959e2..4b64724 100755
--- a/tests/qemu-iotests/052
+++ b/tests/qemu-iotests/052
@@ -25,7 +25,6 @@ seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
-tmp=/tmp/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/053 b/tests/qemu-iotests/053
index e589e5f..2a04f5f 100755
--- a/tests/qemu-iotests/053
+++ b/tests/qemu-iotests/053
@@ -25,7 +25,6 @@ seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
-tmp=/tmp/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/054 b/tests/qemu-iotests/054
index bd94153..bf47ef9 100755
--- a/tests/qemu-iotests/054
+++ b/tests/qemu-iotests/054
@@ -25,7 +25,6 @@ seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
-tmp=/tmp/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/058 b/tests/qemu-iotests/058
index 63a6598..2253c6a 100755
--- a/tests/qemu-iotests/058
+++ b/tests/qemu-iotests/058
@@ -27,7 +27,6 @@ seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
-tmp=/tmp/$$
status=1 # failure is the default!
nbd_unix_socket=$TEST_DIR/test_qemu_nbd_socket
diff --git a/tests/qemu-iotests/059 b/tests/qemu-iotests/059
index 0332bbb..6655aaf 100755
--- a/tests/qemu-iotests/059
+++ b/tests/qemu-iotests/059
@@ -25,7 +25,6 @@ seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
-tmp=/tmp/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/060 b/tests/qemu-iotests/060
index c81319c..8e95c45 100755
--- a/tests/qemu-iotests/060
+++ b/tests/qemu-iotests/060
@@ -25,7 +25,6 @@ seq="$(basename $0)"
echo "QA output created by $seq"
here="$PWD"
-tmp=/tmp/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/061 b/tests/qemu-iotests/061
index e191e65..f5678b1 100755
--- a/tests/qemu-iotests/061
+++ b/tests/qemu-iotests/061
@@ -25,7 +25,6 @@ seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
-tmp=/tmp/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/062 b/tests/qemu-iotests/062
index 0511246..051fb9f 100755
--- a/tests/qemu-iotests/062
+++ b/tests/qemu-iotests/062
@@ -26,7 +26,6 @@ seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
-tmp=/tmp/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/063 b/tests/qemu-iotests/063
index a47493a..352e78c 100755
--- a/tests/qemu-iotests/063
+++ b/tests/qemu-iotests/063
@@ -26,7 +26,6 @@ seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
-tmp=/tmp/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/064 b/tests/qemu-iotests/064
index 7564563..5792fbb 100755
--- a/tests/qemu-iotests/064
+++ b/tests/qemu-iotests/064
@@ -25,7 +25,6 @@ seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
-tmp=/tmp/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/066 b/tests/qemu-iotests/066
index 1c2452b..364166d 100755
--- a/tests/qemu-iotests/066
+++ b/tests/qemu-iotests/066
@@ -25,7 +25,6 @@ seq="$(basename $0)"
echo "QA output created by $seq"
here="$PWD"
-tmp=/tmp/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/067 b/tests/qemu-iotests/067
index 77dec0d..c1df48e 100755
--- a/tests/qemu-iotests/067
+++ b/tests/qemu-iotests/067
@@ -25,7 +25,6 @@ seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
-tmp=/tmp/$$
status=1 # failure is the default!
# get standard environment, filters and checks
diff --git a/tests/qemu-iotests/068 b/tests/qemu-iotests/068
index 7562dd7..68f6e82 100755
--- a/tests/qemu-iotests/068
+++ b/tests/qemu-iotests/068
@@ -25,7 +25,6 @@ seq="$(basename $0)"
echo "QA output created by $seq"
here="$PWD"
-tmp=/tmp/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/069 b/tests/qemu-iotests/069
index ce9e054..96e55ef 100755
--- a/tests/qemu-iotests/069
+++ b/tests/qemu-iotests/069
@@ -25,7 +25,6 @@ seq="$(basename $0)"
echo "QA output created by $seq"
here="$PWD"
-tmp=/tmp/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/070 b/tests/qemu-iotests/070
index d649ddf..8d08d74 100755
--- a/tests/qemu-iotests/070
+++ b/tests/qemu-iotests/070
@@ -26,7 +26,6 @@ seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
-tmp=/tmp/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/071 b/tests/qemu-iotests/071
index 92ab991..bdfd91f 100755
--- a/tests/qemu-iotests/071
+++ b/tests/qemu-iotests/071
@@ -25,7 +25,6 @@ seq="$(basename $0)"
echo "QA output created by $seq"
here="$PWD"
-tmp=/tmp/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/072 b/tests/qemu-iotests/072
index e4a723d..aa027c7 100755
--- a/tests/qemu-iotests/072
+++ b/tests/qemu-iotests/072
@@ -25,7 +25,6 @@ seq="$(basename $0)"
echo "QA output created by $seq"
here="$PWD"
-tmp=/tmp/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/073 b/tests/qemu-iotests/073
index 392db54..ad37a61 100755
--- a/tests/qemu-iotests/073
+++ b/tests/qemu-iotests/073
@@ -25,7 +25,6 @@ seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
-tmp=/tmp/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/075 b/tests/qemu-iotests/075
index 6117660..770d51c 100755
--- a/tests/qemu-iotests/075
+++ b/tests/qemu-iotests/075
@@ -25,7 +25,6 @@ seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
-tmp=/tmp/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/076 b/tests/qemu-iotests/076
index c9b55a9..ef9e6a4 100755
--- a/tests/qemu-iotests/076
+++ b/tests/qemu-iotests/076
@@ -25,7 +25,6 @@ seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
-tmp=/tmp/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/077 b/tests/qemu-iotests/077
index 8a7223f..4dc680b 100755
--- a/tests/qemu-iotests/077
+++ b/tests/qemu-iotests/077
@@ -25,7 +25,6 @@ seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
-tmp=/tmp/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/078 b/tests/qemu-iotests/078
index 7be2c3f..f333e9a 100755
--- a/tests/qemu-iotests/078
+++ b/tests/qemu-iotests/078
@@ -25,7 +25,6 @@ seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
-tmp=/tmp/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/079 b/tests/qemu-iotests/079
index ade6efa..b2e3f74 100755
--- a/tests/qemu-iotests/079
+++ b/tests/qemu-iotests/079
@@ -25,7 +25,6 @@ seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
-tmp=/tmp/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/080 b/tests/qemu-iotests/080
index a2c58ae..55044c7 100755
--- a/tests/qemu-iotests/080
+++ b/tests/qemu-iotests/080
@@ -25,7 +25,6 @@ seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
-tmp=/tmp/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/081 b/tests/qemu-iotests/081
index e4b4c6c..d89fabc 100755
--- a/tests/qemu-iotests/081
+++ b/tests/qemu-iotests/081
@@ -25,7 +25,6 @@ seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
-tmp=/tmp/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/082 b/tests/qemu-iotests/082
index c83e01e..ad1d9fa 100755
--- a/tests/qemu-iotests/082
+++ b/tests/qemu-iotests/082
@@ -25,7 +25,6 @@ seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
-tmp=/tmp/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/083 b/tests/qemu-iotests/083
index aa99278..bc724ae 100755
--- a/tests/qemu-iotests/083
+++ b/tests/qemu-iotests/083
@@ -25,7 +25,6 @@ seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
-tmp=/tmp/$$
status=1 # failure is the default!
# get standard environment, filters and checks
diff --git a/tests/qemu-iotests/084 b/tests/qemu-iotests/084
index 733018d..04f2aa9 100755
--- a/tests/qemu-iotests/084
+++ b/tests/qemu-iotests/084
@@ -26,7 +26,6 @@ seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
-tmp=/tmp/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/086 b/tests/qemu-iotests/086
index 5527e86..cd4494a 100755
--- a/tests/qemu-iotests/086
+++ b/tests/qemu-iotests/086
@@ -25,7 +25,6 @@ seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
-tmp=/tmp/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/087 b/tests/qemu-iotests/087
index 27cbebc..e7bca37 100755
--- a/tests/qemu-iotests/087
+++ b/tests/qemu-iotests/087
@@ -25,7 +25,6 @@ seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
-tmp=/tmp/$$
status=1 # failure is the default!
# get standard environment, filters and checks
diff --git a/tests/qemu-iotests/088 b/tests/qemu-iotests/088
index f9c3129..b8076f2 100755
--- a/tests/qemu-iotests/088
+++ b/tests/qemu-iotests/088
@@ -25,7 +25,6 @@ seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
-tmp=/tmp/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/089 b/tests/qemu-iotests/089
index 3e0038d..9bfe230 100755
--- a/tests/qemu-iotests/089
+++ b/tests/qemu-iotests/089
@@ -25,7 +25,6 @@ seq="$(basename $0)"
echo "QA output created by $seq"
here="$PWD"
-tmp=/tmp/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/090 b/tests/qemu-iotests/090
index 70b5a6f..7380503 100755
--- a/tests/qemu-iotests/090
+++ b/tests/qemu-iotests/090
@@ -25,7 +25,6 @@ seq="$(basename $0)"
echo "QA output created by $seq"
here="$PWD"
-tmp=/tmp/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/092 b/tests/qemu-iotests/092
index 52c529b..5bbdd07 100755
--- a/tests/qemu-iotests/092
+++ b/tests/qemu-iotests/092
@@ -25,7 +25,6 @@ seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
-tmp=/tmp/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/094 b/tests/qemu-iotests/094
index 57a68f8..0ba0b0c 100755
--- a/tests/qemu-iotests/094
+++ b/tests/qemu-iotests/094
@@ -25,7 +25,6 @@ seq="$(basename $0)"
echo "QA output created by $seq"
here="$PWD"
-tmp=/tmp/$$
status=1 # failure is the default!
trap "exit \$status" 0 1 2 3 15
diff --git a/tests/qemu-iotests/097 b/tests/qemu-iotests/097
index c7a613b..01d8dd0 100755
--- a/tests/qemu-iotests/097
+++ b/tests/qemu-iotests/097
@@ -26,7 +26,6 @@ seq="$(basename $0)"
echo "QA output created by $seq"
here="$PWD"
-tmp=/tmp/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/098 b/tests/qemu-iotests/098
index e2230ad..b002e96 100755
--- a/tests/qemu-iotests/098
+++ b/tests/qemu-iotests/098
@@ -25,7 +25,6 @@ seq="$(basename $0)"
echo "QA output created by $seq"
here="$PWD"
-tmp=/tmp/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/099 b/tests/qemu-iotests/099
index 80f3d9a..caaf58e 100755
--- a/tests/qemu-iotests/099
+++ b/tests/qemu-iotests/099
@@ -26,7 +26,6 @@ seq="$(basename $0)"
echo "QA output created by $seq"
here="$PWD"
-tmp=/tmp/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/100 b/tests/qemu-iotests/100
index 7c1b235..5b2fb33 100755
--- a/tests/qemu-iotests/100
+++ b/tests/qemu-iotests/100
@@ -25,7 +25,6 @@ seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
-tmp=/tmp/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/101 b/tests/qemu-iotests/101
index 70fbf25..ea53f8b 100755
--- a/tests/qemu-iotests/101
+++ b/tests/qemu-iotests/101
@@ -25,7 +25,6 @@ seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
-tmp=/tmp/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/102 b/tests/qemu-iotests/102
index 161b197..64b4af9 100755
--- a/tests/qemu-iotests/102
+++ b/tests/qemu-iotests/102
@@ -25,7 +25,6 @@ seq=$(basename $0)
echo "QA output created by $seq"
here=$PWD
-tmp=/tmp/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/103 b/tests/qemu-iotests/103
index fa9a3c1..ecbd8eb 100755
--- a/tests/qemu-iotests/103
+++ b/tests/qemu-iotests/103
@@ -25,7 +25,6 @@ seq=$(basename $0)
echo "QA output created by $seq"
here=$PWD
-tmp=/tmp/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/104 b/tests/qemu-iotests/104
index 2e35ea8..726d467 100755
--- a/tests/qemu-iotests/104
+++ b/tests/qemu-iotests/104
@@ -25,7 +25,6 @@ seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
-tmp=/tmp/$$
status=1 # failure is the default!
trap "exit \$status" 0 1 2 3 15
diff --git a/tests/qemu-iotests/105 b/tests/qemu-iotests/105
index 9bae49e..3db4ce3 100755
--- a/tests/qemu-iotests/105
+++ b/tests/qemu-iotests/105
@@ -25,7 +25,6 @@ seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
-tmp=/tmp/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/107 b/tests/qemu-iotests/107
index 9862030..d7222dc 100755
--- a/tests/qemu-iotests/107
+++ b/tests/qemu-iotests/107
@@ -25,7 +25,6 @@ seq="$(basename $0)"
echo "QA output created by $seq"
here="$PWD"
-tmp=/tmp/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/108 b/tests/qemu-iotests/108
index ce44749..2355d98 100755
--- a/tests/qemu-iotests/108
+++ b/tests/qemu-iotests/108
@@ -26,7 +26,6 @@ seq="$(basename $0)"
echo "QA output created by $seq"
here="$PWD"
-tmp=/tmp/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/109 b/tests/qemu-iotests/109
index 0b668da..f980b0c 100755
--- a/tests/qemu-iotests/109
+++ b/tests/qemu-iotests/109
@@ -25,7 +25,6 @@ seq="$(basename $0)"
echo "QA output created by $seq"
here="$PWD"
-tmp=/tmp/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/110 b/tests/qemu-iotests/110
index a687f95..9de7369 100755
--- a/tests/qemu-iotests/110
+++ b/tests/qemu-iotests/110
@@ -25,7 +25,6 @@ seq="$(basename $0)"
echo "QA output created by $seq"
here="$PWD"
-tmp=/tmp/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/111 b/tests/qemu-iotests/111
index 6011c94..a1c152d 100755
--- a/tests/qemu-iotests/111
+++ b/tests/qemu-iotests/111
@@ -26,7 +26,6 @@ seq="$(basename $0)"
echo "QA output created by $seq"
here="$PWD"
-tmp=/tmp/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/112 b/tests/qemu-iotests/112
index 34ba06a..28eb9aa 100755
--- a/tests/qemu-iotests/112
+++ b/tests/qemu-iotests/112
@@ -25,7 +25,6 @@ seq="$(basename $0)"
echo "QA output created by $seq"
here="$PWD"
-tmp=/tmp/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/113 b/tests/qemu-iotests/113
index a2cd96b..19b68b2 100755
--- a/tests/qemu-iotests/113
+++ b/tests/qemu-iotests/113
@@ -26,7 +26,6 @@ seq="$(basename $0)"
echo "QA output created by $seq"
here="$PWD"
-tmp=/tmp/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/114 b/tests/qemu-iotests/114
index d02e7ff..f110d4f 100755
--- a/tests/qemu-iotests/114
+++ b/tests/qemu-iotests/114
@@ -25,7 +25,6 @@ seq="$(basename $0)"
echo "QA output created by $seq"
here="$PWD"
-tmp=/tmp/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/115 b/tests/qemu-iotests/115
index a6be187..665c2ea 100755
--- a/tests/qemu-iotests/115
+++ b/tests/qemu-iotests/115
@@ -25,7 +25,6 @@ seq="$(basename $0)"
echo "QA output created by $seq"
here="$PWD"
-tmp=/tmp/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/116 b/tests/qemu-iotests/116
index 713ed48..df0172f 100755
--- a/tests/qemu-iotests/116
+++ b/tests/qemu-iotests/116
@@ -28,7 +28,6 @@ seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
-tmp=/tmp/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/117 b/tests/qemu-iotests/117
index 969750d..9385b3f 100755
--- a/tests/qemu-iotests/117
+++ b/tests/qemu-iotests/117
@@ -25,7 +25,6 @@ seq="$(basename $0)"
echo "QA output created by $seq"
here="$PWD"
-tmp=/tmp/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/119 b/tests/qemu-iotests/119
index cc6ec07..4f34fb4 100755
--- a/tests/qemu-iotests/119
+++ b/tests/qemu-iotests/119
@@ -26,7 +26,6 @@ seq="$(basename $0)"
echo "QA output created by $seq"
here="$PWD"
-tmp=/tmp/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/120 b/tests/qemu-iotests/120
index d899a3f..4f88a67 100755
--- a/tests/qemu-iotests/120
+++ b/tests/qemu-iotests/120
@@ -26,7 +26,6 @@ seq="$(basename $0)"
echo "QA output created by $seq"
here="$PWD"
-tmp=/tmp/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/121 b/tests/qemu-iotests/121
index 0912c3f..1307b4e 100755
--- a/tests/qemu-iotests/121
+++ b/tests/qemu-iotests/121
@@ -25,7 +25,6 @@ seq="$(basename $0)"
echo "QA output created by $seq"
here="$PWD"
-tmp=/tmp/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/122 b/tests/qemu-iotests/122
index 350ca9c..45b359c 100755
--- a/tests/qemu-iotests/122
+++ b/tests/qemu-iotests/122
@@ -25,7 +25,6 @@ seq="$(basename $0)"
echo "QA output created by $seq"
here="$PWD"
-tmp=/tmp/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/123 b/tests/qemu-iotests/123
index ad60803..b18e3fc 100755
--- a/tests/qemu-iotests/123
+++ b/tests/qemu-iotests/123
@@ -25,7 +25,6 @@ seq="$(basename $0)"
echo "QA output created by $seq"
here="$PWD"
-tmp=/tmp/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/128 b/tests/qemu-iotests/128
index 3d8107d..0976a18 100755
--- a/tests/qemu-iotests/128
+++ b/tests/qemu-iotests/128
@@ -25,7 +25,6 @@ seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
-tmp=/tmp/$$
status=1 # failure is the default!
devname="eiodev$$"
diff --git a/tests/qemu-iotests/130 b/tests/qemu-iotests/130
index 9209992..ecc8a5b 100755
--- a/tests/qemu-iotests/130
+++ b/tests/qemu-iotests/130
@@ -27,7 +27,6 @@ seq="$(basename $0)"
echo "QA output created by $seq"
here="$PWD"
-tmp=/tmp/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/131 b/tests/qemu-iotests/131
index 4873f40..94a9ae7 100755
--- a/tests/qemu-iotests/131
+++ b/tests/qemu-iotests/131
@@ -25,7 +25,6 @@ seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
-tmp=/tmp/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/133 b/tests/qemu-iotests/133
index 8587102..9d35a6a 100755
--- a/tests/qemu-iotests/133
+++ b/tests/qemu-iotests/133
@@ -25,7 +25,6 @@ seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
-tmp=/tmp/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/134 b/tests/qemu-iotests/134
index 1c3820b..af618b8 100755
--- a/tests/qemu-iotests/134
+++ b/tests/qemu-iotests/134
@@ -25,7 +25,6 @@ seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
-tmp=/tmp/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/135 b/tests/qemu-iotests/135
index 16bf736..ce60831 100755
--- a/tests/qemu-iotests/135
+++ b/tests/qemu-iotests/135
@@ -25,7 +25,6 @@ seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
-tmp=/tmp/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/137 b/tests/qemu-iotests/137
index 9a6597c..e5e30de 100755
--- a/tests/qemu-iotests/137
+++ b/tests/qemu-iotests/137
@@ -25,7 +25,6 @@ seq="$(basename $0)"
echo "QA output created by $seq"
here="$PWD"
-tmp=/tmp/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/138 b/tests/qemu-iotests/138
index a5c3464..21650d8 100755
--- a/tests/qemu-iotests/138
+++ b/tests/qemu-iotests/138
@@ -25,7 +25,6 @@ seq="$(basename $0)"
echo "QA output created by $seq"
here="$PWD"
-tmp=/tmp/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/140 b/tests/qemu-iotests/140
index 05e4506..49f9df4 100755
--- a/tests/qemu-iotests/140
+++ b/tests/qemu-iotests/140
@@ -29,7 +29,6 @@ seq="$(basename $0)"
echo "QA output created by $seq"
here="$PWD"
-tmp=/tmp/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/141 b/tests/qemu-iotests/141
index f7c28b4..b2617e5 100755
--- a/tests/qemu-iotests/141
+++ b/tests/qemu-iotests/141
@@ -25,7 +25,6 @@ seq="$(basename $0)"
echo "QA output created by $seq"
here="$PWD"
-tmp=/tmp/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/142 b/tests/qemu-iotests/142
index 3828c23..29c0606 100755
--- a/tests/qemu-iotests/142
+++ b/tests/qemu-iotests/142
@@ -25,7 +25,6 @@ seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
-tmp=/tmp/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/143 b/tests/qemu-iotests/143
index 6207368..ec4ef22 100755
--- a/tests/qemu-iotests/143
+++ b/tests/qemu-iotests/143
@@ -25,7 +25,6 @@ seq="$(basename $0)"
echo "QA output created by $seq"
here="$PWD"
-tmp=/tmp/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/145 b/tests/qemu-iotests/145
index 7d8febb..1eca0e8 100755
--- a/tests/qemu-iotests/145
+++ b/tests/qemu-iotests/145
@@ -25,7 +25,6 @@ seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
-tmp=/tmp/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/150 b/tests/qemu-iotests/150
index 665373d..ee8f637 100755
--- a/tests/qemu-iotests/150
+++ b/tests/qemu-iotests/150
@@ -25,7 +25,6 @@ seq="$(basename $0)"
echo "QA output created by $seq"
here="$PWD"
-tmp=/tmp/$$
status=1 # failure is the default!
_cleanup()
diff --git a/tests/qemu-iotests/common.config b/tests/qemu-iotests/common.config
index 60bfabf..f824651 100644
--- a/tests/qemu-iotests/common.config
+++ b/tests/qemu-iotests/common.config
@@ -122,7 +122,7 @@ _qemu_img_wrapper()
_qemu_io_wrapper()
{
- local VALGRIND_LOGFILE=/tmp/$$.valgrind
+ local VALGRIND_LOGFILE="${TEST_DIR}"/$$.valgrind
local RETVAL
(
if [ "${VALGRIND_QEMU}" == "y" ]; then
diff --git a/tests/qemu-iotests/common.filter b/tests/qemu-iotests/common.filter
index 84b7434..8a6e1b5 100644
--- a/tests/qemu-iotests/common.filter
+++ b/tests/qemu-iotests/common.filter
@@ -19,107 +19,6 @@
# standard filters
#
-# Checks that given_value is in range of correct_value +/- tolerance.
-# Tolerance can be an absolute value or a percentage of the correct value
-# (see examples with tolerances below).
-# Outputs suitable message to stdout if it's not in range.
-#
-# A verbose option, -v, may be used as the LAST argument
-#
-# e.g.
-# foo: 0.0298 = 0.03 +/- 5%
-# _within_tolerance "foo" 0.0298 0.03 5%
-#
-# foo: 0.0298 = 0.03 +/- 0.01
-# _within_tolerance "foo" 0.0298 0.03 0.01
-#
-# foo: 0.0298 = 0.03 -0.01 +0.002
-# _within_tolerance "foo" 0.0298 0.03 0.01 0.002
-#
-# foo: verbose output of 0.0298 = 0.03 +/- 5%
-# _within_tolerance "foo" 0.0298 0.03 5% -v
-_within_tolerance()
-{
- _name=$1
- _given_val=$2
- _correct_val=$3
- _mintol=$4
- _maxtol=$_mintol
- _verbose=0
- _debug=false
-
- # maxtol arg is optional
- # verbose arg is optional
- if [ $# -ge 5 ]
- then
- if [ "$5" = "-v" ]
- then
- _verbose=1
- else
- _maxtol=$5
- fi
- fi
- if [ $# -ge 6 ]
- then
- [ "$6" = "-v" ] && _verbose=1
- fi
-
- # find min with or without %
- _mintolerance=`echo $_mintol | sed -e 's/%//'`
- if [ $_mintol = $_mintolerance ]
- then
- _min=`echo "scale=5; $_correct_val-$_mintolerance" | bc`
- else
- _min=`echo "scale=5; $_correct_val-$_mintolerance*0.01*$_correct_val" | bc`
- fi
-
- # find max with or without %
- _maxtolerance=`echo $_maxtol | sed -e 's/%//'`
- if [ $_maxtol = $_maxtolerance ]
- then
- _max=`echo "scale=5; $_correct_val+$_maxtolerance" | bc`
- else
- _max=`echo "scale=5; $_correct_val+$_maxtolerance*0.01*$_correct_val" | bc`
- fi
-
- $_debug && echo "min = $_min"
- $_debug && echo "max = $_max"
-
- cat <<EOF >$tmp.bc.1
-scale=5;
-if ($_min <= $_given_val) 1;
-if ($_min > $_given_val) 0;
-EOF
-
- cat <<EOF >$tmp.bc.2
-scale=5;
-if ($_given_val <= $_max) 1;
-if ($_given_val > $_max) 0;
-EOF
-
- _above_min=`bc <$tmp.bc.1`
- _below_max=`bc <$tmp.bc.2`
-
- rm -f $tmp.bc.[12]
-
- _in_range=`expr $_above_min \& $_below_max`
-
- # fix up min, max precision for output
- # can vary for 5.3, 6.2
- _min=`echo $_min | sed -e 's/0*$//'` # get rid of trailling zeroes
- _max=`echo $_max | sed -e 's/0*$//'` # get rid of trailling zeroes
-
- if [ $_in_range -eq 1 ]
- then
- [ $_verbose -eq 1 ] && echo $_name is in range
- return 0
- else
- [ $_verbose -eq 1 ] && echo $_name has value of $_given_val
- [ $_verbose -eq 1 ] && echo $_name is NOT in range $_min .. $_max
- return 1
- fi
-}
-
# ctime(3) dates
#
_filter_date()
diff --git a/tests/qemu-iotests/common.rc b/tests/qemu-iotests/common.rc
index d9913f8..5249ec5 100644
--- a/tests/qemu-iotests/common.rc
+++ b/tests/qemu-iotests/common.rc
@@ -287,52 +287,6 @@ _need_to_be_root()
fi
}
-
-# Do a command, log it to $seq.full, optionally test return status
-# and die if command fails. If called with one argument _do executes the
-# command, logs it, and returns its exit status. With two arguments _do
-# first prints the message passed in the first argument, and then "done"
-# or "fail" depending on the return status of the command passed in the
-# second argument. If the command fails and the variable _do_die_on_error
-# is set to "always" or the two argument form is used and _do_die_on_error
-# is set to "message_only" _do will print an error message to
-# $seq.out and exit.
-
-_do()
-{
- if [ $# -eq 1 ]; then
- _cmd=$1
- elif [ $# -eq 2 ]; then
- _note=$1
- _cmd=$2
- echo -n "$_note... "
- else
- echo "Usage: _do [note] cmd" 1>&2
- status=1; exit
- fi
-
- (eval "echo '---' \"$_cmd\"") >>"$OUTPUT_DIR/$seq.full"
- (eval "$_cmd") >$tmp._out 2>&1; ret=$?
- cat $tmp._out >>"$OUTPUT_DIR/$seq.full"
- if [ $# -eq 2 ]; then
- if [ $ret -eq 0 ]; then
- echo "done"
- else
- echo "fail"
- fi
- fi
- if [ $ret -ne 0 ] \
- && [ "$_do_die_on_error" = "always" \
- -o \( $# -eq 2 -a "$_do_die_on_error" = "message_only" \) ]
- then
- [ $# -ne 2 ] && echo
- eval "echo \"$_cmd\" failed \(returned $ret\): see $seq.full"
- status=1; exit
- fi
-
- return $ret
-}
-
# bail out, setting up .notrun file
#
_notrun()
diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py
index 0c0b533..d9ef60e 100644
--- a/tests/qemu-iotests/iotests.py
+++ b/tests/qemu-iotests/iotests.py
@@ -348,6 +348,20 @@ class QMPTestCase(unittest.TestCase):
result = self.vm.qmp('query-block-jobs')
self.assert_qmp(result, 'return', [])
+ def assert_has_block_node(self, node_name=None, file_name=None):
+ """Issue a query-named-block-nodes and assert node_name and/or
+ file_name is present in the result"""
+ def check_equal_or_none(a, b):
+ return a == None or b == None or a == b
+ assert node_name or file_name
+ result = self.vm.qmp('query-named-block-nodes')
+ for x in result["return"]:
+ if check_equal_or_none(x.get("node-name"), node_name) and \
+ check_equal_or_none(x.get("file"), file_name):
+ return
+ self.assertTrue(False, "Cannot find %s %s in result:\n%s" % \
+ (node_name, file_name, result))
+
def cancel_and_wait(self, drive='drive0', force=False, resume=False):
'''Cancel a block job and wait for it to finish, returning the event'''
result = self.vm.qmp('block-job-cancel', device=drive, force=force)