summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Yang <chrisyang@qnap.com>2019-01-01 14:20:40 +0800
committerChris Yang <chrisyang@qnap.com>2019-01-01 14:20:40 +0800
commitbc2a18eee50b7b8e0b4678b74d5bd0f0f755e9d2 (patch)
tree8bad1f21dcc429410acafa122fd5552bc69f3771
parentcf41d1867c35ccb116da94a559fd30efc00b1548 (diff)
QNAP: Support QES FW on TDS series NAS
Support both QTS and QES FW on TDS series NAS models. Change-Id: I87129fae531b6d50b8490785badcb054a9dd9397
Notes
Notes (review): Code-Review+2: Tom Barron <tpb@dyncloud.net> Code-Review+2: Thomas Bechtold <tbechtold@suse.com> Workflow+1: Thomas Bechtold <tbechtold@suse.com> Verified+2: Zuul Submitted-by: Zuul Submitted-at: Wed, 02 Jan 2019 13:38:49 +0000 Reviewed-on: https://review.openstack.org/627894 Project: openstack/manila Branch: refs/heads/master
-rw-r--r--manila/share/drivers/qnap/qnap.py7
-rw-r--r--manila/tests/share/drivers/qnap/fakes.py106
-rw-r--r--manila/tests/share/drivers/qnap/test_qnap.py15
-rw-r--r--releasenotes/notes/qnap-tds-support-qes-24704313a0881c8c.yaml4
4 files changed, 129 insertions, 3 deletions
diff --git a/manila/share/drivers/qnap/qnap.py b/manila/share/drivers/qnap/qnap.py
index ab056df..98a4b1b 100644
--- a/manila/share/drivers/qnap/qnap.py
+++ b/manila/share/drivers/qnap/qnap.py
@@ -74,9 +74,10 @@ class QnapShareDriver(driver.ShareDriver):
74 1.0.5 - Fix bug #1773761, when user tries to manage share, the size 74 1.0.5 - Fix bug #1773761, when user tries to manage share, the size
75 of managed share should not be changed. 75 of managed share should not be changed.
76 1.0.6 - Add support for QES fw 2.1.0. 76 1.0.6 - Add support for QES fw 2.1.0.
77 1.0.7 - Add support for QES fw on TDS series NAS model.
77 """ 78 """
78 79
79 DRIVER_VERSION = '1.0.6' 80 DRIVER_VERSION = '1.0.7'
80 81
81 def __init__(self, *args, **kwargs): 82 def __init__(self, *args, **kwargs):
82 """Initialize QnapShareDriver.""" 83 """Initialize QnapShareDriver."""
@@ -131,10 +132,10 @@ class QnapShareDriver(driver.ShareDriver):
131 model_type = matches.group(1) 132 model_type = matches.group(1)
132 133
133 ts_model_types = ( 134 ts_model_types = (
134 "TS", "SS", "IS", "TVS", "TDS", "TBS" 135 "TS", "SS", "IS", "TVS", "TBS"
135 ) 136 )
136 tes_model_types = ( 137 tes_model_types = (
137 "TES", 138 "TES", "TDS"
138 ) 139 )
139 es_model_types = ( 140 es_model_types = (
140 "ES", 141 "ES",
diff --git a/manila/tests/share/drivers/qnap/fakes.py b/manila/tests/share/drivers/qnap/fakes.py
index 98d08d5..3522c34 100644
--- a/manila/tests/share/drivers/qnap/fakes.py
+++ b/manila/tests/share/drivers/qnap/fakes.py
@@ -173,6 +173,62 @@ FAKE_RES_DETAIL_DATA_GETBASIC_INFO_TES_ES_2_2_0 = """
173 </firmware> 173 </firmware>
174 </QDocRoot>""" 174 </QDocRoot>"""
175 175
176FAKE_RES_DETAIL_DATA_GETBASIC_INFO_TDS_TS_4_0_0 = """
177 <QDocRoot version="1.0">
178 <model>
179 <displayModelName><![CDATA[TDS-16489U R2]]></displayModelName>
180 <internalModelName><![CDATA[TS-X89]]></internalModelName>
181 </model>
182 <firmware>
183 <version><![CDATA[4.0.0]]></version>
184 </firmware>
185 </QDocRoot>"""
186
187FAKE_RES_DETAIL_DATA_GETBASIC_INFO_TDS_TS_4_3_0 = """
188 <QDocRoot version="1.0">
189 <model>
190 <displayModelName><![CDATA[TDS-16489U R2]]></displayModelName>
191 <internalModelName><![CDATA[TS-X89]]></internalModelName>
192 </model>
193 <firmware>
194 <version><![CDATA[4.3.0]]></version>
195 </firmware>
196 </QDocRoot>"""
197
198FAKE_RES_DETAIL_DATA_GETBASIC_INFO_TDS_ES_1_1_1 = """
199 <QDocRoot version="1.0">
200 <model>
201 <displayModelName><![CDATA[TDS-16489U R2]]></displayModelName>
202 <internalModelName><![CDATA[ES-X85U]]></internalModelName>
203 </model>
204 <firmware>
205 <version><![CDATA[1.1.1]]></version>
206 </firmware>
207 </QDocRoot>"""
208
209FAKE_RES_DETAIL_DATA_GETBASIC_INFO_TDS_ES_2_1_0 = """
210 <QDocRoot version="1.0">
211 <model>
212 <displayModelName><![CDATA[TDS-16489U R2]]></displayModelName>
213 <internalModelName><![CDATA[ES-X85U]]></internalModelName>
214 </model>
215 <firmware>
216 <version><![CDATA[2.1.0]]></version>
217 </firmware>
218 </QDocRoot>"""
219
220FAKE_RES_DETAIL_DATA_GETBASIC_INFO_TDS_ES_2_2_0 = """
221 <QDocRoot version="1.0">
222 <model>
223 <displayModelName><![CDATA[TDS-16489U R2]]></displayModelName>
224 <internalModelName><![CDATA[ES-X85U]]></internalModelName>
225 </model>
226 <firmware>
227 <version><![CDATA[2.2.0]]></version>
228 </firmware>
229 </QDocRoot>"""
230
231
176FAKE_RES_DETAIL_DATA_GETBASIC_INFO_ERROR = """ 232FAKE_RES_DETAIL_DATA_GETBASIC_INFO_ERROR = """
177 <QDocRoot version="1.0"> 233 <QDocRoot version="1.0">
178 <model> 234 <model>
@@ -625,6 +681,56 @@ class FakeGetBasicInfoResponseTesEs_2_2_0(object):
625 return FAKE_RES_DETAIL_DATA_GETBASIC_INFO_TES_ES_2_2_0 681 return FAKE_RES_DETAIL_DATA_GETBASIC_INFO_TES_ES_2_2_0
626 682
627 683
684class FakeGetBasicInfoResponseTdsTs_4_0_0(object):
685 """Fake GetBasicInfoTS response from TS nas."""
686
687 status = 'fackStatus'
688
689 def read(self):
690 """Mock response.read."""
691 return FAKE_RES_DETAIL_DATA_GETBASIC_INFO_TDS_TS_4_0_0
692
693
694class FakeGetBasicInfoResponseTdsTs_4_3_0(object):
695 """Fake GetBasicInfoTS response from TS nas."""
696
697 status = 'fackStatus'
698
699 def read(self):
700 """Mock response.read."""
701 return FAKE_RES_DETAIL_DATA_GETBASIC_INFO_TDS_TS_4_3_0
702
703
704class FakeGetBasicInfoResponseTdsEs_1_1_1(object):
705 """Fake GetBasicInfoTS response from ES nas."""
706
707 status = 'fackStatus'
708
709 def read(self):
710 """Mock response.read."""
711 return FAKE_RES_DETAIL_DATA_GETBASIC_INFO_TDS_ES_1_1_1
712
713
714class FakeGetBasicInfoResponseTdsEs_2_1_0(object):
715 """Fake GetBasicInfoTS response from ES nas."""
716
717 status = 'fackStatus'
718
719 def read(self):
720 """Mock response.read."""
721 return FAKE_RES_DETAIL_DATA_GETBASIC_INFO_TDS_ES_2_1_0
722
723
724class FakeGetBasicInfoResponseTdsEs_2_2_0(object):
725 """Fake GetBasicInfoTS response from ES nas."""
726
727 status = 'fackStatus'
728
729 def read(self):
730 """Mock response.read."""
731 return FAKE_RES_DETAIL_DATA_GETBASIC_INFO_TDS_ES_2_2_0
732
733
628class FakeGetBasicInfoResponseError(object): 734class FakeGetBasicInfoResponseError(object):
629 """Fake GetBasicInfoTS response from TS nas.""" 735 """Fake GetBasicInfoTS response from TS nas."""
630 736
diff --git a/manila/tests/share/drivers/qnap/test_qnap.py b/manila/tests/share/drivers/qnap/test_qnap.py
index 878c953..0f252e3 100644
--- a/manila/tests/share/drivers/qnap/test_qnap.py
+++ b/manila/tests/share/drivers/qnap/test_qnap.py
@@ -160,6 +160,12 @@ class QnapShareDriverLoginTestCase(QnapShareDriverBaseTestCase):
160 'fake_basic_info': fakes.FakeGetBasicInfoResponseTesEs_2_1_0(), 160 'fake_basic_info': fakes.FakeGetBasicInfoResponseTesEs_2_1_0(),
161 'expect_result': api.QnapAPIExecutor 161 'expect_result': api.QnapAPIExecutor
162 }, { 162 }, {
163 'fake_basic_info': fakes.FakeGetBasicInfoResponseTdsTs_4_3_0(),
164 'expect_result': api.QnapAPIExecutorTS
165 }, {
166 'fake_basic_info': fakes.FakeGetBasicInfoResponseTdsEs_2_1_0(),
167 'expect_result': api.QnapAPIExecutor
168 }, {
163 'fake_basic_info': fakes.FakeGetBasicInfoResponseEs_1_1_3(), 169 'fake_basic_info': fakes.FakeGetBasicInfoResponseEs_1_1_3(),
164 'expect_result': api.QnapAPIExecutor 170 'expect_result': api.QnapAPIExecutor
165 }, { 171 }, {
@@ -195,6 +201,15 @@ class QnapShareDriverLoginTestCase(QnapShareDriverBaseTestCase):
195 'fake_basic_info': fakes.FakeGetBasicInfoResponseTesEs_2_2_0(), 201 'fake_basic_info': fakes.FakeGetBasicInfoResponseTesEs_2_2_0(),
196 'expect_result': exception.ShareBackendException 202 'expect_result': exception.ShareBackendException
197 }, { 203 }, {
204 'fake_basic_info': fakes.FakeGetBasicInfoResponseTdsTs_4_0_0(),
205 'expect_result': exception.ShareBackendException
206 }, {
207 'fake_basic_info': fakes.FakeGetBasicInfoResponseTdsEs_1_1_1(),
208 'expect_result': exception.ShareBackendException
209 }, {
210 'fake_basic_info': fakes.FakeGetBasicInfoResponseTdsEs_2_2_0(),
211 'expect_result': exception.ShareBackendException
212 }, {
198 'fake_basic_info': fakes.FakeGetBasicInfoResponseEs_1_1_1(), 213 'fake_basic_info': fakes.FakeGetBasicInfoResponseEs_1_1_1(),
199 'expect_result': exception.ShareBackendException 214 'expect_result': exception.ShareBackendException
200 }, { 215 }, {
diff --git a/releasenotes/notes/qnap-tds-support-qes-24704313a0881c8c.yaml b/releasenotes/notes/qnap-tds-support-qes-24704313a0881c8c.yaml
new file mode 100644
index 0000000..1c16116
--- /dev/null
+++ b/releasenotes/notes/qnap-tds-support-qes-24704313a0881c8c.yaml
@@ -0,0 +1,4 @@
1---
2features:
3 - |
4 QNAP Manila driver supports QES FW on TDS series NAS.