summaryrefslogtreecommitdiff
path: root/test/lib-conf-test.sh
diff options
context:
space:
mode:
authorLuke Shumaker <LukeShu@sbcglobal.net>2013-09-11 01:28:25 -0400
committerLuke Shumaker <LukeShu@sbcglobal.net>2013-09-11 15:23:29 -0400
commit589186164cfbb1e033b9dfad33c9bf82b9404b1c (patch)
tree3919316871a4b17c35d2b74971c86b52f1ae73b0 /test/lib-conf-test.sh
parent76b27c5c5a705770fbab763199dd32efc279170a (diff)
test: change how we do sudo (to make sure we stay in the test environment)
Diffstat (limited to 'test/lib-conf-test.sh')
-rw-r--r--test/lib-conf-test.sh8
1 files changed, 5 insertions, 3 deletions
diff --git a/test/lib-conf-test.sh b/test/lib-conf-test.sh
index 86c11c6..0d028b8 100644
--- a/test/lib-conf-test.sh
+++ b/test/lib-conf-test.sh
@@ -23,11 +23,13 @@ it_sets_makepkg_vars_in_custom_file() {
it_figures_out_HOME_when_root() {
require sudo || return 0
+ # This one is tricky, because it does the job too well, it will find
+ # the actual HOME, instead of the test environment HOME. Therefore, we
+ # will just check that [[ $HOME != /root ]]
cd "$tmpdir"
echo '. $(librelib conf.sh); echo "$LIBREHOME"' > test.sh
-
- LIBREHOME=$(sudo -EH bash ./test.sh)
- [[ $LIBREHOME == $HOME ]]
+ LIBREHOME=$(testsudo bash ./test.sh)
+ [[ $LIBREHOME != /root ]]
}
it_respects_custom_HOME() {