[lxc-devel] [lxd/master] test: Fixes proxy device unix tests on Ubuntu Eoan

tomponline on Github lxc-bot at linuxcontainers.org
Wed Aug 7 09:24:03 UTC 2019


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 705 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20190807/4a516369/attachment-0001.bin>
-------------- next part --------------
From 66636d454a6c2761b3f6c8282cce01e6385490ac Mon Sep 17 00:00:00 2001
From: Thomas Parrott <thomas.parrott at canonical.com>
Date: Wed, 7 Aug 2019 10:19:30 +0100
Subject: [PATCH] test: Fixes proxy device unix tests on Ubuntu Eoan
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

The file permission on /tmp in the Busybox image on Ubuntu Eoan did not allow global access for all users.

This caused problems when running forkproxy as a non-root UID/GID with UNIX sockets.

This commit sets /tmp inside the container to 1777 before running the UNIX socket tests.

Suggested-By: St├ęphane Graber <stgraber at ubuntu.com>
Signed-off-by: Thomas Parrott <thomas.parrott at canonical.com>
---
 test/suites/container_devices_proxy.sh | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/test/suites/container_devices_proxy.sh b/test/suites/container_devices_proxy.sh
index d3397baa43..26d4726e19 100644
--- a/test/suites/container_devices_proxy.sh
+++ b/test/suites/container_devices_proxy.sh
@@ -162,6 +162,9 @@ container_devices_proxy_unix() {
   HOST_SOCK="${TEST_DIR}/lxdtest-$(basename "${LXD_DIR}")-host.sock"
   lxc launch testimage proxyTester
 
+  # Some busybox images don't have /tmp globally accessible.
+  lxc exec proxyTester -- chmod 1777 /tmp
+
   # Initial test
   lxc config device add proxyTester proxyDev proxy "listen=unix:${HOST_SOCK}" uid=1234 gid=1234 security.uid=1234 security.gid=1234 connect=unix:/tmp/"lxdtest-$(basename "${LXD_DIR}").sock" bind=host
   (


More information about the lxc-devel mailing list