public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/portage:master commit in: pym/portage/tests/emerge/, pym/portage/tests/repoman/
@ 2011-08-29  7:23 Zac Medico
  0 siblings, 0 replies; 4+ messages in thread
From: Zac Medico @ 2011-08-29  7:23 UTC (permalink / raw
  To: gentoo-commits

commit:     9b3263f03f23eae1f88c03cd78a4fd05f1e2db68
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Aug 29 07:23:13 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Aug 29 07:23:13 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=9b3263f0

Fix env interference in emerge/repoman tests.

---
 pym/portage/tests/emerge/test_simple.py  |   14 ++++++++------
 pym/portage/tests/repoman/test_simple.py |   27 ++++++++++++++++++---------
 2 files changed, 26 insertions(+), 15 deletions(-)

diff --git a/pym/portage/tests/emerge/test_simple.py b/pym/portage/tests/emerge/test_simple.py
index a13d0e6..2aca3e3 100644
--- a/pym/portage/tests/emerge/test_simple.py
+++ b/pym/portage/tests/emerge/test_simple.py
@@ -74,9 +74,8 @@ class SimpleEmergeTestCase(TestCase):
 		portage_tmpdir = os.path.join(eprefix, "var", "tmp", "portage")
 		profile_path = settings.profile_path
 		var_cache_edb = os.path.join(eprefix, "var", "cache", "edb")
-		env = os.environ.copy()
 
-		path = env.get("PATH")
+		path =  os.environ.get("PATH")
 		if path is not None and not path.strip():
 			path = None
 		if path is None:
@@ -85,7 +84,7 @@ class SimpleEmergeTestCase(TestCase):
 			path = ":" + path
 		path = fake_bin + path
 
-		pythonpath = env.get("PYTHONPATH")
+		pythonpath =  os.environ.get("PYTHONPATH")
 		if pythonpath is not None and not pythonpath.strip():
 			pythonpath = None
 		if pythonpath is not None and \
@@ -98,15 +97,18 @@ class SimpleEmergeTestCase(TestCase):
 				pythonpath = ":" + pythonpath
 			pythonpath = PORTAGE_PYM_PATH + pythonpath
 
-		env['PYTHONPATH'] = pythonpath
-		env.update({
+		env = {
 			"__PORTAGE_TEST_EPREFIX" : eprefix,
 			"DISTDIR" : distdir,
 			"INFODIR" : "",
 			"INFOPATH" : "",
 			"PATH" : path,
+			"PORTAGE_GRPNAME" : os.environ["PORTAGE_GRPNAME"],
 			"PORTAGE_TMPDIR" : portage_tmpdir,
-		})
+			"PORTAGE_USERNAME" : os.environ["PORTAGE_USERNAME"],
+			"PYTHONPATH" : pythonpath,
+		}
+
 		dirs = [distdir, fake_bin, portage_tmpdir, var_cache_edb]
 		true_symlinks = ["chown", "chgrp"]
 		true_binary = find_binary("true")

diff --git a/pym/portage/tests/repoman/test_simple.py b/pym/portage/tests/repoman/test_simple.py
index b156789..ba50147 100644
--- a/pym/portage/tests/repoman/test_simple.py
+++ b/pym/portage/tests/repoman/test_simple.py
@@ -112,21 +112,30 @@ class SimpleRepomanTestCase(TestCase):
 		portdir = settings["PORTDIR"]
 		profiles_dir = os.path.join(portdir, "profiles")
 		license_dir = os.path.join(portdir, "licenses")
-		env = os.environ.copy()
-		pythonpath = env.get("PYTHONPATH")
+
+		pythonpath =  os.environ.get("PYTHONPATH")
 		if pythonpath is not None and not pythonpath.strip():
 			pythonpath = None
-		if pythonpath is None:
-			pythonpath = ""
+		if pythonpath is not None and \
+			pythonpath.startswith(PORTAGE_PYM_PATH + ":"):
+			pass
 		else:
-			pythonpath = ":" + pythonpath
-		pythonpath = PORTAGE_PYM_PATH + pythonpath
-		env['PYTHONPATH'] = pythonpath
-		env.update({
+			if pythonpath is None:
+				pythonpath = ""
+			else:
+				pythonpath = ":" + pythonpath
+			pythonpath = PORTAGE_PYM_PATH + pythonpath
+
+		env = {
 			"__REPOMAN_TEST_EPREFIX" : eprefix,
 			"DISTDIR" : distdir,
+			"PATH" : os.environ["PATH"],
+			"PORTAGE_GRPNAME" : os.environ["PORTAGE_GRPNAME"],
+			"PORTAGE_USERNAME" : os.environ["PORTAGE_USERNAME"],
 			"PORTDIR" : portdir,
-		})
+			"PYTHONPATH" : pythonpath,
+		}
+
 		dirs = [license_dir, profiles_dir, distdir]
 		try:
 			for d in dirs:



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/portage/tests/emerge/, pym/portage/tests/repoman/
@ 2011-08-30 18:27 Zac Medico
  0 siblings, 0 replies; 4+ messages in thread
From: Zac Medico @ 2011-08-30 18:27 UTC (permalink / raw
  To: gentoo-commits

commit:     a69782c5177e47da66bb500f4c83380d7ba4add2
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Aug 30 18:27:24 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Aug 30 18:27:24 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=a69782c5

Tweak PYTHONPATH check in emerge/repoman tests.

---
 pym/portage/tests/emerge/test_simple.py  |    2 +-
 pym/portage/tests/repoman/test_simple.py |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/pym/portage/tests/emerge/test_simple.py b/pym/portage/tests/emerge/test_simple.py
index c8f150a..971193f 100644
--- a/pym/portage/tests/emerge/test_simple.py
+++ b/pym/portage/tests/emerge/test_simple.py
@@ -91,7 +91,7 @@ class SimpleEmergeTestCase(TestCase):
 		if pythonpath is not None and not pythonpath.strip():
 			pythonpath = None
 		if pythonpath is not None and \
-			pythonpath.startswith(PORTAGE_PYM_PATH + ":"):
+			pythonpath.split(":")[0] == PORTAGE_PYM_PATH:
 			pass
 		else:
 			if pythonpath is None:

diff --git a/pym/portage/tests/repoman/test_simple.py b/pym/portage/tests/repoman/test_simple.py
index ba50147..bfc32fc 100644
--- a/pym/portage/tests/repoman/test_simple.py
+++ b/pym/portage/tests/repoman/test_simple.py
@@ -117,7 +117,7 @@ class SimpleRepomanTestCase(TestCase):
 		if pythonpath is not None and not pythonpath.strip():
 			pythonpath = None
 		if pythonpath is not None and \
-			pythonpath.startswith(PORTAGE_PYM_PATH + ":"):
+			pythonpath.split(":")[0] == PORTAGE_PYM_PATH:
 			pass
 		else:
 			if pythonpath is None:



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/portage/tests/emerge/, pym/portage/tests/repoman/
@ 2011-08-30 19:23 Zac Medico
  0 siblings, 0 replies; 4+ messages in thread
From: Zac Medico @ 2011-08-30 19:23 UTC (permalink / raw
  To: gentoo-commits

commit:     4bbfe6241ec7a4d286a1e8b3074c9dde0de4f2ea
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Aug 30 19:22:51 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Aug 30 19:22:51 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=4bbfe624

Tweak failure msgs in emerge/repoman tests.

---
 pym/portage/tests/emerge/test_simple.py  |    3 ++-
 pym/portage/tests/repoman/test_simple.py |    7 ++++---
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/pym/portage/tests/emerge/test_simple.py b/pym/portage/tests/emerge/test_simple.py
index 971193f..b698fca 100644
--- a/pym/portage/tests/emerge/test_simple.py
+++ b/pym/portage/tests/emerge/test_simple.py
@@ -140,6 +140,7 @@ class SimpleEmergeTestCase(TestCase):
 					for line in output:
 						sys.stderr.write(_unicode_decode(line))
 
-				self.assertEqual(os.EX_OK, proc.returncode, "emerge failed")
+				self.assertEqual(os.EX_OK, proc.returncode,
+					"emerge failed with args %s" % (args,))
 		finally:
 			playground.cleanup()

diff --git a/pym/portage/tests/repoman/test_simple.py b/pym/portage/tests/repoman/test_simple.py
index bfc32fc..35290f6 100644
--- a/pym/portage/tests/repoman/test_simple.py
+++ b/pym/portage/tests/repoman/test_simple.py
@@ -158,10 +158,10 @@ class SimpleRepomanTestCase(TestCase):
 			# order to ensure that the CTIME is current
 			shutil.copyfile(metadata_dtd, os.path.join(distdir, "metadata.dtd"))
 			for cwd in ("", "dev-libs", "dev-libs/A", "dev-libs/B"):
-				cwd = os.path.join(portdir, cwd)
+				abs_cwd = os.path.join(portdir, cwd)
 				proc = subprocess.Popen([portage._python_interpreter, "-Wd",
 					os.path.join(PORTAGE_BIN_PATH, "repoman"), "full"],
-					cwd=cwd, env=env, stdout=subprocess.PIPE)
+					cwd=abs_cwd, env=env, stdout=subprocess.PIPE)
 				output = proc.stdout.readlines()
 				proc.wait()
 				proc.stdout.close()
@@ -169,6 +169,7 @@ class SimpleRepomanTestCase(TestCase):
 					for line in output:
 						sys.stderr.write(_unicode_decode(line))
 
-				self.assertEqual(os.EX_OK, proc.returncode, "repoman failed")
+				self.assertEqual(os.EX_OK, proc.returncode,
+					"repoman failed in %s" % (cwd,))
 		finally:
 			playground.cleanup()



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/portage/tests/emerge/, pym/portage/tests/repoman/
@ 2011-12-11 21:00 Zac Medico
  0 siblings, 0 replies; 4+ messages in thread
From: Zac Medico @ 2011-12-11 21:00 UTC (permalink / raw
  To: gentoo-commits

commit:     bffe72d567e2d4d4235ad45177fbec04da5260fa
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Dec 11 21:00:28 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Dec 11 21:00:28 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=bffe72d5

Don't nest sandbox in emerge/repoman tests.

---
 pym/portage/tests/emerge/test_simple.py  |    3 ++-
 pym/portage/tests/repoman/test_simple.py |    4 ++++
 2 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/pym/portage/tests/emerge/test_simple.py b/pym/portage/tests/emerge/test_simple.py
index 5177229..a3efa62 100644
--- a/pym/portage/tests/emerge/test_simple.py
+++ b/pym/portage/tests/emerge/test_simple.py
@@ -267,7 +267,8 @@ pkg_preinst() {
 		user_config_dir = os.path.join(os.sep, eprefix, USER_CONFIG_PATH)
 
 		features = []
-		if not portage.process.sandbox_capable:
+		if not portage.process.sandbox_capable or \
+			os.environ.get("SANDBOX_ON") == "1":
 			features.append("-sandbox")
 
 		# Since egencache ignores settings from the calling environment,

diff --git a/pym/portage/tests/repoman/test_simple.py b/pym/portage/tests/repoman/test_simple.py
index 3643ff2..eab06d9 100644
--- a/pym/portage/tests/repoman/test_simple.py
+++ b/pym/portage/tests/repoman/test_simple.py
@@ -196,6 +196,10 @@ class SimpleRepomanTestCase(TestCase):
 			"PYTHONPATH" : pythonpath,
 		}
 
+		if os.environ.get("SANDBOX_ON") == "1":
+			# avoid problems from nested sandbox instances
+			env["FEATURES"] = "-sandbox"
+
 		dirs = [homedir, license_dir, profiles_dir, distdir]
 		try:
 			for d in dirs:



^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-12-11 21:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-30 19:23 [gentoo-commits] proj/portage:master commit in: pym/portage/tests/emerge/, pym/portage/tests/repoman/ Zac Medico
  -- strict thread matches above, loose matches on Subject: below --
2011-12-11 21:00 Zac Medico
2011-08-30 18:27 Zac Medico
2011-08-29  7:23 Zac Medico

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox