merged to master-next (which should become master tomorrow, or later today).

Bruce

On Tue, Mar 26, 2024 at 5:03 AM Xiangyu Chen <[email protected]>
wrote:

> From: Xiangyu Chen <[email protected]>
>
> Upstream dropped cgroup handling in lxc-test-usernic lxc-test-unpriv and
> lxc-test-apparmor-mount to fix the broken cases.
>
> Signed-off-by: Xiangyu Chen <[email protected]>
> ---
>  ...xc-test-usernic-drop-cgroup-handling.patch |  61 +++++++++++
>  ...-and-broken-cgroup-handling-code-fro.patch | 103 ++++++++++++++++++
>  recipes-containers/lxc/lxc_git.bb             |   2 +
>  3 files changed, 166 insertions(+)
>  create mode 100644
> recipes-containers/lxc/files/0001-lxc-test-usernic-drop-cgroup-handling.patch
>  create mode 100644
> recipes-containers/lxc/files/0001-tests-remove-old-and-broken-cgroup-handling-code-fro.patch
>
> diff --git
> a/recipes-containers/lxc/files/0001-lxc-test-usernic-drop-cgroup-handling.patch
> b/recipes-containers/lxc/files/0001-lxc-test-usernic-drop-cgroup-handling.patch
> new file mode 100644
> index 00000000..162e8f9d
> --- /dev/null
> +++
> b/recipes-containers/lxc/files/0001-lxc-test-usernic-drop-cgroup-handling.patch
> @@ -0,0 +1,61 @@
> +From ec85e5ca4953292c4341497704ce738669a79b64 Mon Sep 17 00:00:00 2001
> +From: Serge Hallyn <[email protected]>
> +Date: Fri, 2 Feb 2024 10:41:11 -0600
> +Subject: [PATCH] lxc-test-usernic: drop cgroup handling
> +
> +This stuff is not needed in a modern systemd based system, and in fact
> +breaks.  It would probably be better to detect such a system so that a
> +non-systemd box can still run this test.  But I'm not sure what would be
> +reliable.
> +
> +Upstream-Status: Backport from
> +[
> https://github.com/lxc/lxc/commit/ec85e5ca4953292c4341497704ce738669a79b64
> ]
> +
> +Signed-off-by: Serge Hallyn <[email protected]>
> +Signed-off-by: Xiangyu Chen <[email protected]>
> +---
> + src/tests/lxc-test-usernic.in | 28 ----------------------------
> + 1 file changed, 28 deletions(-)
> +
> +diff --git a/src/tests/lxc-test-usernic.in b/src/tests/
> lxc-test-usernic.in
> +index 9af8678f3..49fd5e3f7 100755
> +--- a/src/tests/lxc-test-usernic.in
> ++++ b/src/tests/lxc-test-usernic.in
> +@@ -80,34 +80,6 @@ lxc.idmap = u 0 910000 10000
> + lxc.idmap = g 0 910000 10000
> + EOF
> +
> +-if command -v cgm >/dev/null 2>&1; then
> +-      cgm create all usernic-user
> +-      cgm chown all usernic-user $(id -u usernic-user) $(id -g
> usernic-user)
> +-      cgm movepid all usernic-user $$
> +-elif [ -e /sys/fs/cgroup/cgmanager/sock ]; then
> +-      for d in $(cut -d : -f 2 /proc/self/cgroup); do
> +-              dbus-send --print-reply
> --address=unix:path=/sys/fs/cgroup/cgmanager/sock \
> +-                      --type=method_call /org/linuxcontainers/cgmanager
> org.linuxcontainers.cgmanager0_0.Create \
> +-                      string:$d string:usernic-user >/dev/null
> +-
> +-              dbus-send --print-reply
> --address=unix:path=/sys/fs/cgroup/cgmanager/sock \
> +-                      --type=method_call /org/linuxcontainers/cgmanager
> org.linuxcontainers.cgmanager0_0.Chown \
> +-                      string:$d string:usernic-user int32:$(id -u
> usernic-user) int32:$(id -g usernic-user) >/dev/null
> +-
> +-              dbus-send --print-reply
> --address=unix:path=/sys/fs/cgroup/cgmanager/sock \
> +-                      --type=method_call /org/linuxcontainers/cgmanager
> org.linuxcontainers.cgmanager0_0.MovePid \
> +-                      string:$d string:usernic-user int32:$$ >/dev/null
> +-      done
> +-else
> +-      for d in /sys/fs/cgroup/*; do
> +-              [ "$d" = "/sys/fs/cgroup/unified" ] && continue
> +-              [ -f $d/cgroup.clone_children ] && echo 1 >
> $d/cgroup.clone_children
> +-              [ ! -d $d/lxctest ] && mkdir $d/lxctest
> +-              chown -R usernic-user: $d/lxctest
> +-              echo $$ > $d/lxctest/tasks
> +-      done
> +-fi
> +-
> + mkdir -p /run/user/$(id -u usernic-user)
> + chown -R usernic-user: /run/user/$(id -u usernic-user) /home/usernic-user
> +
> +--
> +2.35.5
> +
> diff --git
> a/recipes-containers/lxc/files/0001-tests-remove-old-and-broken-cgroup-handling-code-fro.patch
> b/recipes-containers/lxc/files/0001-tests-remove-old-and-broken-cgroup-handling-code-fro.patch
> new file mode 100644
> index 00000000..bf8df795
> --- /dev/null
> +++
> b/recipes-containers/lxc/files/0001-tests-remove-old-and-broken-cgroup-handling-code-fro.patch
> @@ -0,0 +1,103 @@
> +From 8f9733d756361ff8f8d8d589f286c0e064b1195d Mon Sep 17 00:00:00 2001
> +From: Alexander Mikhalitsyn <[email protected]>
> +Date: Thu, 15 Feb 2024 18:13:05 +0100
> +Subject: [PATCH] tests: remove old and broken cgroup handling code from
> tests
> +
> +We have removed the same piece of code in
> +ec85e5ca495 ("lxc-test-usernic: drop cgroup handling")
> +let's do the same for two other tests.
> +
> +This fixes autopkgtests.
> +
> +Upstream-Status: Backport from
> +[
> https://github.com/lxc/lxc/commit/8f9733d756361ff8f8d8d589f286c0e064b1195d
> ]
> +
> +Signed-off-by: Alexander Mikhalitsyn <[email protected]
> >
> +Signed-off-by: Xiangyu Chen <[email protected]>
> +---
> + src/tests/lxc-test-apparmor-mount | 29 -----------------------------
> + src/tests/lxc-test-unpriv         | 28 ----------------------------
> + 2 files changed, 57 deletions(-)
> +
> +diff --git a/src/tests/lxc-test-apparmor-mount
> b/src/tests/lxc-test-apparmor-mount
> +index 7c9d9ad50..ddf783d4b 100755
> +--- a/src/tests/lxc-test-apparmor-mount
> ++++ b/src/tests/lxc-test-apparmor-mount
> +@@ -119,35 +119,6 @@ chown -R $TUSER: /run/user/$(id -u $TUSER)
> +
> + cd $HDIR
> +
> +-if command -v cgm >/dev/null 2>&1; then
> +-      cgm create all $TUSER
> +-      cgm chown all $TUSER $(id -u $TUSER) $(id -g $TUSER)
> +-      cgm movepid all $TUSER $$
> +-elif [ -e /sys/fs/cgroup/cgmanager/sock ]; then
> +-      for d in $(cut -d : -f 2 /proc/self/cgroup); do
> +-              dbus-send --print-reply
> --address=unix:path=/sys/fs/cgroup/cgmanager/sock \
> +-                      --type=method_call /org/linuxcontainers/cgmanager
> org.linuxcontainers.cgmanager0_0.Create \
> +-                      string:$d string:$TUSER >/dev/null
> +-
> +-              dbus-send --print-reply
> --address=unix:path=/sys/fs/cgroup/cgmanager/sock \
> +-                      --type=method_call /org/linuxcontainers/cgmanager
> org.linuxcontainers.cgmanager0_0.Chown \
> +-                      string:$d string:$TUSER int32:$(id -u $TUSER)
> int32:$(id -g $TUSER) >/dev/null
> +-
> +-              dbus-send --print-reply
> --address=unix:path=/sys/fs/cgroup/cgmanager/sock \
> +-                      --type=method_call /org/linuxcontainers/cgmanager
> org.linuxcontainers.cgmanager0_0.MovePid \
> +-                      string:$d string:$TUSER int32:$$ >/dev/null
> +-      done
> +-else
> +-      for d in /sys/fs/cgroup/*; do
> +-              [ "$d" = "/sys/fs/cgroup/unified" ] && continue
> +-              [ -f $d/cgroup.clone_children ] && echo 1 >
> $d/cgroup.clone_children
> +-              [ ! -d $d/lxctest ] && mkdir $d/lxctest
> +-              chown -R $TUSER: $d/lxctest
> +-              echo $$ > $d/lxctest/tasks
> +-      done
> +-fi
> +-
> +-
> + run_cmd lxc-create -t busybox -n $cname
> +
> + echo "test default confined container"
> +diff --git a/src/tests/lxc-test-unpriv b/src/tests/lxc-test-unpriv
> +index 8fb9106d6..426add9da 100755
> +--- a/src/tests/lxc-test-unpriv
> ++++ b/src/tests/lxc-test-unpriv
> +@@ -130,34 +130,6 @@ chown -R $TUSER: /run/user/$(id -u $TUSER)
> +
> + cd $HDIR
> +
> +-if command -v cgm >/dev/null 2>&1; then
> +-      cgm create all $TUSER
> +-      cgm chown all $TUSER $(id -u $TUSER) $(id -g $TUSER)
> +-      cgm movepid all $TUSER $$
> +-elif [ -e /sys/fs/cgroup/cgmanager/sock ]; then
> +-      for d in $(cut -d : -f 2 /proc/self/cgroup); do
> +-              dbus-send --print-reply
> --address=unix:path=/sys/fs/cgroup/cgmanager/sock \
> +-                      --type=method_call /org/linuxcontainers/cgmanager
> org.linuxcontainers.cgmanager0_0.Create \
> +-                      string:$d string:$TUSER >/dev/null
> +-
> +-              dbus-send --print-reply
> --address=unix:path=/sys/fs/cgroup/cgmanager/sock \
> +-                      --type=method_call /org/linuxcontainers/cgmanager
> org.linuxcontainers.cgmanager0_0.Chown \
> +-                      string:$d string:$TUSER int32:$(id -u $TUSER)
> int32:$(id -g $TUSER) >/dev/null
> +-
> +-              dbus-send --print-reply
> --address=unix:path=/sys/fs/cgroup/cgmanager/sock \
> +-                      --type=method_call /org/linuxcontainers/cgmanager
> org.linuxcontainers.cgmanager0_0.MovePid \
> +-                      string:$d string:$TUSER int32:$$ >/dev/null
> +-      done
> +-else
> +-      for d in /sys/fs/cgroup/*; do
> +-              [ "$d" = "/sys/fs/cgroup/unified" ] && continue
> +-              [ -f $d/cgroup.clone_children ] && echo 1 >
> $d/cgroup.clone_children
> +-              [ ! -d $d/lxctest ] && mkdir $d/lxctest
> +-              chown -R $TUSER: $d/lxctest
> +-              echo $$ > $d/lxctest/tasks
> +-      done
> +-fi
> +-
> + run_cmd lxc-create -t busybox -n c1 -l trace -o "${UNPRIV_LOG}"
> +
> + # Make sure we can start it - twice
> +--
> +2.35.5
> +
> diff --git a/recipes-containers/lxc/lxc_git.bb b/recipes-containers/lxc/
> lxc_git.bb
> index 33ea4ee7..ee0e442f 100644
> --- a/recipes-containers/lxc/lxc_git.bb
> +++ b/recipes-containers/lxc/lxc_git.bb
> @@ -47,6 +47,8 @@ SRC_URI = "git://
> github.com/lxc/lxc.git;branch=stable-5.0;protocol=https \
>
> file://0001-template-if-busybox-contains-init-use-it-in-containe.patch \
>         file://dnsmasq.conf \
>         file://lxc-net \
> +       file://0001-lxc-test-usernic-drop-cgroup-handling.patch \
> +
>  file://0001-tests-remove-old-and-broken-cgroup-handling-code-fro.patch \
>         "
>
>  SRCREV = "cb8e38aca27a23964941f0f011a8919aab8bebab"
> --
> 2.35.5
>
>
> 
>
>

-- 
- Thou shalt not follow the NULL pointer, for chaos and madness await thee
at its end
- "Use the force Harry" - Gandalf, Star Trek II
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#8668): 
https://lists.yoctoproject.org/g/meta-virtualization/message/8668
Mute This Topic: https://lists.yoctoproject.org/mt/105154916/21656
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/meta-virtualization/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to