Browse Source

Merge "QNAP: Add support for QES 2.1.0"

Zuul 9 months ago
parent
commit
1384257e4f

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

@@ -73,9 +73,10 @@ class QnapShareDriver(driver.ShareDriver):
73 73
         1.0.4 - Add support for QES fw 2.0.0.
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
+        1.0.6 - Add support for QES fw 2.1.0.
76 77
     """
77 78
 
78
-    DRIVER_VERSION = '1.0.5'
79
+    DRIVER_VERSION = '1.0.6'
79 80
 
80 81
     def __init__(self, *args, **kwargs):
81 82
         """Initialize QnapShareDriver."""
@@ -164,14 +165,14 @@ class QnapShareDriver(driver.ShareDriver):
164 165
                         username=self.configuration.qnap_nas_login,
165 166
                         password=self.configuration.qnap_nas_password,
166 167
                         management_url=self.configuration.qnap_management_url)
167
-            elif "1.1.2" <= fw_version <= "2.0.9999":
168
+            elif "1.1.2" <= fw_version <= "2.1.9999":
168 169
                 LOG.debug('Create ES API Executor')
169 170
                 return api.QnapAPIExecutor(
170 171
                     username=self.configuration.qnap_nas_login,
171 172
                     password=self.configuration.qnap_nas_password,
172 173
                     management_url=self.configuration.qnap_management_url)
173 174
         elif model_type in es_model_types:
174
-            if "1.1.2" <= fw_version <= "2.0.9999":
175
+            if "1.1.2" <= fw_version <= "2.1.9999":
175 176
                 LOG.debug('Create ES API Executor')
176 177
                 return api.QnapAPIExecutor(
177 178
                     username=self.configuration.qnap_nas_login,

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

@@ -41,6 +41,39 @@ FAKE_RES_DETAIL_DATA_GETBASIC_INFO_ES_1_1_3 = """
41 41
         </firmware>
42 42
     </QDocRoot>"""
43 43
 
44
+FAKE_RES_DETAIL_DATA_GETBASIC_INFO_ES_2_0_0 = """
45
+    <QDocRoot version="1.0">
46
+        <model>
47
+            <displayModelName><![CDATA[ES1640dc]]></displayModelName>
48
+            <internalModelName><![CDATA[ES1640dc]]></internalModelName>
49
+        </model>
50
+        <firmware>
51
+            <version><![CDATA[2.0.0]]></version>
52
+        </firmware>
53
+    </QDocRoot>"""
54
+
55
+FAKE_RES_DETAIL_DATA_GETBASIC_INFO_ES_2_1_0 = """
56
+    <QDocRoot version="1.0">
57
+        <model>
58
+            <displayModelName><![CDATA[ES1640dc]]></displayModelName>
59
+            <internalModelName><![CDATA[ES1640dc]]></internalModelName>
60
+        </model>
61
+        <firmware>
62
+            <version><![CDATA[2.1.0]]></version>
63
+        </firmware>
64
+    </QDocRoot>"""
65
+
66
+FAKE_RES_DETAIL_DATA_GETBASIC_INFO_ES_2_2_0 = """
67
+    <QDocRoot version="1.0">
68
+        <model>
69
+            <displayModelName><![CDATA[ES1640dc]]></displayModelName>
70
+            <internalModelName><![CDATA[ES1640dc]]></internalModelName>
71
+        </model>
72
+        <firmware>
73
+            <version><![CDATA[2.2.0]]></version>
74
+        </firmware>
75
+    </QDocRoot>"""
76
+
44 77
 FAKE_RES_DETAIL_DATA_GETBASIC_INFO_TS_4_0_0 = """
45 78
     <QDocRoot version="1.0">
46 79
         <model>
@@ -107,6 +140,39 @@ FAKE_RES_DETAIL_DATA_GETBASIC_INFO_TES_ES_1_1_3 = """
107 140
         </firmware>
108 141
     </QDocRoot>"""
109 142
 
