From: Shengjing Zhu Date: Fri, 5 Feb 2021 13:21:45 +0000 (+0800) Subject: skip userns test in schroot as well X-Git-Tag: archive/raspbian/1.18.9-1+rpi1^2~1 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=8af612634975d54d0cc051325d88addf64c2be88;p=golang-1.18.git skip userns test in schroot as well When schroot is using overlayfs, it fails to detect it as chroot. Gbp-Pq: Name 0004-skip-userns-test-in-schroot-as-well.patch --- diff --git a/src/syscall/exec_linux_test.go b/src/syscall/exec_linux_test.go index 0ec9c4db..cabaaf99 100644 --- a/src/syscall/exec_linux_test.go +++ b/src/syscall/exec_linux_test.go @@ -32,6 +32,10 @@ func isLXC() bool { return os.Getenv("container") == "lxc" } +func isSchroot() bool { + return os.Getenv("SCHROOT_SESSION_ID") != "" +} + func skipInContainer(t *testing.T) { // TODO: the callers of this func are using this func to skip // tests when running as some sort of "fake root" that's uid 0 @@ -47,6 +51,9 @@ func skipInContainer(t *testing.T) { if isLXC() { t.Skip("skip this test in LXC container") } + if isSchroot() { + t.Skip("skip this test in Schroot container") + } } func skipNoUserNamespaces(t *testing.T) {