[lxc-devel] [lxd/master] Bugfixes

stgraber on Github lxc-bot at linuxcontainers.org
Thu Sep 29 04:40:32 UTC 2016


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 301 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20160929/d11cc715/attachment.bin>
-------------- next part --------------
From a3bedb9afba70f0997b26196e7119ce1e61a17f8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgraber at ubuntu.com>
Date: Thu, 29 Sep 2016 00:32:34 -0400
Subject: [PATCH 1/2] test: Force UTC timezone
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: Stéphane Graber <stgraber at ubuntu.com>
---
 test/main.sh | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/test/main.sh b/test/main.sh
index 5076448..5afa7f9 100755
--- a/test/main.sh
+++ b/test/main.sh
@@ -4,6 +4,9 @@
 # Don't translate lxc output for parsing in it in tests.
 export "LC_ALL=C"
 
+# Force UTC for consistency
+export "TZ=UTC"
+
 if [ -n "${LXD_DEBUG:-}" ]; then
   set -x
   DEBUG="--debug"

From dd9ef36a7a2bb07503598f35b07539653e6cb43e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgraber at ubuntu.com>
Date: Thu, 29 Sep 2016 00:37:14 -0400
Subject: [PATCH 2/2] test: Fix apparmor version check
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: Stéphane Graber <stgraber at ubuntu.com>
---
 test/suites/basic.sh | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/test/suites/basic.sh b/test/suites/basic.sh
index 5bcfdc9..52824eb 100644
--- a/test/suites/basic.sh
+++ b/test/suites/basic.sh
@@ -313,7 +313,15 @@ test_basic_usage() {
   # check that an apparmor profile is created for this container, that it is
   # unloaded on stop, and that it is deleted when the container is deleted
   lxc launch testimage lxd-apparmor-test
+
+  MAJOR=0
+  MINOR=0
   if [ -f /sys/kernel/security/apparmor/features/domain/version ]; then
+    MAJOR=$(awk '{print $1}' < /sys/kernel/security/apparmor/features/domain/version)
+    MINOR=$(awk '{print $2}' < /sys/kernel/security/apparmor/features/domain/version)
+  fi
+
+  if [ "${MAJOR}" -gt "1" ] || ([ "${MAJOR}" = "1" ] && [ "${MINOR}" -ge "2" ]); then
     aa_namespace="lxd-lxd-apparmor-test_<$(echo "${LXD_DIR}" | sed -e 's/\//-/g' -e 's/^.//')>"
     aa-status | grep ":${aa_namespace}://unconfined"
     lxc stop lxd-apparmor-test --force


More information about the lxc-devel mailing list