]> Git Repo - qemu.git/commit
tests/drive_del-test: Fix harmless JSON interpolation bug
authorMarkus Armbruster <[email protected]>
Thu, 23 Aug 2018 16:40:21 +0000 (18:40 +0200)
committerMarkus Armbruster <[email protected]>
Fri, 24 Aug 2018 18:26:37 +0000 (20:26 +0200)
commit83273e84d9646bb902e1debfdcb68c8afd38614f
treeddb60b1c1f7edcbae40de60d0a6ef834c9a7b630
parent86cdf9ec8dec2763702cc52fa412d108a5dc9608
tests/drive_del-test: Fix harmless JSON interpolation bug

test_after_failed_device_add() does this:

    response = qmp("{'execute': 'device_add',"
                   " 'arguments': {"
                   "   'driver': 'virtio-blk-%s',"
                   "   'drive': 'drive0'"
                   "}}", qvirtio_get_dev_type());

Wrong.  An interpolation specification must be a JSON token, it
doesn't work within JSON string tokens.  The code above doesn't use
the value of qvirtio_get_dev_type(), and sends arguments

    {"driver": "virtio-blk-%s", "drive": "drive0"}}

The command fails because there is no driver named "virtio-blk-%".
Harmless, since the test wants the command to fail.  Screwed up in
commit 2f84a92ec63.

Fix the obvious way.  The command now fails because the drive is
empty, like it did before commit 2f84a92ec63.

Signed-off-by: Markus Armbruster <[email protected]>
Reviewed-by: Eric Blake <[email protected]>
Message-Id: <20180823164025[email protected]>
tests/drive_del-test.c
This page took 0.026555 seconds and 4 git commands to generate.