Skip to content

Commit

Permalink
CA-212813: Fix NFS attach unit test
Browse files Browse the repository at this point in the history
Changed unit test to reflect changes made for CA-207783 (PR 305)

Signed-off-by: Chandrika Srinivasan <chandrika.srinivasan@citrix.com>
Reviewed-by: Mark Syms <mark.syms@citrix.com>

GitHub: closes #316
  • Loading branch information
chandrikas committed Jun 8, 2016
1 parent 739d99f commit 40c7963
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions tests/test_NFSSR.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,16 @@ def __init__(self, srcmd, none):
class TestNFSSR(unittest.TestCase):

def create_nfssr(self, server='aServer', serverpath='/aServerpath',
sr_uuid='asr_uuid', nfsversion=None):
sr_uuid='asr_uuid', nfsversion=None, useroptions=''):
srcmd = mock.Mock()
srcmd.dconf = {
'server': server,
'serverpath': serverpath
}
if nfsversion:
srcmd.dconf.update({'nfsversion': nfsversion})
if useroptions:
srcmd.dconf.update({'options': useroptions})
srcmd.params = {
'command': 'some_command',
'device_config': {}
Expand Down Expand Up @@ -72,7 +74,7 @@ def test_attach(self, validate_nfsversion, check_server_tcp, _testhost,
soft_mount, Lock, makedirs):
validate_nfsversion.return_value = "aNfsversionChanged"
nfssr = self.create_nfssr(server='aServer', serverpath='/aServerpath',
sr_uuid='UUID')
sr_uuid='UUID', useroptions='options')

nfssr.attach(None)

Expand All @@ -82,5 +84,6 @@ def test_attach(self, validate_nfsversion, check_server_tcp, _testhost,
'aServer',
'/aServerpath/UUID',
'tcp',
useroptions='options',
timeout=0,
nfsversion='aNfsversionChanged')

0 comments on commit 40c7963

Please sign in to comment.