1 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2 From: Wolfgang Bumiller <w.bumiller@proxmox.com>
3 Date: Tue, 24 Jul 2018 11:49:14 +0200
4 Subject: [PATCH] tests: lxc-test-apparmor-mount: check environment early
6 don't kill all my processes when running it as user...
8 Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
9 (cherry picked from commit 39e2cbec3cc9f49e3edd65b2aa4bdd3983a25fea)
11 src/tests/lxc-test-apparmor-mount | 20 ++++++++++----------
12 1 file changed, 10 insertions(+), 10 deletions(-)
14 diff --git a/src/tests/lxc-test-apparmor-mount b/src/tests/lxc-test-apparmor-mount
15 index 144467c8..56d598f4 100755
16 --- a/src/tests/lxc-test-apparmor-mount
17 +++ b/src/tests/lxc-test-apparmor-mount
22 +# Only run on a normally configured ubuntu lxc system
23 +if [ ! -d /sys/class/net/lxcbr0 ]; then
24 + echo "lxcbr0 is not configured."
27 +if [ "$(id -u)" != "0" ]; then
28 + echo "ERROR: Must run as root."
32 if [ -f /proc/self/ns/cgroup ]; then
33 default_profile="lxc-container-default-cgns (enforce)"
35 @@ -74,16 +84,6 @@ clear_log() {
39 -# Only run on a normally configured ubuntu lxc system
40 -if [ ! -d /sys/class/net/lxcbr0 ]; then
41 - echo "lxcbr0 is not configured."
44 -if [ "$(id -u)" != "0" ]; then
45 - echo "ERROR: Must run as root."
51 # This would be much simpler if we could run it as