]> git.proxmox.com Git - mirror_qemu.git/blob - tests/migration-test.c
migration-test: Clean up string interpolation into QMP, part 2
[mirror_qemu.git] / tests / migration-test.c
1 /*
2 * QTest testcase for migration
3 *
4 * Copyright (c) 2016-2018 Red Hat, Inc. and/or its affiliates
5 * based on the vhost-user-test.c that is:
6 * Copyright (c) 2014 Virtual Open Systems Sarl.
7 *
8 * This work is licensed under the terms of the GNU GPL, version 2 or later.
9 * See the COPYING file in the top-level directory.
10 *
11 */
12
13 #include "qemu/osdep.h"
14
15 #include "libqtest.h"
16 #include "qapi/qmp/qdict.h"
17 #include "qapi/qmp/qjson.h"
18 #include "qemu/option.h"
19 #include "qemu/range.h"
20 #include "qemu/sockets.h"
21 #include "chardev/char.h"
22 #include "sysemu/sysemu.h"
23
24 /* TODO actually test the results and get rid of this */
25 #define qtest_qmp_discard_response(...) qobject_unref(qtest_qmp(__VA_ARGS__))
26
27 const unsigned start_address = 1024 * 1024;
28 const unsigned end_address = 100 * 1024 * 1024;
29 bool got_stop;
30 static bool uffd_feature_thread_id;
31
32 #if defined(__linux__)
33 #include <sys/syscall.h>
34 #include <sys/vfs.h>
35 #endif
36
37 #if defined(__linux__) && defined(__NR_userfaultfd) && defined(CONFIG_EVENTFD)
38 #include <sys/eventfd.h>
39 #include <sys/ioctl.h>
40 #include <linux/userfaultfd.h>
41
42 static bool ufd_version_check(void)
43 {
44 struct uffdio_api api_struct;
45 uint64_t ioctl_mask;
46
47 int ufd = syscall(__NR_userfaultfd, O_CLOEXEC);
48
49 if (ufd == -1) {
50 g_test_message("Skipping test: userfaultfd not available");
51 return false;
52 }
53
54 api_struct.api = UFFD_API;
55 api_struct.features = 0;
56 if (ioctl(ufd, UFFDIO_API, &api_struct)) {
57 g_test_message("Skipping test: UFFDIO_API failed");
58 return false;
59 }
60 uffd_feature_thread_id = api_struct.features & UFFD_FEATURE_THREAD_ID;
61
62 ioctl_mask = (__u64)1 << _UFFDIO_REGISTER |
63 (__u64)1 << _UFFDIO_UNREGISTER;
64 if ((api_struct.ioctls & ioctl_mask) != ioctl_mask) {
65 g_test_message("Skipping test: Missing userfault feature");
66 return false;
67 }
68
69 return true;
70 }
71
72 #else
73 static bool ufd_version_check(void)
74 {
75 g_test_message("Skipping test: Userfault not available (builtdtime)");
76 return false;
77 }
78
79 #endif
80
81 static const char *tmpfs;
82
83 /* A simple PC boot sector that modifies memory (1-100MB) quickly
84 * outputting a 'B' every so often if it's still running.
85 */
86 #include "tests/migration/x86-a-b-bootblock.h"
87
88 static void init_bootfile_x86(const char *bootpath)
89 {
90 FILE *bootfile = fopen(bootpath, "wb");
91
92 g_assert_cmpint(fwrite(x86_bootsect, 512, 1, bootfile), ==, 1);
93 fclose(bootfile);
94 }
95
96 /*
97 * Wait for some output in the serial output file,
98 * we get an 'A' followed by an endless string of 'B's
99 * but on the destination we won't have the A.
100 */
101 static void wait_for_serial(const char *side)
102 {
103 char *serialpath = g_strdup_printf("%s/%s", tmpfs, side);
104 FILE *serialfile = fopen(serialpath, "r");
105 const char *arch = qtest_get_arch();
106 int started = (strcmp(side, "src_serial") == 0 &&
107 strcmp(arch, "ppc64") == 0) ? 0 : 1;
108
109 g_free(serialpath);
110 do {
111 int readvalue = fgetc(serialfile);
112
113 if (!started) {
114 /* SLOF prints its banner before starting test,
115 * to ignore it, mark the start of the test with '_',
116 * ignore all characters until this marker
117 */
118 switch (readvalue) {
119 case '_':
120 started = 1;
121 break;
122 case EOF:
123 fseek(serialfile, 0, SEEK_SET);
124 usleep(1000);
125 break;
126 }
127 continue;
128 }
129 switch (readvalue) {
130 case 'A':
131 /* Fine */
132 break;
133
134 case 'B':
135 /* It's alive! */
136 fclose(serialfile);
137 return;
138
139 case EOF:
140 started = (strcmp(side, "src_serial") == 0 &&
141 strcmp(arch, "ppc64") == 0) ? 0 : 1;
142 fseek(serialfile, 0, SEEK_SET);
143 usleep(1000);
144 break;
145
146 default:
147 fprintf(stderr, "Unexpected %d on %s serial\n", readvalue, side);
148 g_assert_not_reached();
149 }
150 } while (true);
151 }
152
153 static void stop_cb(void *opaque, const char *name, QDict *data)
154 {
155 if (!strcmp(name, "STOP")) {
156 got_stop = true;
157 }
158 }
159
160 /*
161 * Events can get in the way of responses we are actually waiting for.
162 */
163 GCC_FMT_ATTR(2, 3)
164 static QDict *wait_command(QTestState *who, const char *command, ...)
165 {
166 va_list ap;
167
168 va_start(ap, command);
169 qtest_qmp_vsend(who, command, ap);
170 va_end(ap);
171
172 return qtest_qmp_receive_success(who, stop_cb, NULL);
173 }
174
175 /*
176 * Note: caller is responsible to free the returned object via
177 * qobject_unref() after use
178 */
179 static QDict *migrate_query(QTestState *who)
180 {
181 return wait_command(who, "{ 'execute': 'query-migrate' }");
182 }
183
184 /*
185 * Note: caller is responsible to free the returned object via
186 * g_free() after use
187 */
188 static gchar *migrate_query_status(QTestState *who)
189 {
190 QDict *rsp_return = migrate_query(who);
191 gchar *status = g_strdup(qdict_get_str(rsp_return, "status"));
192
193 g_assert(status);
194 qobject_unref(rsp_return);
195
196 return status;
197 }
198
199 /*
200 * It's tricky to use qemu's migration event capability with qtest,
201 * events suddenly appearing confuse the qmp()/hmp() responses.
202 */
203
204 static uint64_t get_migration_pass(QTestState *who)
205 {
206 QDict *rsp_return, *rsp_ram;
207 uint64_t result;
208
209 rsp_return = migrate_query(who);
210 if (!qdict_haskey(rsp_return, "ram")) {
211 /* Still in setup */
212 result = 0;
213 } else {
214 rsp_ram = qdict_get_qdict(rsp_return, "ram");
215 result = qdict_get_try_int(rsp_ram, "dirty-sync-count", 0);
216 }
217 qobject_unref(rsp_return);
218 return result;
219 }
220
221 static void read_blocktime(QTestState *who)
222 {
223 QDict *rsp_return;
224
225 rsp_return = migrate_query(who);
226 g_assert(qdict_haskey(rsp_return, "postcopy-blocktime"));
227 qobject_unref(rsp_return);
228 }
229
230 static void wait_for_migration_status(QTestState *who,
231 const char *goal)
232 {
233 while (true) {
234 bool completed;
235 char *status;
236
237 status = migrate_query_status(who);
238 completed = strcmp(status, goal) == 0;
239 g_assert_cmpstr(status, !=, "failed");
240 g_free(status);
241 if (completed) {
242 return;
243 }
244 usleep(1000);
245 }
246 }
247
248 static void wait_for_migration_complete(QTestState *who)
249 {
250 wait_for_migration_status(who, "completed");
251 }
252
253 static void wait_for_migration_pass(QTestState *who)
254 {
255 uint64_t initial_pass = get_migration_pass(who);
256 uint64_t pass;
257
258 /* Wait for the 1st sync */
259 while (!got_stop && !initial_pass) {
260 usleep(1000);
261 initial_pass = get_migration_pass(who);
262 }
263
264 do {
265 usleep(1000);
266 pass = get_migration_pass(who);
267 } while (pass == initial_pass && !got_stop);
268 }
269
270 static void check_guests_ram(QTestState *who)
271 {
272 /* Our ASM test will have been incrementing one byte from each page from
273 * 1MB to <100MB in order.
274 * This gives us a constraint that any page's byte should be equal or less
275 * than the previous pages byte (mod 256); and they should all be equal
276 * except for one transition at the point where we meet the incrementer.
277 * (We're running this with the guest stopped).
278 */
279 unsigned address;
280 uint8_t first_byte;
281 uint8_t last_byte;
282 bool hit_edge = false;
283 bool bad = false;
284
285 qtest_memread(who, start_address, &first_byte, 1);
286 last_byte = first_byte;
287
288 for (address = start_address + 4096; address < end_address; address += 4096)
289 {
290 uint8_t b;
291 qtest_memread(who, address, &b, 1);
292 if (b != last_byte) {
293 if (((b + 1) % 256) == last_byte && !hit_edge) {
294 /* This is OK, the guest stopped at the point of
295 * incrementing the previous page but didn't get
296 * to us yet.
297 */
298 hit_edge = true;
299 last_byte = b;
300 } else {
301 fprintf(stderr, "Memory content inconsistency at %x"
302 " first_byte = %x last_byte = %x current = %x"
303 " hit_edge = %x\n",
304 address, first_byte, last_byte, b, hit_edge);
305 bad = true;
306 }
307 }
308 }
309 g_assert_false(bad);
310 }
311
312 static void cleanup(const char *filename)
313 {
314 char *path = g_strdup_printf("%s/%s", tmpfs, filename);
315
316 unlink(path);
317 g_free(path);
318 }
319
320 static void migrate_check_parameter(QTestState *who, const char *parameter,
321 const char *value)
322 {
323 QDict *rsp_return;
324 char *result;
325
326 rsp_return = wait_command(who,
327 "{ 'execute': 'query-migrate-parameters' }");
328 result = g_strdup_printf("%" PRId64,
329 qdict_get_try_int(rsp_return, parameter, -1));
330 g_assert_cmpstr(result, ==, value);
331 g_free(result);
332 qobject_unref(rsp_return);
333 }
334
335 static void migrate_set_parameter(QTestState *who, const char *parameter,
336 const char *value)
337 {
338 QDict *rsp;
339 gchar *cmd;
340
341 cmd = g_strdup_printf("{ 'execute': 'migrate-set-parameters',"
342 "'arguments': { '%s': %s } }",
343 parameter, value);
344 rsp = qtest_qmp(who, cmd);
345 g_free(cmd);
346 g_assert(qdict_haskey(rsp, "return"));
347 qobject_unref(rsp);
348 migrate_check_parameter(who, parameter, value);
349 }
350
351 static void migrate_pause(QTestState *who)
352 {
353 QDict *rsp;
354
355 rsp = wait_command(who, "{ 'execute': 'migrate-pause' }");
356 qobject_unref(rsp);
357 }
358
359 static void migrate_recover(QTestState *who, const char *uri)
360 {
361 QDict *rsp;
362
363 rsp = wait_command(who,
364 "{ 'execute': 'migrate-recover', "
365 " 'id': 'recover-cmd', "
366 " 'arguments': { 'uri': %s } }",
367 uri);
368 qobject_unref(rsp);
369 }
370
371 static void migrate_set_capability(QTestState *who, const char *capability,
372 const char *value)
373 {
374 QDict *rsp;
375 gchar *cmd;
376
377 cmd = g_strdup_printf("{ 'execute': 'migrate-set-capabilities',"
378 "'arguments': { "
379 "'capabilities': [ { "
380 "'capability': '%s', 'state': %s } ] } }",
381 capability, value);
382 rsp = qtest_qmp(who, cmd);
383 g_free(cmd);
384 g_assert(qdict_haskey(rsp, "return"));
385 qobject_unref(rsp);
386 }
387
388 /*
389 * Send QMP command "migrate".
390 * Arguments are built from @fmt... (formatted like
391 * qobject_from_jsonf_nofail()) with "uri": @uri spliced in.
392 */
393 GCC_FMT_ATTR(3, 4)
394 static void migrate(QTestState *who, const char *uri, const char *fmt, ...)
395 {
396 va_list ap;
397 QDict *args, *rsp;
398
399 va_start(ap, fmt);
400 args = qdict_from_vjsonf_nofail(fmt, ap);
401 va_end(ap);
402
403 g_assert(!qdict_haskey(args, "uri"));
404 qdict_put_str(args, "uri", uri);
405
406 rsp = qmp("{ 'execute': 'migrate', 'arguments': %p}", args);
407 g_assert(qdict_haskey(rsp, "return"));
408 qobject_unref(rsp);
409 }
410
411 static void migrate_postcopy_start(QTestState *from, QTestState *to)
412 {
413 QDict *rsp;
414
415 rsp = wait_command(from, "{ 'execute': 'migrate-start-postcopy' }");
416 qobject_unref(rsp);
417
418 if (!got_stop) {
419 qtest_qmp_eventwait(from, "STOP");
420 }
421
422 qtest_qmp_eventwait(to, "RESUME");
423 }
424
425 static int test_migrate_start(QTestState **from, QTestState **to,
426 const char *uri, bool hide_stderr)
427 {
428 gchar *cmd_src, *cmd_dst;
429 char *bootpath = g_strdup_printf("%s/bootsect", tmpfs);
430 const char *arch = qtest_get_arch();
431 const char *accel = "kvm:tcg";
432
433 got_stop = false;
434
435 if (strcmp(arch, "i386") == 0 || strcmp(arch, "x86_64") == 0) {
436 init_bootfile_x86(bootpath);
437 cmd_src = g_strdup_printf("-machine accel=%s -m 150M"
438 " -name source,debug-threads=on"
439 " -serial file:%s/src_serial"
440 " -drive file=%s,format=raw",
441 accel, tmpfs, bootpath);
442 cmd_dst = g_strdup_printf("-machine accel=%s -m 150M"
443 " -name target,debug-threads=on"
444 " -serial file:%s/dest_serial"
445 " -drive file=%s,format=raw"
446 " -incoming %s",
447 accel, tmpfs, bootpath, uri);
448 } else if (strcmp(arch, "ppc64") == 0) {
449
450 /* On ppc64, the test only works with kvm-hv, but not with kvm-pr
451 * and TCG is touchy due to race conditions on dirty bits
452 * (especially on PPC for some reason)
453 */
454 if (access("/sys/module/kvm_hv", F_OK)) {
455 g_print("Skipping test: kvm_hv not available ");
456 return -1;
457 }
458 cmd_src = g_strdup_printf("-machine accel=%s -m 256M"
459 " -name source,debug-threads=on"
460 " -serial file:%s/src_serial"
461 " -prom-env '"
462 "boot-command=hex .\" _\" begin %x %x "
463 "do i c@ 1 + i c! 1000 +loop .\" B\" 0 "
464 "until'", accel, tmpfs, end_address,
465 start_address);
466 cmd_dst = g_strdup_printf("-machine accel=%s -m 256M"
467 " -name target,debug-threads=on"
468 " -serial file:%s/dest_serial"
469 " -incoming %s",
470 accel, tmpfs, uri);
471 } else {
472 g_assert_not_reached();
473 }
474
475 g_free(bootpath);
476
477 if (hide_stderr) {
478 gchar *tmp;
479 tmp = g_strdup_printf("%s 2>/dev/null", cmd_src);
480 g_free(cmd_src);
481 cmd_src = tmp;
482
483 tmp = g_strdup_printf("%s 2>/dev/null", cmd_dst);
484 g_free(cmd_dst);
485 cmd_dst = tmp;
486 }
487
488 *from = qtest_start(cmd_src);
489 g_free(cmd_src);
490
491 *to = qtest_init(cmd_dst);
492 g_free(cmd_dst);
493 return 0;
494 }
495
496 static void test_migrate_end(QTestState *from, QTestState *to, bool test_dest)
497 {
498 unsigned char dest_byte_a, dest_byte_b, dest_byte_c, dest_byte_d;
499
500 qtest_quit(from);
501
502 if (test_dest) {
503 qtest_memread(to, start_address, &dest_byte_a, 1);
504
505 /* Destination still running, wait for a byte to change */
506 do {
507 qtest_memread(to, start_address, &dest_byte_b, 1);
508 usleep(1000 * 10);
509 } while (dest_byte_a == dest_byte_b);
510
511 qtest_qmp_discard_response(to, "{ 'execute' : 'stop'}");
512
513 /* With it stopped, check nothing changes */
514 qtest_memread(to, start_address, &dest_byte_c, 1);
515 usleep(1000 * 200);
516 qtest_memread(to, start_address, &dest_byte_d, 1);
517 g_assert_cmpint(dest_byte_c, ==, dest_byte_d);
518
519 check_guests_ram(to);
520 }
521
522 qtest_quit(to);
523
524 cleanup("bootsect");
525 cleanup("migsocket");
526 cleanup("src_serial");
527 cleanup("dest_serial");
528 }
529
530 static void deprecated_set_downtime(QTestState *who, const double value)
531 {
532 QDict *rsp;
533 char *expected;
534 int64_t result_int;
535
536 rsp = qtest_qmp(who,
537 "{ 'execute': 'migrate_set_downtime',"
538 " 'arguments': { 'value': %f } }", value);
539 g_assert(qdict_haskey(rsp, "return"));
540 qobject_unref(rsp);
541 result_int = value * 1000L;
542 expected = g_strdup_printf("%" PRId64, result_int);
543 migrate_check_parameter(who, "downtime-limit", expected);
544 g_free(expected);
545 }
546
547 static void deprecated_set_speed(QTestState *who, const char *value)
548 {
549 QDict *rsp;
550 gchar *cmd;
551
552 cmd = g_strdup_printf("{ 'execute': 'migrate_set_speed',"
553 "'arguments': { 'value': %s } }", value);
554 rsp = qtest_qmp(who, cmd);
555 g_free(cmd);
556 g_assert(qdict_haskey(rsp, "return"));
557 qobject_unref(rsp);
558 migrate_check_parameter(who, "max-bandwidth", value);
559 }
560
561 static void test_deprecated(void)
562 {
563 QTestState *from;
564
565 from = qtest_start("");
566
567 deprecated_set_downtime(from, 0.12345);
568 deprecated_set_speed(from, "12345");
569
570 qtest_quit(from);
571 }
572
573 static int migrate_postcopy_prepare(QTestState **from_ptr,
574 QTestState **to_ptr,
575 bool hide_error)
576 {
577 char *uri = g_strdup_printf("unix:%s/migsocket", tmpfs);
578 QTestState *from, *to;
579
580 if (test_migrate_start(&from, &to, uri, hide_error)) {
581 return -1;
582 }
583
584 migrate_set_capability(from, "postcopy-ram", "true");
585 migrate_set_capability(to, "postcopy-ram", "true");
586 migrate_set_capability(to, "postcopy-blocktime", "true");
587
588 /* We want to pick a speed slow enough that the test completes
589 * quickly, but that it doesn't complete precopy even on a slow
590 * machine, so also set the downtime.
591 */
592 migrate_set_parameter(from, "max-bandwidth", "100000000");
593 migrate_set_parameter(from, "downtime-limit", "1");
594
595 /* Wait for the first serial output from the source */
596 wait_for_serial("src_serial");
597
598 migrate(from, uri, "{}");
599 g_free(uri);
600
601 wait_for_migration_pass(from);
602
603 *from_ptr = from;
604 *to_ptr = to;
605
606 return 0;
607 }
608
609 static void migrate_postcopy_complete(QTestState *from, QTestState *to)
610 {
611 wait_for_migration_complete(from);
612
613 /* Make sure we get at least one "B" on destination */
614 wait_for_serial("dest_serial");
615
616 if (uffd_feature_thread_id) {
617 read_blocktime(to);
618 }
619
620 test_migrate_end(from, to, true);
621 }
622
623 static void test_postcopy(void)
624 {
625 QTestState *from, *to;
626
627 if (migrate_postcopy_prepare(&from, &to, false)) {
628 return;
629 }
630 migrate_postcopy_start(from, to);
631 migrate_postcopy_complete(from, to);
632 }
633
634 static void test_postcopy_recovery(void)
635 {
636 QTestState *from, *to;
637 char *uri;
638
639 if (migrate_postcopy_prepare(&from, &to, true)) {
640 return;
641 }
642
643 /* Turn postcopy speed down, 4K/s is slow enough on any machines */
644 migrate_set_parameter(from, "max-postcopy-bandwidth", "4096");
645
646 /* Now we start the postcopy */
647 migrate_postcopy_start(from, to);
648
649 /*
650 * Wait until postcopy is really started; we can only run the
651 * migrate-pause command during a postcopy
652 */
653 wait_for_migration_status(from, "postcopy-active");
654
655 /*
656 * Manually stop the postcopy migration. This emulates a network
657 * failure with the migration socket
658 */
659 migrate_pause(from);
660
661 /*
662 * Wait for destination side to reach postcopy-paused state. The
663 * migrate-recover command can only succeed if destination machine
664 * is in the paused state
665 */
666 wait_for_migration_status(to, "postcopy-paused");
667
668 /*
669 * Create a new socket to emulate a new channel that is different
670 * from the broken migration channel; tell the destination to
671 * listen to the new port
672 */
673 uri = g_strdup_printf("unix:%s/migsocket-recover", tmpfs);
674 migrate_recover(to, uri);
675
676 /*
677 * Try to rebuild the migration channel using the resume flag and
678 * the newly created channel
679 */
680 wait_for_migration_status(from, "postcopy-paused");
681 migrate(from, uri, "{'resume': true}");
682 g_free(uri);
683
684 /* Restore the postcopy bandwidth to unlimited */
685 migrate_set_parameter(from, "max-postcopy-bandwidth", "0");
686
687 migrate_postcopy_complete(from, to);
688 }
689
690 static void test_baddest(void)
691 {
692 QTestState *from, *to;
693 QDict *rsp_return;
694 char *status;
695 bool failed;
696
697 if (test_migrate_start(&from, &to, "tcp:0:0", true)) {
698 return;
699 }
700 migrate(from, "tcp:0:0", "{}");
701 do {
702 status = migrate_query_status(from);
703 g_assert(!strcmp(status, "setup") || !(strcmp(status, "failed")));
704 failed = !strcmp(status, "failed");
705 g_free(status);
706 } while (!failed);
707
708 /* Is the machine currently running? */
709 rsp_return = wait_command(from, "{ 'execute': 'query-status' }");
710 g_assert(qdict_haskey(rsp_return, "running"));
711 g_assert(qdict_get_bool(rsp_return, "running"));
712 qobject_unref(rsp_return);
713
714 test_migrate_end(from, to, false);
715 }
716
717 static void test_precopy_unix(void)
718 {
719 char *uri = g_strdup_printf("unix:%s/migsocket", tmpfs);
720 QTestState *from, *to;
721
722 if (test_migrate_start(&from, &to, uri, false)) {
723 return;
724 }
725
726 /* We want to pick a speed slow enough that the test completes
727 * quickly, but that it doesn't complete precopy even on a slow
728 * machine, so also set the downtime.
729 */
730 /* 1 ms should make it not converge*/
731 migrate_set_parameter(from, "downtime-limit", "1");
732 /* 1GB/s */
733 migrate_set_parameter(from, "max-bandwidth", "1000000000");
734
735 /* Wait for the first serial output from the source */
736 wait_for_serial("src_serial");
737
738 migrate(from, uri, "{}");
739
740 wait_for_migration_pass(from);
741
742 /* 300 ms should converge */
743 migrate_set_parameter(from, "downtime-limit", "300");
744
745 if (!got_stop) {
746 qtest_qmp_eventwait(from, "STOP");
747 }
748
749 qtest_qmp_eventwait(to, "RESUME");
750
751 wait_for_serial("dest_serial");
752 wait_for_migration_complete(from);
753
754 test_migrate_end(from, to, true);
755 g_free(uri);
756 }
757
758 int main(int argc, char **argv)
759 {
760 char template[] = "/tmp/migration-test-XXXXXX";
761 int ret;
762
763 g_test_init(&argc, &argv, NULL);
764
765 if (!ufd_version_check()) {
766 return 0;
767 }
768
769 tmpfs = mkdtemp(template);
770 if (!tmpfs) {
771 g_test_message("mkdtemp on path (%s): %s\n", template, strerror(errno));
772 }
773 g_assert(tmpfs);
774
775 module_call_init(MODULE_INIT_QOM);
776
777 qtest_add_func("/migration/postcopy/unix", test_postcopy);
778 qtest_add_func("/migration/postcopy/recovery", test_postcopy_recovery);
779 qtest_add_func("/migration/deprecated", test_deprecated);
780 qtest_add_func("/migration/bad_dest", test_baddest);
781 qtest_add_func("/migration/precopy/unix", test_precopy_unix);
782
783 ret = g_test_run();
784
785 g_assert_cmpint(ret, ==, 0);
786
787 ret = rmdir(tmpfs);
788 if (ret != 0) {
789 g_test_message("unable to rmdir: path (%s): %s\n",
790 tmpfs, strerror(errno));
791 }
792
793 return ret;
794 }