Replace builtin hash with MD5 to solve 32/64-bit issues.

It seems that Python's builtin hash returns different
values on 32-bit and 64-bit architectures, so it's
safer to use a well-defined hash like MD5.

bug 1050359

Change-Id: Ibb49f7b9028085d2aedaf05b94e1e1dcdf5e4cb4
This commit is contained in:
Ben Swartzlander
2012-09-19 17:30:22 -04:00
parent 0917d2c884
commit c312819b0f

View File

@@ -109,7 +109,8 @@ class NfsDriverTestCase(test.TestCase):
volume['provider_location'] = self.TEST_NFS_EXPORT1
volume['name'] = 'volume-123'
self.assertEqual('/mnt/test/12118957640568004265/volume-123',
self.assertEqual(
'/mnt/test/2f4f60214cf43c595666dd815f0360a4/volume-123',
drv.local_path(volume))
def test_mount_nfs_should_mount_correctly(self):
@@ -212,7 +213,7 @@ class NfsDriverTestCase(test.TestCase):
"""_get_hash_str should calculation correct value"""
drv = self._driver
self.assertEqual('12118957640568004265',
self.assertEqual('2f4f60214cf43c595666dd815f0360a4',
drv._get_hash_str(self.TEST_NFS_EXPORT1))
def test_get_mount_point_for_share(self):
@@ -221,7 +222,7 @@ class NfsDriverTestCase(test.TestCase):
nfs.FLAGS.nfs_mount_point_base = self.TEST_MNT_POINT_BASE
self.assertEqual('/mnt/test/12118957640568004265',
self.assertEqual('/mnt/test/2f4f60214cf43c595666dd815f0360a4',
drv._get_mount_point_for_share(self.TEST_NFS_EXPORT1))
def test_get_available_capacity_with_df(self):