From ef468d692bee233b37d7853098612c5b2d17423f Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Mon, 3 Jun 2013 21:03:49 -0600 Subject: unit tests: sudo was unsetting LIBRETOOLS_LIBDIR --- test/lib-conf-test.sh | 2 +- test/librechroot-test.sh | 6 +++--- test/libremakepkg-test.sh | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'test') diff --git a/test/lib-conf-test.sh b/test/lib-conf-test.sh index eeea287..0ee0f62 100644 --- a/test/lib-conf-test.sh +++ b/test/lib-conf-test.sh @@ -25,7 +25,7 @@ it_figures_out_HOME_when_root() { cd "$tmpdir" echo '. $(librelib conf.sh); echo "$LIBREHOME"' > test.sh - LIBREHOME=$(sudo bash ./test.sh) + LIBREHOME=$(sudo -EH bash ./test.sh) [[ $LIBREHOME == $HOME ]] } diff --git a/test/librechroot-test.sh b/test/librechroot-test.sh index c9fa130..c34af6e 100644 --- a/test/librechroot-test.sh +++ b/test/librechroot-test.sh @@ -14,7 +14,7 @@ after() { } it_creates_repo_for_new_chroots() { - sudo librechroot run test -r /repo/repo.db + sudo -EH librechroot run test -r /repo/repo.db } it_displays_help_as_normal_user() { @@ -41,7 +41,7 @@ it_displays_help_and_fails_with_0_args() { } it_fails_for_unknown_commands() { - sudo librechroot phony >$tmpdir/stdout 2>$tmpdir/stderr || stat=$? + sudo -EH librechroot phony >$tmpdir/stdout 2>$tmpdir/stderr || stat=$? [[ $stat != 0 ]] [[ -z "$(cat $tmpdir/stdout)" ]] @@ -49,7 +49,7 @@ it_fails_for_unknown_commands() { } it_fails_for_unknown_flags() { - sudo librechroot -q >$tmpdir/stdout 2>$tmpdir/stderr || stat=$? + sudo -EH librechroot -q >$tmpdir/stdout 2>$tmpdir/stderr || stat=$? [[ $stat != 0 ]] [[ -z "$(cat $tmpdir/stdout)" ]] diff --git a/test/libremakepkg-test.sh b/test/libremakepkg-test.sh index 5ea3b59..b014da7 100644 --- a/test/libremakepkg-test.sh +++ b/test/libremakepkg-test.sh @@ -17,7 +17,7 @@ it_builds_a_trivial_package() { cp libremakepkg.d/PKGBUILD-hello "$tmpdir/PKGBUILD" cd "$tmpdir" - sudo libremakepkg &>/dev/null + sudo -EH libremakepkg &>/dev/null [[ -f $(echo libretools-hello-1.0-1-any.pkg.tar.?z) ]] } -- cgit v1.2.3-54-g00ecf