volume['provider_location'] = self.TEST_NFS_EXPORT1
volume['name'] = 'volume-123'
- self.assertEqual('/mnt/test/12118957640568004265/volume-123',
- drv.local_path(volume))
+ self.assertEqual(
+ '/mnt/test/2f4f60214cf43c595666dd815f0360a4/volume-123',
+ drv.local_path(volume))
def test_mount_nfs_should_mount_correctly(self):
"""_mount_nfs common case usage"""
"""_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):
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):
import os
import errno
-import ctypes
+import hashlib
from cinder import flags
from cinder.openstack.common import cfg
def _get_hash_str(self, base_str):
"""returns string that represents hash of base_str (in a hex format)"""
- return str(ctypes.c_uint64(hash(base_str)).value)
+ return hashlib.md5(base_str).hexdigest()