From 21f567bdd9e9abe1ce8d0a2b6595670ba9f2682b Mon Sep 17 00:00:00 2001 From: Eric Culp Date: Sun, 12 Jan 2020 15:49:17 -0800 Subject: [PATCH 1/2] test-driver.py: Share the shared dir between VMs This changes the python test driver to match the behavior of the perl test driver. I.e. the directory mounted into /tmp/shared should be the same for all machines. This probably fixes many tests, but I found this while investigating failures in nixos/tests/ceph-multi-node.nix. --- nixos/lib/test-driver/test-driver.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nixos/lib/test-driver/test-driver.py b/nixos/lib/test-driver/test-driver.py index 7e575189209a..d5212413284a 100644 --- a/nixos/lib/test-driver/test-driver.py +++ b/nixos/lib/test-driver/test-driver.py @@ -221,7 +221,7 @@ class Machine: return path self.state_dir = create_dir("vm-state-{}".format(self.name)) - self.shared_dir = create_dir("{}/xchg".format(self.state_dir)) + self.shared_dir = create_dir("shared-xchg") self.booted = False self.connected = False From 6795a4002c1508db2ee23a8d35117a09673c06dd Mon Sep 17 00:00:00 2001 From: Eric Culp Date: Sun, 19 Jan 2020 10:33:46 -0800 Subject: [PATCH 2/2] test-driver.py: Use /tmp/shared for copy_from_vm The docstring says it uses a directory shared among all vms, although that doesn't seem necessary for the functionality. However, it does need to be consistent between the guest and host. --- nixos/lib/test-driver/test-driver.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nixos/lib/test-driver/test-driver.py b/nixos/lib/test-driver/test-driver.py index d5212413284a..faa861c2f21c 100644 --- a/nixos/lib/test-driver/test-driver.py +++ b/nixos/lib/test-driver/test-driver.py @@ -576,7 +576,7 @@ class Machine: vm_src = pathlib.Path(source) with tempfile.TemporaryDirectory(dir=self.shared_dir) as shared_td: shared_temp = pathlib.Path(shared_td) - vm_shared_temp = pathlib.Path("/tmp/xchg") / shared_temp.name + vm_shared_temp = pathlib.Path("/tmp/shared") / shared_temp.name vm_intermediate = vm_shared_temp / vm_src.name intermediate = shared_temp / vm_src.name # Copy the file to the shared directory inside VM