'do_setup should throw error if nfs client is not installed.'

def test_setup_should_throw_exception_if_nfs_client_is_not_installed(self):

    drv = nfs.NfsDriver(configuration=self.configuration)
    mock_os_path_exists = self.mock_object(os.path, 'exists')
    mock_os_path_exists.return_value = True
    mock_execute = self.mock_object(drv, '_execute')
    mock_execute.side_effect = OSError(errno.ENOENT, 'No    such    file    or    directory.')
    with self.assertRaisesRegex(exception.NfsException, 'mount.nfs    is    not    installed'):
        drv.do_setup(self.context)
    mock_os_path_exists.assert_has_calls([mock.call(self.configuration.nfs_shares_config)])
    mock_execute.assert_has_calls([mock.call('mount.nfs', check_exit_code=False, run_as_root=True)])
