summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJürg Billeter <j@bitron.ch>2019-11-21 07:38:31 +0100
committerJürg Billeter <j@bitron.ch>2019-12-03 12:06:31 +0000
commitae63515abb8b294eba0a5a64a05acb1439b299f0 (patch)
tree83de688af5f78ce66452e4b7a770fe4ee58d5842
parent27ec82e3bc00e06800249deca61c7b2df620596c (diff)
downloadbuildstream-ae63515abb8b294eba0a5a64a05acb1439b299f0.tar.gz
testing/_utils/site.py: Add CASD_SEPARATE_USER variable
This is set to True if buildbox-casd is installed with the set-uid bit and thus, indicates whether buildbox-casd is running as a separate user.
-rw-r--r--src/buildstream/testing/_utils/site.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/buildstream/testing/_utils/site.py b/src/buildstream/testing/_utils/site.py
index 953d21607..5507df0f7 100644
--- a/src/buildstream/testing/_utils/site.py
+++ b/src/buildstream/testing/_utils/site.py
@@ -2,6 +2,7 @@
# so we dont have to repeat this everywhere
#
import os
+import stat
import subprocess
import sys
import platform
@@ -65,6 +66,10 @@ try:
except ImportError:
HAVE_ARPY = False
+casd_path = utils.get_host_tool("buildbox-casd")
+CASD_SEPARATE_USER = bool(os.stat(casd_path).st_mode & stat.S_ISUID)
+del casd_path
+
try:
utils.get_host_tool("buildbox")
HAVE_BUILDBOX = True