summaryrefslogtreecommitdiff
path: root/test/units/testsuite-29.sh
diff options
context:
space:
mode:
authorLuca Boccassi <luca.boccassi@microsoft.com>2020-06-23 13:09:42 +0100
committerLuca Boccassi <luca.boccassi@gmail.com>2021-03-31 09:56:44 +0100
commit907952bbc92dd6656807d9b2eb0d0c94a4c9e865 (patch)
treeb5a1f594b1191699443798922b2c94e6d7fb0c76 /test/units/testsuite-29.sh
parent248b1e0aa41d97958c6f45132f6cc7e888263eb7 (diff)
downloadsystemd-907952bbc92dd6656807d9b2eb0d0c94a4c9e865.tar.gz
portabled: add --extension parameter for layered images support
Add an --extension parameter to portablectl, and new DBUS methods to attach/detach/reattach/inspect. Allows to append separate images on top of the root directory (os-release will be searched in there) and mount the images using an overlay-like setup (unit files will be searched in there) using the new ExtensionImages service option.
Diffstat (limited to 'test/units/testsuite-29.sh')
-rwxr-xr-xtest/units/testsuite-29.sh30
1 files changed, 30 insertions, 0 deletions
diff --git a/test/units/testsuite-29.sh b/test/units/testsuite-29.sh
index b5b05b42d9..2e55c275bf 100755
--- a/test/units/testsuite-29.sh
+++ b/test/units/testsuite-29.sh
@@ -63,6 +63,36 @@ portablectl detach --now --enable --runtime /tmp/minimal_1 app0
portablectl list | grep -q -F "No images."
+root="/usr/share/minimal_0.raw"
+app1="/usr/share/app1.raw"
+
+portablectl attach --now --runtime --extension ${app1} ${root} app1
+
+systemctl is-active app1.service
+
+portablectl reattach --now --runtime --extension ${app1} ${root} app1
+
+systemctl is-active app1.service
+
+portablectl detach --now --runtime --extension ${app1} ${root} app1
+
+# portablectl also works with directory paths rather than images
+
+mkdir /tmp/rootdir /tmp/app1 /tmp/overlay
+mount ${app1} /tmp/app1
+mount ${root} /tmp/rootdir
+mount -t overlay overlay -o lowerdir=/tmp/app1:/tmp/rootdir /tmp/overlay
+
+portablectl attach --copy=symlink --now --runtime /tmp/overlay app1
+
+systemctl is-active app1.service
+
+portablectl detach --now --runtime overlay app1
+
+umount /tmp/overlay
+umount /tmp/rootdir
+umount /tmp/app1
+
echo OK > /testok
exit 0