diff --git a/tests/container-copy b/tests/container-copy index 2411d2f2a..fa254047a 100755 --- a/tests/container-copy +++ b/tests/container-copy @@ -47,6 +47,23 @@ for fs in "xfs" "btrfs" "ext4" ; do # Copy the container to the remote LXD. lxc copy c1 target:c1 --stateless --refresh --mode=relay + # Test refreshing the copy + lxc start target:c1 + printf "%s" "${fs}" | lxc file push - c1/root/my-fs + ! lxc exec target:c1 -- test -e /root/my-fs || false + lxc stop -f target:c1 + lxc copy c1 target:c1 --stateless --refresh --mode=relay + lxc start target:c1 + [ "$(lxc exec target:c1 -- cat /root/my-fs)" = "${fs}" ] + lxc stop -f target:c1 + + # Test appending to a file before refreshing the copy + echo "-${$}" | lxc exec c1 -- tee -a /root/my-fs + lxc copy c1 target:c1 --stateless --refresh --mode=relay + lxc start target:c1 + [ "$(lxc exec target:c1 -- cat /root/my-fs)" = "${fs}-${$}" ] + lxc stop -f target:c1 + # Clean up the storage pool for this run. lxc delete c1 -f lxc delete target:c1 -f