From: Ilya Dryomov Date: Tue, 28 Jan 2025 08:33:37 +0000 (+0100) Subject: qa/workunits/rbd: add test_import_nbd_stream_disconnected() X-Git-Tag: v20.0.0~265^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=afc89fdde80fb53b7145b1d0aa342af5a35ec815;p=ceph.git qa/workunits/rbd: add test_import_nbd_stream_disconnected() When the NBD server is killed, nbd_pread() can set errno to at least ENOTCONN, EINVAL and 0 which is supposed to stand for "no additional errno information is available for this error". Add a test to ensure that "rbd migration execute" command always fails and that the image isn't transitioned to MIGRATION_STATE_EXECUTED in this scenario. Signed-off-by: Ilya Dryomov --- diff --git a/qa/suites/rbd/cli/workloads/rbd_cli_migration.yaml b/qa/suites/rbd/cli/workloads/rbd_cli_migration.yaml index b04ac08f7b4e..96845dce4367 100644 --- a/qa/suites/rbd/cli/workloads/rbd_cli_migration.yaml +++ b/qa/suites/rbd/cli/workloads/rbd_cli_migration.yaml @@ -1,3 +1,11 @@ +overrides: + install: + extra_system_packages: + rpm: + - qemu-kvm-block-rbd + deb: + - qemu-block-extra + - qemu-utils tasks: - workunit: clients: diff --git a/qa/workunits/rbd/cli_migration.sh b/qa/workunits/rbd/cli_migration.sh index 3af194209577..d4bcf7f77dff 100755 --- a/qa/workunits/rbd/cli_migration.sh +++ b/qa/workunits/rbd/cli_migration.sh @@ -596,6 +596,68 @@ EOF kill_nbd_server } +test_import_nbd_stream_disconnected() { + local dest_image=$1 + local migration_execute_pid + + dd if=/dev/urandom of=${TEMPDIR}/large.raw bs=1M count=20480 + qemu-nbd -f raw --read-only --shared 10 --persistent --fork \ + ${TEMPDIR}/large.raw + + cat > ${TEMPDIR}/spec.json <&1 | wc -l | grep -v '^0$' && echo "nonempty rbd pool, aborting! run this script on an empty test cluster only." && exit 1 @@ -614,6 +676,8 @@ test_import_nbd_stream_qcow2 ${IMAGE2} ${IMAGE3} test_import_raw_format ${IMAGE1} ${IMAGE2} test_import_nbd_stream_raw ${IMAGE1} ${IMAGE2} +test_import_nbd_stream_disconnected ${IMAGE2} + rbd namespace create rbd/${NAMESPACE1} rbd namespace create rbd/${NAMESPACE2} create_base_image rbd/${NAMESPACE1}/${IMAGE1}