summaryrefslogtreecommitdiffstats
path: root/test/TEST-13-NSPAWN-SMOKE/test.sh
diff options
context:
space:
mode:
authorEvgeny Vereshchagin <evvers@ya.ru>2017-01-17 02:37:05 +0100
committerEvgeny Vereshchagin <evvers@ya.ru>2017-01-17 09:40:19 +0100
commit9bcef20646b6313e42f8ccd1b1b554553bb364c9 (patch)
treea222321376769ad2a3ee0c683bdf953029ec181e /test/TEST-13-NSPAWN-SMOKE/test.sh
parentnspawn: change owner/group of /run/systemd/nspawn/notify to userns-root (diff)
downloadsystemd-9bcef20646b6313e42f8ccd1b1b554553bb364c9.tar.xz
systemd-9bcef20646b6313e42f8ccd1b1b554553bb364c9.zip
tests: check that we can write to /run/systemd/nspawn/notify
See https://github.com/systemd/systemd/issues/4944
Diffstat (limited to 'test/TEST-13-NSPAWN-SMOKE/test.sh')
-rwxr-xr-xtest/TEST-13-NSPAWN-SMOKE/test.sh12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/TEST-13-NSPAWN-SMOKE/test.sh b/test/TEST-13-NSPAWN-SMOKE/test.sh
index b8b8ec34bd..75b99236a3 100755
--- a/test/TEST-13-NSPAWN-SMOKE/test.sh
+++ b/test/TEST-13-NSPAWN-SMOKE/test.sh
@@ -43,6 +43,9 @@ test_setup() {
cp create-busybox-container $initdir/
+ ./create-busybox-container $initdir/nc-container
+ initdir="$initdir/nc-container" dracut_install nc
+
# setup the testsuite service
cat >$initdir/etc/systemd/system/testsuite.service <<EOF
[Unit]
@@ -91,6 +94,13 @@ function check_bind_tmp_path {
systemd-nspawn --register=no -D "$_root" --bind=/tmp/bind /bin/sh -c 'test -e /tmp/bind'
}
+function check_notification_socket {
+ # https://github.com/systemd/systemd/issues/4944
+ local _cmd='echo a | $(busybox which nc) -U -u -w 1 /run/systemd/nspawn/notify'
+ systemd-nspawn --register=no -D /nc-container /bin/sh -x -c "$_cmd"
+ systemd-nspawn --register=no -D /nc-container -U /bin/sh -x -c "$_cmd"
+}
+
function run {
if [[ "$1" = "yes" && "$is_v2_supported" = "no" ]]; then
printf "Unified cgroup hierarchy is not supported. Skipping.\n" >&2
@@ -123,6 +133,8 @@ function run {
check_bind_tmp_path
+check_notification_socket
+
for api_vfs_writable in yes no network; do
run no no $api_vfs_writable
run yes no $api_vfs_writable