tests: testQemuCapsIterate: Validate suffix

We're going to depend on the fact that the suffix starts with a
dot later on, so we better ensure that it does.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
This commit is contained in:
Andrea Bolognani 2019-10-22 18:34:03 +02:00
parent 85394f676d
commit 29795544fd

View File

@ -906,6 +906,12 @@ testQemuCapsIterate(const char *suffix,
if (!callback)
return 0;
/* Validate suffix */
if (!STRPREFIX(suffix, ".")) {
VIR_TEST_VERBOSE("malformed suffix '%s'", suffix);
goto cleanup;
}
if (virDirOpen(&dir, TEST_QEMU_CAPS_PATH) < 0)
goto cleanup;