diff options
author | Luca Boccassi <luca.boccassi@microsoft.com> | 2020-05-22 16:06:54 +0100 |
---|---|---|
committer | Luca Boccassi <luca.boccassi@microsoft.com> | 2020-06-23 12:58:21 +0100 |
commit | e1bb4b0d1dd91ea13792e9d16d4bbf4ab8385f58 (patch) | |
tree | 59093b2665995161fa5fd2126e77755b059e73d8 /test | |
parent | 34e0d56ce23fcdfd264ad5e8ada58a520c23a80f (diff) | |
download | systemd-e1bb4b0d1dd91ea13792e9d16d4bbf4ab8385f58.tar.gz |
nspawn: implement container host os-release interface
Diffstat (limited to 'test')
-rwxr-xr-x | test/TEST-13-NSPAWN-SMOKE/test.sh | 2 | ||||
-rwxr-xr-x | test/units/testsuite-13.sh | 14 |
2 files changed, 15 insertions, 1 deletions
diff --git a/test/TEST-13-NSPAWN-SMOKE/test.sh b/test/TEST-13-NSPAWN-SMOKE/test.sh index fbe52296ce..236378a380 100755 --- a/test/TEST-13-NSPAWN-SMOKE/test.sh +++ b/test/TEST-13-NSPAWN-SMOKE/test.sh @@ -16,7 +16,7 @@ test_create_image() { mask_supporting_services ../create-busybox-container $initdir/testsuite-13.nc-container - initdir="$initdir/testsuite-13.nc-container" dracut_install nc ip + initdir="$initdir/testsuite-13.nc-container" dracut_install nc ip md5sum ) } diff --git a/test/units/testsuite-13.sh b/test/units/testsuite-13.sh index e374206102..dd1c9575c4 100755 --- a/test/units/testsuite-13.sh +++ b/test/units/testsuite-13.sh @@ -60,6 +60,18 @@ function check_notification_socket { systemd-nspawn --register=no -D /testsuite-13.nc-container -U /bin/sh -x -c "$_cmd" } +function check_os_release { + local _cmd='. /tmp/os-release +if [ -n "${ID:+set}" ] && [ "${ID}" != "${container_host_id}" ]; then exit 1; fi +if [ -n "${VERSION_ID:+set}" ] && [ "${VERSION_ID}" != "${container_host_version_id}" ]; then exit 1; fi +if [ -n "${BUILD_ID:+set}" ] && [ "${BUILD_ID}" != "${container_host_build_id}" ]; then exit 1; fi +if [ -n "${VARIANT_ID:+set}" ] && [ "${VARIANT_ID}" != "${container_host_variant_id}" ]; then exit 1; fi +cd /tmp; (cd /run/host/usr/lib; md5sum os-release) | md5sum -c +' + + systemd-nspawn --register=no -D /testsuite-13.nc-container --bind=/etc/os-release:/tmp/os-release /bin/sh -x -e -c "$_cmd" +} + function run { if [[ "$1" = "yes" && "$is_v2_supported" = "no" ]]; then printf "Unified cgroup hierarchy is not supported. Skipping.\n" >&2 @@ -144,6 +156,8 @@ check_norbind check_notification_socket +check_os_release + for api_vfs_writable in yes no network; do run no no $api_vfs_writable run yes no $api_vfs_writable |