[Libguestfs] [PATCH v2 1/1] cat: virt-tail: Fix spontaneously failing test

Mykola Ivanets stenavin at gmail.com
Sun Jan 14 19:40:42 UTC 2018


According to 'guestfs_sync' API method documentation: "You should always call this if you have modified a disk image, before closing the handle."
So, 'guestfish --remote sync' is required because changes made on the disk (guestfish --remote rm /tail) should be visible to 'virt-tail' which works in different process and also accessing the same disk.
A you can see, other changes done via 'guestfish --remote' in this test are flushed via a 'sync' command.

The test is failing spontaneously beasue without 'sync' it very depends on outside factors like qemu caching policy, underlying host filesystem etc.
---
 cat/test-virt-tail.sh | 1 +
 1 file changed, 1 insertion(+)

diff --git a/cat/test-virt-tail.sh b/cat/test-virt-tail.sh
index 47a5edc..c091eaf 100755
--- a/cat/test-virt-tail.sh
+++ b/cat/test-virt-tail.sh
@@ -101,6 +101,7 @@ fi
 
 # Delete the file.  This should cause virt-tail to exit gracefully.
 guestfish --remote rm /tail
+guestfish --remote sync
 
 # Wait for virt-tail to finish and check the status.
 wait "$tailpid"
-- 
2.9.5




More information about the Libguestfs mailing list