summaryrefslogtreecommitdiffstats
path: root/pym/portage/tests/dbapi
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2012-09-07 21:32:03 -0700
committerZac Medico <zmedico@gentoo.org>2012-09-07 21:32:03 -0700
commit24b7ebe3b9404f0344f5b34eb322abde64143263 (patch)
tree2c5744e66faa0a1b16819695fd22a6a4f01a3a37 /pym/portage/tests/dbapi
parentc35ec6c074f44ffbf7849c54976c91ce5a53e8fe (diff)
downloadportage-24b7ebe3b9404f0344f5b34eb322abde64143263.tar.gz
portage-24b7ebe3b9404f0344f5b34eb322abde64143263.tar.bz2
portage-24b7ebe3b9404f0344f5b34eb322abde64143263.zip
Detect md5-cache when no cache-formats specified.
Auto-detect cache-formats from the corresponding directories when cache-formats is not specifed in layout.conf, and prefer md5-dict if available. After this behavior is deployed in stable portage, the default egencache format can be changed to md5-dict.
Diffstat (limited to 'pym/portage/tests/dbapi')
-rw-r--r--pym/portage/tests/dbapi/test_portdb_cache.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/pym/portage/tests/dbapi/test_portdb_cache.py b/pym/portage/tests/dbapi/test_portdb_cache.py
index e6d2ba7c9..4a0129b3e 100644
--- a/pym/portage/tests/dbapi/test_portdb_cache.py
+++ b/pym/portage/tests/dbapi/test_portdb_cache.py
@@ -96,6 +96,21 @@ class PortdbCacheTestCase(TestCase):
if not isinstance(portage.portdb._pregen_auxdb[portage.portdb.porttree_root], pms_database):
sys.exit(1)
"""),),
+
+ # Test auto-detection and preference for md5-cache when both
+ # cache formats are available but layout.conf is absent.
+ (BASH_BINARY, "-c", "rm %s" % portage._shell_quote(layout_conf_path)),
+ python_cmd + (textwrap.dedent("""
+ import os, sys, portage
+ if portage.portdb.porttree_root not in portage.portdb._pregen_auxdb:
+ sys.exit(1)
+ """),),
+ python_cmd + (textwrap.dedent("""
+ import os, sys, portage
+ from portage.cache.flat_hash import md5_database
+ if not isinstance(portage.portdb._pregen_auxdb[portage.portdb.porttree_root], md5_database):
+ sys.exit(1)
+ """),),
)
features = []