def test_get_supported_nfs_versions(self, pread2): pread2.side_effect = [ " 100003 4,3,2 udp6,tcp6,udp,tcp nfs superuser" ] versions = nfs.get_supported_nfs_versions('aServer') self.assertEqual(versions, ['3', '4']) self.assertEqual(len(pread2.mock_calls), 1) pread2.assert_called_with(['/usr/sbin/rpcinfo', '-s', 'aServer'])
def check_server(self): try: if self.dconf.has_key(PROBEVERSION): sv = nfs.get_supported_nfs_versions(self.remoteserver) if len(sv): self.nfsversion = sv[0] else: nfs.check_server_tcp(self.remoteserver, self.nfsversion) except nfs.NfsException, exc: raise xs_errors.XenError('NFSVersion', opterr=exc.errstr)