143
+FAKE_RES_DETAIL_DATA_GETBASIC_INFO_TES_ES_2_0_0 = """
144
+    <QDocRoot version="1.0">
145
+        <model>
146
+            <displayModelName><![CDATA[TES-1885U]]></displayModelName>
147
+            <internalModelName><![CDATA[ES-1885U]]></internalModelName>
148
+        </model>
149
+        <firmware>
150
+            <version><![CDATA[2.0.0]]></version>
151
+        </firmware>
152
+    </QDocRoot>"""
153
+
154
+FAKE_RES_DETAIL_DATA_GETBASIC_INFO_TES_ES_2_1_0 = """
155
+    <QDocRoot version="1.0">
156
+        <model>
157
+            <displayModelName><![CDATA[TES-1885U]]></displayModelName>
158
+            <internalModelName><![CDATA[ES-1885U]]></internalModelName>
159
+        </model>
160
+        <firmware>
161
+            <version><![CDATA[2.1.0]]></version>
162
+        </firmware>
163
+    </QDocRoot>"""
164
+
165
+FAKE_RES_DETAIL_DATA_GETBASIC_INFO_TES_ES_2_2_0 = """
166
+    <QDocRoot version="1.0">
167
+        <model>
168
+            <displayModelName><![CDATA[TES-1885U]]></displayModelName>
169
+            <internalModelName><![CDATA[ES-1885U]]></internalModelName>
170
+        </model>
171
+        <firmware>
172
+            <version><![CDATA[2.2.0]]></version>
173
+        </firmware>
174
+    </QDocRoot>"""
175
+
110 176
 FAKE_RES_DETAIL_DATA_GETBASIC_INFO_ERROR = """
111 177
     <QDocRoot version="1.0">
112 178
         <model>
@@ -439,6 +505,36 @@ class FakeGetBasicInfoResponseEs_1_1_3(object):
439 505
         return FAKE_RES_DETAIL_DATA_GETBASIC_INFO_ES_1_1_3
440 506
 
441 507
 
508
+class FakeGetBasicInfoResponseEs_2_0_0(object):
509
+    """Fake GetBasicInfo response from ES nas."""
510
+
511
+    status = 'fackStatus'
512
+
513
+    def read(self):
514
+        """Mock response.read."""
515
+        return FAKE_RES_DETAIL_DATA_GETBASIC_INFO_ES_2_0_0
516
+
517
+
518
+class FakeGetBasicInfoResponseEs_2_1_0(object):
519
+    """Fake GetBasicInfo response from ES nas."""
520
+
521
+    status = 'fackStatus'
522
+
523
+    def read(self):
524
+        """Mock response.read."""
525
+        return FAKE_RES_DETAIL_DATA_GETBASIC_INFO_ES_2_1_0
526
+
527
+
528
+class FakeGetBasicInfoResponseEs_2_2_0(object):
529
+    """Fake GetBasicInfo response from ES nas."""
530
+
531
+    status = 'fackStatus'
532
+
533
+    def read(self):
534
+        """Mock response.read."""
535
+        return FAKE_RES_DETAIL_DATA_GETBASIC_INFO_ES_2_2_0
536
+
537
+
442 538
 class FakeGetBasicInfoResponseTs_4_0_0(object):
443 539
     """Fake GetBasicInfoTS response from TS nas."""
444 540
 
@@ -499,6 +595,36 @@ class FakeGetBasicInfoResponseTesEs_1_1_3(object):
499 595
         return FAKE_RES_DETAIL_DATA_GETBASIC_INFO_TES_ES_1_1_3
500 596
 
501 597
 
598
+class FakeGetBasicInfoResponseTesEs_2_0_0(object):
599
+    """Fake GetBasicInfoTS response from TS nas."""
600
+
601
+    status = 'fackStatus'
602
+
603
+    def read(self):
604
+        """Mock response.read."""
605
+        return FAKE_RES_DETAIL_DATA_GETBASIC_INFO_TES_ES_2_0_0
606
+
607
+
608
+class FakeGetBasicInfoResponseTesEs_2_1_0(object):
609
+    """Fake GetBasicInfoTS response from TS nas."""
610
+
611
+    status = 'fackStatus'
612
+
613
+    def read(self):
614
+        """Mock response.read."""
615
+        return FAKE_RES_DETAIL_DATA_GETBASIC_INFO_TES_ES_2_1_0
616
+
617
+
618
+class FakeGetBasicInfoResponseTesEs_2_2_0(object):
619
+    """Fake GetBasicInfoTS response from TS nas."""
620
+
621
+    status = 'fackStatus'
622
+
623
+    def read(self):
624
+        """Mock response.read."""
625
+        return FAKE_RES_DETAIL_DATA_GETBASIC_INFO_TES_ES_2_2_0
626
+
627
+
502 628
 class FakeGetBasicInfoResponseError(object):
503 629
     """Fake GetBasicInfoTS response from TS nas."""
504 630
 

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

@@ -153,9 +153,21 @@ class QnapShareDriverLoginTestCase(QnapShareDriverBaseTestCase):
153 153
     }, {
154 154
         'fake_basic_info': fakes.FakeGetBasicInfoResponseTesEs_1_1_3(),
155 155
         'expect_result': api.QnapAPIExecutor
156
+    }, {
157
+        'fake_basic_info': fakes.FakeGetBasicInfoResponseTesEs_2_0_0(),
158
+        'expect_result': api.QnapAPIExecutor
159
+    }, {
160
+        'fake_basic_info': fakes.FakeGetBasicInfoResponseTesEs_2_1_0(),
161
+        'expect_result': api.QnapAPIExecutor
156 162
     }, {
157 163
         'fake_basic_info': fakes.FakeGetBasicInfoResponseEs_1_1_3(),
158 164
         'expect_result': api.QnapAPIExecutor
165
+    }, {
166
+        'fake_basic_info': fakes.FakeGetBasicInfoResponseEs_2_0_0(),
167
+        'expect_result': api.QnapAPIExecutor
168
+    }, {
169
+        'fake_basic_info': fakes.FakeGetBasicInfoResponseEs_2_1_0(),
170
+        'expect_result': api.QnapAPIExecutor
159 171
     })
160 172
     @ddt.unpack
161 173
     def test_create_api_executor(self, fake_basic_info, expect_result):
@@ -179,9 +191,15 @@ class QnapShareDriverLoginTestCase(QnapShareDriverBaseTestCase):
179 191
     }, {
180 192
         'fake_basic_info': fakes.FakeGetBasicInfoResponseTesEs_1_1_1(),
181 193
         'expect_result': exception.ShareBackendException
194
+    }, {
195
+        'fake_basic_info': fakes.FakeGetBasicInfoResponseTesEs_2_2_0(),
196
+        'expect_result': exception.ShareBackendException
182 197
     }, {
183 198
         'fake_basic_info': fakes.FakeGetBasicInfoResponseEs_1_1_1(),
184 199
         'expect_result': exception.ShareBackendException
200
+    }, {
201
+        'fake_basic_info': fakes.FakeGetBasicInfoResponseEs_2_2_0(),
202
+        'expect_result': exception.ShareBackendException
185 203
     })
186 204
     @ddt.unpack
187 205
     def test_create_api_executor_negative(self,

+ 4
- 0
releasenotes/notes/qnap-support-qes-210-8775e6c210f3ca9f.yaml View File

@@ -0,0 +1,4 @@
1
+---
2
+features:
3
+  - |
4
+    QNAP Manila driver added support for QES fw 2.1.0.

Loading…
Cancel
Save