summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2010-08-10 02:20:33 -0700
committerZac Medico <zmedico@gentoo.org>2010-08-10 02:20:33 -0700
commit41fb4cd560fd0f915cc0d1a3766b6a642fab58cd (patch)
tree6c007f211016661cf7f99f65619eb6650ed22721
parentf0dda1c747d058f69f079017c626977e6f26dafc (diff)
downloadportage-41fb4cd560fd0f915cc0d1a3766b6a642fab58cd.tar.gz
portage-41fb4cd560fd0f915cc0d1a3766b6a642fab58cd.tar.bz2
portage-41fb4cd560fd0f915cc0d1a3766b6a642fab58cd.zip
Pretend that the current user's uid/gid are the 'portage' uid/gid,
so things go smoothly regardless of the current user and global user/group configuration.
-rwxr-xr-xpym/portage/tests/runTests7
1 files changed, 7 insertions, 0 deletions
diff --git a/pym/portage/tests/runTests b/pym/portage/tests/runTests
index a6f3b8f1c..9600f12a7 100755
--- a/pym/portage/tests/runTests
+++ b/pym/portage/tests/runTests
@@ -5,6 +5,13 @@
import os, sys
import os.path as osp
+import grp
+
+# Pretend that the current user's uid/gid are the 'portage' uid/gid,
+# so things go smoothly regardless of the current user and global
+# user/group configuration.
+os.environ["PORTAGE_USERNAME"] = os.getlogin()
+os.environ["PORTAGE_GRPNAME"] = grp.getgrgid(os.getgid()).gr_name
# Insert our parent dir so we can do shiny import "tests"
# This line courtesy of Marienz and Pkgcore ;)