nbd patches for 2019-02-25
- iotest failure fixes for tests related to NBD -----BEGIN PGP SIGNATURE----- iQEcBAABCAAGBQJcdW1XAAoJEKeha0olJ0NqNH8H/2DF/IVFGIx0mNlBjeu7pk8E /qDa4V19g6/Hyl/DTdqHi8afipewav+hNbhBrT9SCFtF+tON13HZqMoFJYcoQ+iU eBRwgpSPXhAMmVsoEYlYBATjq/+B8IpNEhj8uGd9VqhsnSYElgHnyIlSw+znw/KR t9/LTXKCRkabUgjNqzQcuV+8w8IeusjDocFIVaFZiTnUAgTXx/vIR9AGUtgwkJE0 WFOUFTLYwy20h9J6FOzyhBG9hqM6KH9JYaKY7laJSzEanY5A6c8XrAfdI39o3oQb I0/GmDKos0yKAvdlXsULu/nStu8NYl+ET36Qi80Bc4Uo9XJeUx/IbioSFNnGjfY= =AIRl -----END PGP SIGNATURE----- Merge remote-tracking branch 'remotes/ericb/tags/pull-nbd-2019-02-25-v2' into staging nbd patches for 2019-02-25 - iotest failure fixes for tests related to NBD # gpg: Signature made Tue 26 Feb 2019 16:46:15 GMT # gpg: using RSA key A7A16B4A2527436A # gpg: Good signature from "Eric Blake <eblake@redhat.com>" [full] # gpg: aka "Eric Blake (Free Software Programmer) <ebb9@byu.net>" [full] # gpg: aka "[jpeg image of size 6874]" [full] # Primary key fingerprint: 71C2 CC22 B1C4 6029 27D2 F3AA A7A1 6B4A 2527 436A * remotes/ericb/tags/pull-nbd-2019-02-25-v2: iotests: avoid broken pipe with certtool iotests: ensure we print nbd server log on error iotests: handle TypeError for Python 3 in test 242 Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
commit
093a2af7b6
@ -30,6 +30,8 @@ _cleanup()
|
||||
{
|
||||
nbd_server_stop
|
||||
_cleanup_test_img
|
||||
# If we aborted early we want to see this log for diagnosis
|
||||
test -f "$TEST_DIR/server.log" && cat "$TEST_DIR/server.log"
|
||||
rm -f "$TEST_DIR/server.log"
|
||||
tls_x509_cleanup
|
||||
}
|
||||
@ -120,6 +122,7 @@ $QEMU_IO -f $IMGFMT -r -U -c 'r -P 0x22 1m 1m' "$TEST_IMG" | _filter_qemu_io
|
||||
echo
|
||||
echo "== final server log =="
|
||||
cat "$TEST_DIR/server.log"
|
||||
rm -f "$TEST_DIR/server.log"
|
||||
|
||||
# success, all done
|
||||
echo "*** done"
|
||||
|
@ -20,6 +20,7 @@
|
||||
|
||||
import iotests
|
||||
import json
|
||||
import struct
|
||||
from iotests import qemu_img_create, qemu_io, qemu_img_pipe, \
|
||||
file_path, img_info_log, log, filter_qemu_io
|
||||
|
||||
@ -64,10 +65,11 @@ def write_to_disk(offset, size):
|
||||
def toggle_flag(offset):
|
||||
with open(disk, "r+b") as f:
|
||||
f.seek(offset, 0)
|
||||
c = f.read(1)
|
||||
toggled = chr(ord(c) ^ bitmap_flag_unknown)
|
||||
# Read one byte in a way compatible with Python 2
|
||||
flags = struct.unpack("B", f.read(1))
|
||||
toggled = flags[0] ^ bitmap_flag_unknown
|
||||
f.seek(-1, 1)
|
||||
f.write(toggled)
|
||||
f.write(struct.pack("B", toggled))
|
||||
|
||||
|
||||
qemu_img_create('-f', iotests.imgfmt, disk, '1M')
|
||||
|
@ -29,6 +29,17 @@ tls_x509_cleanup()
|
||||
}
|
||||
|
||||
|
||||
tls_certtool()
|
||||
{
|
||||
certtool "$@" 1>"${tls_dir}"/certtool.log 2>&1
|
||||
if test "$?" = 0; then
|
||||
head -1 "${tls_dir}"/certtool.log
|
||||
else
|
||||
cat "${tls_dir}"/certtool.log
|
||||
fi
|
||||
rm -f "${tls_dir}"/certtool.log
|
||||
}
|
||||
|
||||
tls_x509_init()
|
||||
{
|
||||
(certtool --help) >/dev/null 2>&1 || \
|
||||
@ -71,10 +82,11 @@ ca
|
||||
cert_signing_key
|
||||
EOF
|
||||
|
||||
certtool --generate-self-signed \
|
||||
--load-privkey "${tls_dir}/key.pem" \
|
||||
--template "${tls_dir}/ca.info" \
|
||||
--outfile "${tls_dir}/$name-cert.pem" 2>&1 | head -1
|
||||
tls_certtool \
|
||||
--generate-self-signed \
|
||||
--load-privkey "${tls_dir}/key.pem" \
|
||||
--template "${tls_dir}/ca.info" \
|
||||
--outfile "${tls_dir}/$name-cert.pem"
|
||||
|
||||
rm -f "${tls_dir}/ca.info"
|
||||
}
|
||||
@ -98,12 +110,14 @@ encryption_key
|
||||
signing_key
|
||||
EOF
|
||||
|
||||
certtool --generate-certificate \
|
||||
--load-ca-privkey "${tls_dir}/key.pem" \
|
||||
--load-ca-certificate "${tls_dir}/$caname-cert.pem" \
|
||||
--load-privkey "${tls_dir}/key.pem" \
|
||||
--template "${tls_dir}/cert.info" \
|
||||
--outfile "${tls_dir}/$name/server-cert.pem" 2>&1 | head -1
|
||||
tls_certtool \
|
||||
--generate-certificate \
|
||||
--load-ca-privkey "${tls_dir}/key.pem" \
|
||||
--load-ca-certificate "${tls_dir}/$caname-cert.pem" \
|
||||
--load-privkey "${tls_dir}/key.pem" \
|
||||
--template "${tls_dir}/cert.info" \
|
||||
--outfile "${tls_dir}/$name/server-cert.pem"
|
||||
|
||||
ln -s "${tls_dir}/$caname-cert.pem" "${tls_dir}/$name/ca-cert.pem"
|
||||
ln -s "${tls_dir}/key.pem" "${tls_dir}/$name/server-key.pem"
|
||||
|
||||
@ -127,12 +141,14 @@ encryption_key
|
||||
signing_key
|
||||
EOF
|
||||
|
||||
certtool --generate-certificate \
|
||||
--load-ca-privkey "${tls_dir}/key.pem" \
|
||||
--load-ca-certificate "${tls_dir}/$caname-cert.pem" \
|
||||
--load-privkey "${tls_dir}/key.pem" \
|
||||
--template "${tls_dir}/cert.info" \
|
||||
--outfile "${tls_dir}/$name/client-cert.pem" 2>&1 | head -1
|
||||
tls_certtool \
|
||||
--generate-certificate \
|
||||
--load-ca-privkey "${tls_dir}/key.pem" \
|
||||
--load-ca-certificate "${tls_dir}/$caname-cert.pem" \
|
||||
--load-privkey "${tls_dir}/key.pem" \
|
||||
--template "${tls_dir}/cert.info" \
|
||||
--outfile "${tls_dir}/$name/client-cert.pem"
|
||||
|
||||
ln -s "${tls_dir}/$caname-cert.pem" "${tls_dir}/$name/ca-cert.pem"
|
||||
ln -s "${tls_dir}/key.pem" "${tls_dir}/$name/client-key.pem"
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user