Skip to content

Commit

Permalink
tests/container-copy: test refreshing the copy
Browse files Browse the repository at this point in the history
Signed-off-by: Simon Deziel <[email protected]>
  • Loading branch information
simondeziel committed Jul 18, 2024
1 parent 49781ae commit f7e42c0
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions tests/container-copy
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f7e42c0

Please sign in to comment.