Browse Source

QNAP: Support QES FW on TDS series NAS

Support both QTS and QES FW on TDS series NAS models.

Change-Id: I87129fae531b6d50b8490785badcb054a9dd9397
Chris Yang 3 months ago
parent
commit
bc2a18eee5

+ 4
- 3
manila/share/drivers/qnap/qnap.py View File

@@ -74,9 +74,10 @@ class QnapShareDriver(driver.ShareDriver):
74 74
         1.0.5 - Fix bug #1773761, when user tries to manage share, the size
75 75
                 of managed share should not be changed.
76 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 82
     def __init__(self, *args, **kwargs):
82 83
         """Initialize QnapShareDriver."""
@@ -131,10 +132,10 @@ class QnapShareDriver(driver.ShareDriver):
131 132
         model_type = matches.group(1)
132 133
 
133 134
         ts_model_types = (
134
-            "TS", "SS", "IS", "TVS", "TDS", "TBS"
135
+            "TS", "SS", "IS", "TVS", "TBS"
135 136
         )
136 137
         tes_model_types = (
137
-            "TES",
138
+            "TES", "TDS"
138 139
         )
139 140
         es_model_types = (
140 141
             "ES",

+ 106
- 0
manila/tests/share/drivers/qnap/fakes.py View File

@@ -173,6 +173,62 @@ FAKE_RES_DETAIL_DATA_GETBASIC_INFO_TES_ES_2_2_0 = """
173 173
         </firmware>
174 174
     </QDocRoot>"""
175 175
 
176
+FAKE_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
+
187
+FAKE_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
+
198
+FAKE_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
+
209
+FAKE_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
+
220
+FAKE_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
+
176 232
 FAKE_RES_DETAIL_DATA_GETBASIC_INFO_ERROR = """
177 233
     <QDocRoot version="1.0">
178 234
         <model>
@@ -625,6 +681,56 @@ class FakeGetBasicInfoResponseTesEs_2_2_0(object):
625 681
         return FAKE_RES_DETAIL_DATA_GETBASIC_INFO_TES_ES_2_2_0
626 682
 
627 683
 
684
+class 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
+
694
+class 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
+
704
+class 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
+
714
+class 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
+
724
+class 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
+
628 734
 class FakeGetBasicInfoResponseError(object):
629 735
     """Fake GetBasicInfoTS response from TS nas."""
630 736
 

+ 15
- 0
manila/tests/share/drivers/qnap/test_qnap.py View File

@@ -159,6 +159,12 @@ class QnapShareDriverLoginTestCase(QnapShareDriverBaseTestCase):
159 159
     }, {
160 160
         'fake_basic_info': fakes.FakeGetBasicInfoResponseTesEs_2_1_0(),
161 161
         'expect_result': api.QnapAPIExecutor
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
162 168
     }, {
163 169
         'fake_basic_info': fakes.FakeGetBasicInfoResponseEs_1_1_3(),
164 170
         'expect_result': api.QnapAPIExecutor
@@ -194,6 +200,15 @@ class QnapShareDriverLoginTestCase(QnapShareDriverBaseTestCase):
194 200
     }, {
195 201
         'fake_basic_info': fakes.FakeGetBasicInfoResponseTesEs_2_2_0(),
196 202
         'expect_result': exception.ShareBackendException
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
197 212
     }, {
198 213
         'fake_basic_info': fakes.FakeGetBasicInfoResponseEs_1_1_1(),
199 214
         'expect_result': exception.ShareBackendException

+ 4
- 0
releasenotes/notes/qnap-tds-support-qes-24704313a0881c8c.yaml View File

@@ -0,0 +1,4 @@
1
+---
2
+features:
3
+  - |
4
+    QNAP Manila driver supports QES FW on TDS series NAS.

Loading…
Cancel
Save