git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCHv2 0/5] Travis CI: don't run the test suite as root in the 32 bit Linux build

From
SZEDER Gábor <szeder.dev@gmail.com>
Date
Jan 29, 2018, 17:17 UTC
Message-ID
<20180129171713.17471-1-szeder.dev@gmail.com>
This version addresses Peff comments:
  - Updated the commit message to discuss the broken && chain and its
    consequences in patch 2.
  - Fixed quoting of the 'su' command snippet and updated the commit
    message in patch 3.
  - Squelch error from 'test "$(id -u $CI_USER)"' and add debug
    message in patch 5.

Additionally, it's rebased onto current master (I branched off v1 from 'sg/travis-build-during-script-phase' to avoid a conflict, but Junio applied it on top of current master).

Interdiff against 'sg/travis-linux32-sanity' at the end.
SZEDER Gábor (5):
  travis-ci: use 'set -x' for the commands under 'su' in the 32 bit
    Linux build
  travis-ci: use 'set -e' in the 32 bit Linux build job
  travis-ci: don't repeat the path of the cache directory
  travis-ci: don't run the test suite as root in the 32 bit Linux build
  travis-ci: don't fail if user already exists on 32 bit Linux build job
 ci/lib-travisci.sh       |  7 ++++---
 ci/run-linux32-build.sh  | 51 ++++++++++++++++++++++++++++++++++++------------
 ci/run-linux32-docker.sh |  7 +++++--
 ci/run-tests.sh          |  3 ++-
 4 files changed, 50 insertions(+), 18 deletions(-)
-- 
2.16.1.158.ge6451079d

diff --git a/ci/run-linux32-build.sh b/ci/run-linux32-build.sh
index 13047adde..2c60d2e70 100755
--- a/ci/run-linux32-build.sh
+++ b/ci/run-linux32-build.sh
@@ -33,9 +33,9 @@ then
 	CI_USER=root
 else
 	CI_USER=ci
-	if test "$(id -u $CI_USER)" = $HOST_UID
+	if test "$(id -u $CI_USER 2>/dev/null)" = $HOST_UID
 	then
-		: # user already exists with the right ID
+		echo "user '$CI_USER' already exists with the requested ID $HOST_UID"
 	else
 		useradd -u $HOST_UID $CI_USER
 	fi
@@ -51,10 +51,10 @@ else
 fi
 
 # Build and test
-linux32 --32bit i386 su -m -l $CI_USER -c "
+linux32 --32bit i386 su -m -l $CI_USER -c '
 	set -ex
 	cd /usr/src/git
-	test -n '$cache_dir' && ln -s '$cache_dir/.prove' t/.prove
+	test -n "$cache_dir" && ln -s "$cache_dir/.prove" t/.prove
 	make --jobs=2
 	make --quiet test
-"
+'
Next: SZEDER Gábor
Message 1 of 7 in “[PATCHv2 0/5] Travis CI: don't run the test suite as root in the 32 bit Linux build”
  1. SZEDER GáborJan 29, 2018
  2. 1/5 travis-ci: use 'set -x' for the commands under 'su' in the 32 bit Linux buildSZEDER Gábor, Jan 29, 2018
  3. 3/5 travis-ci: don't repeat the path of the cache directorySZEDER Gábor, Jan 29, 2018
  4. 5/5 travis-ci: don't fail if user already exists on 32 bit Linux build jobSZEDER Gábor, Jan 29, 2018
  5. 2/5 travis-ci: use 'set -e' in the 32 bit Linux build jobSZEDER Gábor, Jan 29, 2018
  6. 4/5 travis-ci: don't run the test suite as root in the 32 bit Linux buildSZEDER Gábor, Jan 29, 2018
  7. Jeff KingJan 29, 2018

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.