From 1fe8e4327b15f8933efef185d09b6067d1f28716 Mon Sep 17 00:00:00 2001 From: Clay Gerrard Date: Fri, 18 Sep 2015 13:54:52 -0700 Subject: [PATCH] Fix recon tests on SAIO with multiple policies Recon middleware used to only look on rings that exist on disk when it was started, so if a test didn't create a ring in the temp swift_dir it can expect the middleware to not report it. However, after we started looking at policies to determine rings [1] - we need to be more careful to patch policies to match up with the test requirements. On development environments with only the legacy default polices the existing recon tests were passing by accident - but not in my environment. This change will patch policies for the TestCase so that tests will pass for me. Individual test methods that have more specific policy requirements for the test can continue to @patch_policies just for those tests but in general the existing test_methods all seem to expect legacy policies - so we just make the default for the TestCase legacy_only. Change-Id: I778a0a59091ca8870e1cab985f3ec426eb045ab7 --- test/unit/common/middleware/test_recon.py | 1 + 1 file changed, 1 insertion(+) diff --git a/test/unit/common/middleware/test_recon.py b/test/unit/common/middleware/test_recon.py index ce4827e3c0..1dedec688c 100644 --- a/test/unit/common/middleware/test_recon.py +++ b/test/unit/common/middleware/test_recon.py @@ -193,6 +193,7 @@ class FakeRecon(object): raise Exception +@patch_policies(legacy_only=True) class TestReconSuccess(TestCase): def setUp(self):