]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Tests: Remove randomness from NFS mount tests
authorEric Harney <eharney@redhat.com>
Fri, 13 Feb 2015 16:56:48 +0000 (11:56 -0500)
committerEric Harney <eharney@redhat.com>
Fri, 13 Feb 2015 16:58:16 +0000 (11:58 -0500)
No real reason for this to be randomized... just
set the number of attempts to 3 for simplicity /
reproducibility.

Change-Id: I0f11a157359f8905105194059c1ea68ce9f1860c

cinder/tests/test_nfs.py

index 91886eafde32fc642ad373b323abc490ed539925..40d950f9f63dabef01f2610398ec66fb62af39fe 100644 (file)
@@ -16,7 +16,6 @@
 
 import errno
 import os
-import random
 
 import mock
 import mox as mox_lib
@@ -1082,10 +1081,9 @@ class NfsDriverTestCase(test.TestCase):
     def test_ensure_share_mounted(self):
         """Case where the mount works the first time."""
 
-        num_attempts = random.randint(1, 5)
         self.mock_object(self._driver._remotefsclient, 'mount')
         drv = self._driver
-        drv.configuration.nfs_mount_attempts = num_attempts
+        drv.configuration.nfs_mount_attempts = 3
         drv.shares = {self.TEST_NFS_EXPORT1: ''}
 
         drv._ensure_share_mounted(self.TEST_NFS_EXPORT1)
@@ -1095,7 +1093,8 @@ class NfsDriverTestCase(test.TestCase):
     def test_ensure_share_mounted_exception(self):
         """Make the configured number of attempts when mounts fail."""
 
-        num_attempts = random.randint(1, 5)
+        num_attempts = 3
+
         self.mock_object(self._driver._remotefsclient, 'mount',
                          mock.Mock(side_effect=Exception))
         drv = self._driver