diff options
author | Jenkins <jenkins@review.openstack.org> | 2013-01-08 07:11:55 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2013-01-08 07:11:55 +0000 |
commit | 50cd91fd1ab09c7b2a234d98221024e132f761fd (patch) | |
tree | e65ecf59942cd235d86d1dd61ca677e02333e6ca /nova | |
parent | 0fc1e10d40c5680d0790aadc5b6c8aaf5ef2da88 (diff) | |
parent | 7224fde0f0d6206136b411276f8ee8bce8749dd1 (diff) | |
download | nova-50cd91fd1ab09c7b2a234d98221024e132f761fd.tar.gz nova-50cd91fd1ab09c7b2a234d98221024e132f761fd.tar.xz nova-50cd91fd1ab09c7b2a234d98221024e132f761fd.zip |
Merge "Invert test stream capture logic for debugging."
Diffstat (limited to 'nova')
-rw-r--r-- | nova/test.py | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/nova/test.py b/nova/test.py index 7ae58314b..b3f851dc4 100644 --- a/nova/test.py +++ b/nova/test.py @@ -189,17 +189,23 @@ class TestCase(testtools.TestCase): def setUp(self): """Run before each test method to initialize test environment.""" super(TestCase, self).setUp() - # Give each test a maximum of one minute to run. - self.useFixture(fixtures.Timeout(60, gentle=True)) + test_timeout = os.environ.get('OS_TEST_TIMEOUT', 0) + try: + test_timeout = int(test_timeout) + except ValueError: + # If timeout value is invalid do not set a timeout. + test_timeout = 0 + if test_timeout > 0: + self.useFixture(fixtures.Timeout(test_timeout, gentle=True)) self.useFixture(fixtures.NestedTempfile()) self.useFixture(fixtures.TempHomeDir()) - if (os.environ.get('OS_STDOUT_NOCAPTURE') != 'True' and - os.environ.get('OS_STDOUT_NOCAPTURE') != '1'): + if (os.environ.get('OS_STDOUT_CAPTURE') == 'True' or + os.environ.get('OS_STDOUT_CAPTURE') == '1'): stdout = self.useFixture(fixtures.StringStream('stdout')).stream self.useFixture(fixtures.MonkeyPatch('sys.stdout', stdout)) - if (os.environ.get('OS_STDERR_NOCAPTURE') != 'True' and - os.environ.get('OS_STDERR_NOCAPTURE') != '1'): + if (os.environ.get('OS_STDERR_CAPTURE') == 'True' or + os.environ.get('OS_STDERR_CAPTURE') == '1'): stderr = self.useFixture(fixtures.StringStream('stderr')).stream self.useFixture(fixtures.MonkeyPatch('sys.stderr', stderr)) |