QNAP: Add support for QES 2.1.0
This patch do the following change to the QNAP Manila driver: 1. Add support for QNAP QES firmware 2.1.0. Change-Id: I81320b6af988d19526241fd0856b427fcf1f96d7 Implements: blueprint qnap-support-qes-210
This commit is contained in:
parent
675f66d341
commit
a8ccc1ac12
@ -73,9 +73,10 @@ class QnapShareDriver(driver.ShareDriver):
|
||||
1.0.4 - Add support for QES fw 2.0.0.
|
||||
1.0.5 - Fix bug #1773761, when user tries to manage share, the size
|
||||
of managed share should not be changed.
|
||||
1.0.6 - Add support for QES fw 2.1.0.
|
||||
"""
|
||||
|
||||
DRIVER_VERSION = '1.0.5'
|
||||
DRIVER_VERSION = '1.0.6'
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
"""Initialize QnapShareDriver."""
|
||||
@ -164,14 +165,14 @@ class QnapShareDriver(driver.ShareDriver):
|
||||
username=self.configuration.qnap_nas_login,
|
||||
password=self.configuration.qnap_nas_password,
|
||||
management_url=self.configuration.qnap_management_url)
|
||||
elif "1.1.2" <= fw_version <= "2.0.9999":
|
||||
elif "1.1.2" <= fw_version <= "2.1.9999":
|
||||
LOG.debug('Create ES API Executor')
|
||||
return api.QnapAPIExecutor(
|
||||
username=self.configuration.qnap_nas_login,
|
||||
password=self.configuration.qnap_nas_password,
|
||||
management_url=self.configuration.qnap_management_url)
|
||||
elif model_type in es_model_types:
|
||||
if "1.1.2" <= fw_version <= "2.0.9999":
|
||||
if "1.1.2" <= fw_version <= "2.1.9999":
|
||||
LOG.debug('Create ES API Executor')
|
||||
return api.QnapAPIExecutor(
|
||||
username=self.configuration.qnap_nas_login,
|
||||
|
@ -41,6 +41,39 @@ FAKE_RES_DETAIL_DATA_GETBASIC_INFO_ES_1_1_3 = """
|
||||
</firmware>
|
||||
</QDocRoot>"""
|
||||
|
||||
FAKE_RES_DETAIL_DATA_GETBASIC_INFO_ES_2_0_0 = """
|
||||
<QDocRoot version="1.0">
|
||||
<model>
|
||||
<displayModelName><![CDATA[ES1640dc]]></displayModelName>
|
||||
<internalModelName><![CDATA[ES1640dc]]></internalModelName>
|
||||
</model>
|
||||
<firmware>
|
||||
<version><![CDATA[2.0.0]]></version>
|
||||
</firmware>
|
||||
</QDocRoot>"""
|
||||
|
||||
FAKE_RES_DETAIL_DATA_GETBASIC_INFO_ES_2_1_0 = """
|
||||
<QDocRoot version="1.0">
|
||||
<model>
|
||||
<displayModelName><![CDATA[ES1640dc]]></displayModelName>
|
||||
<internalModelName><![CDATA[ES1640dc]]></internalModelName>
|
||||
</model>
|
||||
<firmware>
|
||||
<version><![CDATA[2.1.0]]></version>
|
||||
</firmware>
|
||||
</QDocRoot>"""
|
||||
|
||||
FAKE_RES_DETAIL_DATA_GETBASIC_INFO_ES_2_2_0 = """
|
||||
<QDocRoot version="1.0">
|
||||
<model>
|
||||
<displayModelName><![CDATA[ES1640dc]]></displayModelName>
|
||||
<internalModelName><![CDATA[ES1640dc]]></internalModelName>
|
||||
</model>
|
||||
<firmware>
|
||||
<version><![CDATA[2.2.0]]></version>
|
||||
</firmware>
|
||||
</QDocRoot>"""
|
||||
|
||||
FAKE_RES_DETAIL_DATA_GETBASIC_INFO_TS_4_0_0 = """
|
||||
<QDocRoot version="1.0">
|
||||
<model>
|
||||
@ -107,6 +140,39 @@ FAKE_RES_DETAIL_DATA_GETBASIC_INFO_TES_ES_1_1_3 = """
|
||||
</firmware>
|
||||
</QDocRoot>"""
|
||||
|
||||
FAKE_RES_DETAIL_DATA_GETBASIC_INFO_TES_ES_2_0_0 = """
|
||||
<QDocRoot version="1.0">
|
||||
<model>
|
||||
<displayModelName><![CDATA[TES-1885U]]></displayModelName>
|
||||
<internalModelName><![CDATA[ES-1885U]]></internalModelName>
|
||||
</model>
|
||||
<firmware>
|
||||
<version><![CDATA[2.0.0]]></version>
|
||||
</firmware>
|
||||
</QDocRoot>"""
|
||||
|
||||
FAKE_RES_DETAIL_DATA_GETBASIC_INFO_TES_ES_2_1_0 = """
|
||||
<QDocRoot version="1.0">
|
||||
<model>
|
||||
<displayModelName><![CDATA[TES-1885U]]></displayModelName>
|
||||
<internalModelName><![CDATA[ES-1885U]]></internalModelName>
|
||||
</model>
|
||||
<firmware>
|
||||
<version><![CDATA[2.1.0]]></version>
|
||||
</firmware>
|
||||
</QDocRoot>"""
|
||||
|
||||
FAKE_RES_DETAIL_DATA_GETBASIC_INFO_TES_ES_2_2_0 = """
|
||||
<QDocRoot version="1.0">
|
||||
<model>
|
||||
<displayModelName><![CDATA[TES-1885U]]></displayModelName>
|
||||
<internalModelName><![CDATA[ES-1885U]]></internalModelName>
|
||||
</model>
|
||||
<firmware>
|
||||
<version><![CDATA[2.2.0]]></version>
|
||||
</firmware>
|
||||
</QDocRoot>"""
|
||||
|
||||
FAKE_RES_DETAIL_DATA_GETBASIC_INFO_ERROR = """
|
||||
<QDocRoot version="1.0">
|
||||
<model>
|
||||
@ -439,6 +505,36 @@ class FakeGetBasicInfoResponseEs_1_1_3(object):
|
||||
return FAKE_RES_DETAIL_DATA_GETBASIC_INFO_ES_1_1_3
|
||||
|
||||
|
||||
class FakeGetBasicInfoResponseEs_2_0_0(object):
|
||||
"""Fake GetBasicInfo response from ES nas."""
|
||||
|
||||
status = 'fackStatus'
|
||||
|
||||
def read(self):
|
||||
"""Mock response.read."""
|
||||
return FAKE_RES_DETAIL_DATA_GETBASIC_INFO_ES_2_0_0
|
||||
|
||||
|
||||
class FakeGetBasicInfoResponseEs_2_1_0(object):
|
||||
"""Fake GetBasicInfo response from ES nas."""
|
||||
|
||||
status = 'fackStatus'
|
||||
|
||||
def read(self):
|
||||
"""Mock response.read."""
|
||||
return FAKE_RES_DETAIL_DATA_GETBASIC_INFO_ES_2_1_0
|
||||
|
||||
|
||||
class FakeGetBasicInfoResponseEs_2_2_0(object):
|
||||
"""Fake GetBasicInfo response from ES nas."""
|
||||
|
||||
status = 'fackStatus'
|
||||
|
||||
def read(self):
|
||||
"""Mock response.read."""
|
||||
return FAKE_RES_DETAIL_DATA_GETBASIC_INFO_ES_2_2_0
|
||||
|
||||
|
||||
class FakeGetBasicInfoResponseTs_4_0_0(object):
|
||||
"""Fake GetBasicInfoTS response from TS nas."""
|
||||
|
||||
@ -499,6 +595,36 @@ class FakeGetBasicInfoResponseTesEs_1_1_3(object):
|
||||
return FAKE_RES_DETAIL_DATA_GETBASIC_INFO_TES_ES_1_1_3
|
||||
|
||||
|
||||
class FakeGetBasicInfoResponseTesEs_2_0_0(object):
|
||||
"""Fake GetBasicInfoTS response from TS nas."""
|
||||
|
||||
status = 'fackStatus'
|
||||
|
||||
def read(self):
|
||||
"""Mock response.read."""
|
||||
return FAKE_RES_DETAIL_DATA_GETBASIC_INFO_TES_ES_2_0_0
|
||||
|
||||
|
||||
class FakeGetBasicInfoResponseTesEs_2_1_0(object):
|
||||
"""Fake GetBasicInfoTS response from TS nas."""
|
||||
|
||||
status = 'fackStatus'
|
||||
|
||||
def read(self):
|
||||
"""Mock response.read."""
|
||||
return FAKE_RES_DETAIL_DATA_GETBASIC_INFO_TES_ES_2_1_0
|
||||
|
||||
|
||||
class FakeGetBasicInfoResponseTesEs_2_2_0(object):
|
||||
"""Fake GetBasicInfoTS response from TS nas."""
|
||||
|
||||
status = 'fackStatus'
|
||||
|
||||
def read(self):
|
||||
"""Mock response.read."""
|
||||
return FAKE_RES_DETAIL_DATA_GETBASIC_INFO_TES_ES_2_2_0
|
||||
|
||||
|
||||
class FakeGetBasicInfoResponseError(object):
|
||||
"""Fake GetBasicInfoTS response from TS nas."""
|
||||
|
||||
|
@ -153,9 +153,21 @@ class QnapShareDriverLoginTestCase(QnapShareDriverBaseTestCase):
|
||||
}, {
|
||||
'fake_basic_info': fakes.FakeGetBasicInfoResponseTesEs_1_1_3(),
|
||||
'expect_result': api.QnapAPIExecutor
|
||||
}, {
|
||||
'fake_basic_info': fakes.FakeGetBasicInfoResponseTesEs_2_0_0(),
|
||||
'expect_result': api.QnapAPIExecutor
|
||||
}, {
|
||||
'fake_basic_info': fakes.FakeGetBasicInfoResponseTesEs_2_1_0(),
|
||||
'expect_result': api.QnapAPIExecutor
|
||||
}, {
|
||||
'fake_basic_info': fakes.FakeGetBasicInfoResponseEs_1_1_3(),
|
||||
'expect_result': api.QnapAPIExecutor
|
||||
}, {
|
||||
'fake_basic_info': fakes.FakeGetBasicInfoResponseEs_2_0_0(),
|
||||
'expect_result': api.QnapAPIExecutor
|
||||
}, {
|
||||
'fake_basic_info': fakes.FakeGetBasicInfoResponseEs_2_1_0(),
|
||||
'expect_result': api.QnapAPIExecutor
|
||||
})
|
||||
@ddt.unpack
|
||||
def test_create_api_executor(self, fake_basic_info, expect_result):
|
||||
@ -179,9 +191,15 @@ class QnapShareDriverLoginTestCase(QnapShareDriverBaseTestCase):
|
||||
}, {
|
||||
'fake_basic_info': fakes.FakeGetBasicInfoResponseTesEs_1_1_1(),
|
||||
'expect_result': exception.ShareBackendException
|
||||
}, {
|
||||
'fake_basic_info': fakes.FakeGetBasicInfoResponseTesEs_2_2_0(),
|
||||
'expect_result': exception.ShareBackendException
|
||||
}, {
|
||||
'fake_basic_info': fakes.FakeGetBasicInfoResponseEs_1_1_1(),
|
||||
'expect_result': exception.ShareBackendException
|
||||
}, {
|
||||
'fake_basic_info': fakes.FakeGetBasicInfoResponseEs_2_2_0(),
|
||||
'expect_result': exception.ShareBackendException
|
||||
})
|
||||
@ddt.unpack
|
||||
def test_create_api_executor_negative(self,
|
||||
|
@ -0,0 +1,4 @@
|
||||
---
|
||||
features:
|
||||
- |
|
||||
QNAP Manila driver added support for QES fw 2.1.0.
|
Loading…
Reference in New Issue
Block a user