Unverified Commit 11c52cb4 by Wolfgang Bumiller Committed by Christian Brauner

tests: lxc-test-apparmor-mount: check environment early

don't kill all my processes when running it as user... Signed-off-by: 's avatarWolfgang Bumiller <w.bumiller@proxmox.com>
parent 7d08ed65
...@@ -23,6 +23,16 @@ ...@@ -23,6 +23,16 @@
set -e set -e
# Only run on a normally configured ubuntu lxc system
if [ ! -d /sys/class/net/lxcbr0 ]; then
echo "lxcbr0 is not configured."
exit 1
fi
if [ "$(id -u)" != "0" ]; then
echo "ERROR: Must run as root."
exit 1
fi
if [ -f /proc/self/ns/cgroup ]; then if [ -f /proc/self/ns/cgroup ]; then
default_profile="lxc-container-default-cgns (enforce)" default_profile="lxc-container-default-cgns (enforce)"
else else
...@@ -74,16 +84,6 @@ clear_log() { ...@@ -74,16 +84,6 @@ clear_log() {
trap cleanup exit trap cleanup exit
# Only run on a normally configured ubuntu lxc system
if [ ! -d /sys/class/net/lxcbr0 ]; then
echo "lxcbr0 is not configured."
exit 1
fi
if [ "$(id -u)" != "0" ]; then
echo "ERROR: Must run as root."
exit 1
fi
chmod 0666 "$logfile" chmod 0666 "$logfile"
# This would be much simpler if we could run it as # This would be much simpler if we could run it as
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment