Tim Landscheidt has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/106283


Change subject: Work around pbuilder not properly setting $USER
......................................................................

Work around pbuilder not properly setting $USER

On su'ing to the build user, pbuilder only sets $LOGNAME to the build
user's name ("pbuilder"), but leaves $USER as is, i. e. "root"
(cf. http://bugs.debian.org/677666).  This confuses the test suite.

This change imitates the behaviour of jsub itself: Try $LOGNAME before
using $USER; thus the test suite succeeds when run under pbuilder.

Change-Id: Ia0553ecf802082609e61c5ddb0e6546719297417
---
M tests/testsuite.at
1 file changed, 7 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/labs/toollabs 
refs/changes/83/106283/1

diff --git a/tests/testsuite.at b/tests/testsuite.at
index 8fbba5e..e97f9a5 100644
--- a/tests/testsuite.at
+++ b/tests/testsuite.at
@@ -72,17 +72,17 @@
 # These tests will create two files (true.err and true.out) in the
 # home directory of the calling user.
 AT_TOOLLABS_JSUB([Normal call], [true], [Your job 501377 ("true") has been 
submitted
-], [], [0], [-e $HOME/true.err -o $HOME/true.out -M $u...@tools.wmflabs.org -N 
true -hard -l h_vmem=262144k -q task -b y /bin/true
+], [], [0], [-e $HOME/true.err -o $HOME/true.out -M 
${LOGNAME:-$USER}@tools.wmflabs.org -N true -hard -l h_vmem=262144k -q task -b 
y /bin/true
 ], [], [Your job 501377 ("true") has been submitted
 ], [], [0])
 AT_TOOLLABS_JSUB([Quiet call], [-quiet true], [Your job 501377 ("true") has 
been submitted
-], [], [0], [-e $HOME/true.err -o $HOME/true.out -M $u...@tools.wmflabs.org -N 
true -hard -l h_vmem=262144k -q task -b y /bin/true
+], [], [0], [-e $HOME/true.err -o $HOME/true.out -M 
${LOGNAME:-$USER}@tools.wmflabs.org -N true -hard -l h_vmem=262144k -q task -b 
y /bin/true
 ], [], [], [], [0])
 
 # Test that umasks are handled properly.
 AT_SETUP([-o points to a non-existing file])
 _AT_TOOLLABS_JSUB([-o does-not-exist.log -quiet true], [Your job 501377 
("true") has been submitted
-], [], [0], [-o does-not-exist.log -e $HOME/true.err -M 
$u...@tools.wmflabs.org -N true -hard -l h_vmem=262144k -q task -b y /bin/true
+], [], [0], [-o does-not-exist.log -e $HOME/true.err -M 
${LOGNAME:-$USER}@tools.wmflabs.org -N true -hard -l h_vmem=262144k -q task -b 
y /bin/true
 ], [], [], [], [0])
 AT_CHECK([stat -c %a does-not-exist.log], [0], [600
 ], [])
@@ -92,7 +92,7 @@
 AT_CHECK([touch does-exist.log], [0], [], [])
 AT_CHECK([chmod 664 does-exist.log], [0], [], [])
 _AT_TOOLLABS_JSUB([-o does-exist.log -quiet true], [Your job 501377 ("true") 
has been submitted
-], [], [0], [-o does-exist.log -e $HOME/true.err -M $u...@tools.wmflabs.org -N 
true -hard -l h_vmem=262144k -q task -b y /bin/true
+], [], [0], [-o does-exist.log -e $HOME/true.err -M 
${LOGNAME:-$USER}@tools.wmflabs.org -N true -hard -l h_vmem=262144k -q task -b 
y /bin/true
 ], [], [], [], [0])
 AT_CHECK([stat -c %a does-exist.log], [0], [664
 ], [])
@@ -100,7 +100,7 @@
 
 AT_SETUP([-o points to a non-existing file and -umask is used])
 _AT_TOOLLABS_JSUB([-o does-not-exist.log -quiet -umask 000 true], [Your job 
501377 ("true") has been submitted
-], [], [0], [-o does-not-exist.log -e $HOME/true.err -M 
$u...@tools.wmflabs.org -N true -hard -l h_vmem=262144k -q task -b y /bin/true
+], [], [0], [-o does-not-exist.log -e $HOME/true.err -M 
${LOGNAME:-$USER}@tools.wmflabs.org -N true -hard -l h_vmem=262144k -q task -b 
y /bin/true
 ], [], [], [], [0])
 AT_CHECK([stat -c %a does-not-exist.log], [0], [666
 ], [])
@@ -110,7 +110,7 @@
 AT_CHECK([touch does-exist.log], [0], [], [])
 AT_CHECK([chmod 664 does-exist.log], [0], [], [])
 _AT_TOOLLABS_JSUB([-o does-exist.log -quiet -umask 000 true], [Your job 501377 
("true") has been submitted
-], [], [0], [-o does-exist.log -e $HOME/true.err -M $u...@tools.wmflabs.org -N 
true -hard -l h_vmem=262144k -q task -b y /bin/true
+], [], [0], [-o does-exist.log -e $HOME/true.err -M 
${LOGNAME:-$USER}@tools.wmflabs.org -N true -hard -l h_vmem=262144k -q task -b 
y /bin/true
 ], [], [], [], [0])
 AT_CHECK([stat -c %a does-exist.log], [0], [664
 ], [])
@@ -119,7 +119,7 @@
 AT_SETUP([-o points to a existing directory])
 AT_CHECK([mkdir does-exist], [0], [], [])
 _AT_TOOLLABS_JSUB([-o does-exist -quiet true], [Your job 501377 ("true") has 
been submitted
-], [], [0], [-o does-exist -e $HOME/true.err -M $u...@tools.wmflabs.org -N 
true -hard -l h_vmem=262144k -q task -b y /bin/true
+], [], [0], [-o does-exist -e $HOME/true.err -M 
${LOGNAME:-$USER}@tools.wmflabs.org -N true -hard -l h_vmem=262144k -q task -b 
y /bin/true
 ], [], [], [], [0])
 AT_CHECK([LANG=C ls does-exist/*], [2], [], [ls: cannot access does-exist/*: 
No such file or directory
 ])

-- 
To view, visit https://gerrit.wikimedia.org/r/106283
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia0553ecf802082609e61c5ddb0e6546719297417
Gerrit-PatchSet: 1
Gerrit-Project: labs/toollabs
Gerrit-Branch: master
Gerrit-Owner: Tim Landscheidt <t...@tim-landscheidt.de>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to