NetApp cDOT multi-SVM driver should not start with cDOT 8.3

The multi-SVM cDOT driver that ships with Kilo does not support the
8.3 cDOT release.  The driver should fail fast if 8.3 is detected.

Change-Id: Iac7bafd101f0b0ad190a49cd2bba79bd25dee028
Related-Bug: #1425754
Closes-Bug: #1433872
This commit is contained in:
Clinton Knight 2015-03-18 22:11:33 -04:00
parent 725a9ced55
commit eec09463db
2 changed files with 30 additions and 0 deletions

View File

@ -43,6 +43,8 @@ class NetAppCmodeMultiSVMFileStorageLibrary(
@na_utils.trace
def check_for_setup_error(self):
self._check_data_ontap_version()
if self._have_cluster_creds:
if self.configuration.netapp_vserver:
msg = _LW('Vserver is specified in the configuration. This is '
@ -57,6 +59,17 @@ class NetAppCmodeMultiSVMFileStorageLibrary(
super(NetAppCmodeMultiSVMFileStorageLibrary, self).\
check_for_setup_error()
def _check_data_ontap_version(self):
# Temporary check to indicate that the Kilo multi-SVM driver does not
# support cDOT 8.3 or higher.
ontapi_version = self._client.get_ontapi_version()
if ontapi_version >= (1, 30):
msg = _('Clustered Data ONTAP 8.3.0 or higher is not '
'supported by this version of the driver when the '
'configuration option driver_handles_share_servers '
'is set to True.')
raise exception.NetAppException(msg)
@na_utils.trace
def _get_vserver(self, share_server=None):

View File

@ -17,6 +17,7 @@ Unit tests for the NetApp Data ONTAP cDOT multi-SVM storage driver library.
import copy
import ddt
import mock
from oslo_log import log
@ -30,6 +31,7 @@ from manila import test
from manila.tests.share.drivers.netapp.dataontap import fakes as fake
@ddt.ddt
class NetAppFileStorageLibraryTestCase(test.TestCase):
def setUp(self):
@ -55,16 +57,20 @@ class NetAppFileStorageLibraryTestCase(test.TestCase):
self.library = lib_multi_svm.NetAppCmodeMultiSVMFileStorageLibrary(
self.mock_db, fake.DRIVER_NAME, **kwargs)
self.library._client = mock.Mock()
self.library._client.get_ontapi_version.return_value = (1, 21)
self.client = self.library._client
self.context = mock.Mock()
def test_check_for_setup_error_cluster_creds_no_vserver(self):
self.library._have_cluster_creds = True
mock_check_data_ontap_version = self.mock_object(
self.library, '_check_data_ontap_version')
mock_super = self.mock_object(lib_base.NetAppCmodeFileStorageLibrary,
'check_for_setup_error')
self.library.check_for_setup_error()
self.assertTrue(mock_check_data_ontap_version.called)
mock_super.assert_called_once_with()
def test_check_for_setup_error_cluster_creds_with_vserver(self):
@ -84,6 +90,17 @@ class NetAppFileStorageLibraryTestCase(test.TestCase):
self.assertRaises(exception.InvalidInput,
self.library.check_for_setup_error)
@ddt.data((1, 20), (1, 21))
def test_check_data_ontap_version(self, version):
self.library._client.get_ontapi_version.return_value = version
self.assertIsNone(self.library._check_data_ontap_version())
@ddt.data((1, 30), (1, 31), (1, 40), (2, 0))
def test_check_data_ontap_version_too_new(self, version):
self.library._client.get_ontapi_version.return_value = version
self.assertRaises(exception.NetAppException,
self.library._check_data_ontap_version)
def test_get_vserver_no_share_server(self):
self.assertRaises(exception.NetAppException,