Merge lp:~mvo/software-center/adt-you-make-my-life-hard into lp:software-center

Proposed by Michael Vogt on 2012-08-30
Status: Merged
Merged at revision: 3142
Proposed branch: lp:~mvo/software-center/adt-you-make-my-life-hard
Merge into: lp:software-center
Diff against target: 34 lines (+6/-2)
2 files modified
debian/tests/run-tests (+5/-1)
run-tests.sh (+1/-1)
To merge this branch: bzr merge lp:~mvo/software-center/adt-you-make-my-life-hard
Reviewer Review Type Date Requested Status
Gary Lasker (community) 2012-08-30 Approve on 2012-08-31
Review via email: mp+122100@code.launchpad.net

Description of the Change

a sledgehammer approach to make the tests run as user

To post a comment you must log in.
Gary Lasker (gary-lasker) wrote :

Interesting!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/tests/run-tests'
2--- debian/tests/run-tests 2012-08-28 13:01:46 +0000
3+++ debian/tests/run-tests 2012-08-30 16:13:20 +0000
4@@ -1,5 +1,5 @@
5 #!/bin/sh
6-set -e
7+set -ex
8
9 # the default user in the adt env is "ubuntu"
10 USER=ubuntu
11@@ -9,6 +9,10 @@
12 # we don't like running as root in the adt environment
13 if $(id $USER >/dev/null); then
14 if [ "$(id -u)" = "0" ]; then
15+ # the ADT basedir is 0700 so non-root have a hard time
16+ ADT_BASEDIR=$PWD/..
17+ echo "FIXING owner in ${ADT_BASEDIR} to user $USER"
18+ chown -R $USER ${ADT_BASEDIR}
19 echo "Switching to user $USER"
20 su -lc "cd $PWD; sh $0" $USER
21 fi
22
23=== modified file 'run-tests.sh'
24--- run-tests.sh 2012-08-28 13:17:24 +0000
25+++ run-tests.sh 2012-08-30 16:13:20 +0000
26@@ -91,7 +91,7 @@
27 done
28 }
29
30-if [ "$1" == "--sso-gtk" ]; then
31+if [ "$1" = "--sso-gtk" ]; then
32 # Run the SSO GTK+ suite
33 $PYTHON discover -s softwarecenter/sso/
34 elif [ $# -gt 0 ]; then

Subscribers

People subscribed via source and target branches