"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "manila/tests/share/drivers/test_helpers.py" between
manila-8.1.3.tar.gz and manila-8.1.4.tar.gz

About: OpenStack Manila provides “Shared Filesystems as a service”.
The "Stein" series (maintained release).

test_helpers.py  (manila-8.1.3):test_helpers.py  (manila-8.1.4)
skipping to change at line 216 skipping to change at line 216
'2.2.2.2', 'fake_level', access_type='ip'), ] '2.2.2.2', 'fake_level', access_type='ip'), ]
self.assertRaises( self.assertRaises(
exception.InvalidShareAccessLevel, exception.InvalidShareAccessLevel,
self._helper.update_access, self._helper.update_access,
self.server, self.server,
self.share_name, self.share_name,
access_rules, access_rules,
[], [],
[]) [])
def test_update_access_delete_invalid_rule(self): @ddt.data({'access_to': 'lala', 'access_type': 'user'},
delete_rules = [test_generic.get_fake_access_rule( {'access_to': '203.0.113.29'},
'lala', 'fake_level', access_type='user'), ] {'access_to': '2001:0DB8:7d18:c63e:5f0a:871f:83b8:d244',
'access_level': 'ro'})
@ddt.unpack
def test_update_access_delete_invalid_rule(
self, access_to, access_level='rw', access_type='ip'):
mount_path = '%s:/shares/%s' % (access_to, self.share_name)
if access_type == 'ip':
self._helper._get_parsed_address_or_cidr = mock.Mock(
return_value=access_to)
not_found_msg = (
"exportfs: Could not find '%s' to unexport.\n" % mount_path
)
exc = exception.ProcessExecutionError
self.mock_object(
self._helper,
'_ssh_exec',
mock.Mock(side_effect=[(0, 0), exc(stderr=not_found_msg)]))
delete_rules = [
test_generic.get_fake_access_rule(access_to,
access_level,
access_type),
]
self.mock_object(self._helper, '_sync_nfs_temp_and_perm_files') self.mock_object(self._helper, '_sync_nfs_temp_and_perm_files')
self._helper.update_access(self.server, self.share_name, [], self._helper.update_access(self.server, self.share_name, [],
[], delete_rules) [], delete_rules)
if access_type == 'ip':
self._helper._ssh_exec.assert_has_calls([
mock.call(self.server, ['sudo', 'exportfs']),
mock.call(self.server,
['sudo', 'exportfs', '-u', mount_path])])
self._helper._sync_nfs_temp_and_perm_files.assert_called_with( self._helper._sync_nfs_temp_and_perm_files.assert_called_with(
self.server) self.server)
def test_get_host_list(self): def test_get_host_list(self):
fake_exportfs = ('/shares/share-1\n\t\t20.0.0.3\n' fake_exportfs = ('/shares/share-1\n\t\t20.0.0.3\n'
'/shares/share-1\n\t\t20.0.0.6\n' '/shares/share-1\n\t\t20.0.0.6\n'
'/shares/share-2\n\t\t10.0.0.2\n' '/shares/share-2\n\t\t10.0.0.2\n'
'/shares/share-2\n\t\t10.0.0.5\n' '/shares/share-2\n\t\t10.0.0.5\n'
'/shares/share-3\n\t\t30.0.0.4\n' '/shares/share-3\n\t\t30.0.0.4\n'
'/shares/share-3\n\t\t30.0.0.7\n') '/shares/share-3\n\t\t30.0.0.7\n')
 End of changes. 3 change blocks. 
3 lines changed or deleted 32 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)