aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorBin Meng <bin.meng@windriver.com>2022-08-24 17:39:51 +0800
committerThomas Huth <thuth@redhat.com>2022-08-25 15:24:09 +0200
commit2549f6102e3ac9cab1954b44331c18b16faa3d97 (patch)
treeeabc6986fa821a71a43524898107faf7fe32478e /tests
parent413bebc04603d87d1889c919fbdd4adf30d4ebb5 (diff)
tests/qtest: migration-test: Handle link() for win32
Windows does not provide a link() API like POSIX. Instead it provides a similar API CreateHardLink() that does the same thing, but with different argument order and return value. Signed-off-by: Bin Meng <bin.meng@windriver.com> Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Message-Id: <20220824094029.1634519-14-bmeng.cn@gmail.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/qtest/migration-test.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/qtest/migration-test.c b/tests/qtest/migration-test.c
index 21bd76be19..18d30bfc3c 100644
--- a/tests/qtest/migration-test.c
+++ b/tests/qtest/migration-test.c
@@ -876,9 +876,17 @@ test_migrate_tls_x509_start_common(QTestState *from,
g_mkdir_with_parents(data->workdir, 0700);
test_tls_init(data->keyfile);
+#ifndef _WIN32
g_assert(link(data->keyfile, data->serverkey) == 0);
+#else
+ g_assert(CreateHardLink(data->serverkey, data->keyfile, NULL) != 0);
+#endif
if (args->clientcert) {
+#ifndef _WIN32
g_assert(link(data->keyfile, data->clientkey) == 0);
+#else
+ g_assert(CreateHardLink(data->clientkey, data->keyfile, NULL) != 0);
+#endif
}
TLS_ROOT_REQ_SIMPLE(cacertreq, data->cacert);