summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZuul <zuul@review.openstack.org>2018-07-25 05:26:28 +0000
committerGerrit Code Review <review@openstack.org>2018-07-25 05:26:28 +0000
commit1384257e4f205b2c2d79064bc6723aada781d670 (patch)
treeabe283f15b055c942daf9c4556ce58483a325f90
parent3abfbef591c8c88fe9ca9669ef61d709d6c2cba1 (diff)
parenta8ccc1ac1258c950b82a38e4670a2a6b4a9486f0 (diff)
Merge "QNAP: Add support for QES 2.1.0"7.0.0.0b3
-rw-r--r--manila/share/drivers/qnap/qnap.py7
-rw-r--r--manila/tests/share/drivers/qnap/fakes.py126
-rw-r--r--manila/tests/share/drivers/qnap/test_qnap.py18
-rw-r--r--releasenotes/notes/qnap-support-qes-210-8775e6c210f3ca9f.yaml4
4 files changed, 152 insertions, 3 deletions
diff --git a/manila/share/drivers/qnap/qnap.py b/manila/share/drivers/qnap/qnap.py
index 80a4d9a..567c691 100644
--- a/manila/share/drivers/qnap/qnap.py
+++ b/manila/share/drivers/qnap/qnap.py
@@ -73,9 +73,10 @@ class QnapShareDriver(driver.ShareDriver):
73 1.0.4 - Add support for QES fw 2.0.0. 73 1.0.4 - Add support for QES fw 2.0.0.
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 """ 77 """
77 78
78 DRIVER_VERSION = '1.0.5' 79 DRIVER_VERSION = '1.0.6'
79 80
80 def __init__(self, *args, **kwargs): 81 def __init__(self, *args, **kwargs):
81 """Initialize QnapShareDriver.""" 82 """Initialize QnapShareDriver."""
@@ -164,14 +165,14 @@ class QnapShareDriver(driver.ShareDriver):
164 username=self.configuration.qnap_nas_login, 165 username=self.configuration.qnap_nas_login,
165 password=self.configuration.qnap_nas_password, 166 password=self.configuration.qnap_nas_password,
166 management_url=self.configuration.qnap_management_url) 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 LOG.debug('Create ES API Executor') 169 LOG.debug('Create ES API Executor')
169 return api.QnapAPIExecutor( 170 return api.QnapAPIExecutor(
170 username=self.configuration.qnap_nas_login, 171 username=self.configuration.qnap_nas_login,
171 password=self.configuration.qnap_nas_password, 172 password=self.configuration.qnap_nas_password,
172 management_url=self.configuration.qnap_management_url) 173 management_url=self.configuration.qnap_management_url)
173 elif model_type in es_model_types: 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 LOG.debug('Create ES API Executor') 176 LOG.debug('Create ES API Executor')
176 return api.QnapAPIExecutor( 177 return api.QnapAPIExecutor(
177 username=self.configuration.qnap_nas_login, 178 username=self.configuration.qnap_nas_login,
diff --git a/manila/tests/share/drivers/qnap/fakes.py b/manila/tests/share/drivers/qnap/fakes.py
index f9d4a2f..98d08d5 100644
--- a/manila/tests/share/drivers/qnap/fakes.py
+++ b/manila/tests/share/drivers/qnap/fakes.py
@@ -41,6 +41,39 @@ FAKE_RES_DETAIL_DATA_GETBASIC_INFO_ES_1_1_3 = """
41 </firmware> 41 </firmware>
42 </QDocRoot>""" 42 </QDocRoot>"""
43 43
44FAKE_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
55FAKE_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
66FAKE_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
44FAKE_RES_DETAIL_DATA_GETBASIC_INFO_TS_4_0_0 = """ 77FAKE_RES_DETAIL_DATA_GETBASIC_INFO_TS_4_0_0 = """
45 <QDocRoot version="1.0"> 78 <QDocRoot version="1.0">
46 <model> 79 <model>
@@ -107,6 +140,39 @@ FAKE_RES_DETAIL_DATA_GETBASIC_INFO_TES_ES_1_1_3 = """
107 </firmware> 140 </firmware>
108 </QDocRoot>""" 141 </QDocRoot>"""
109 142
143FAKE_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
154FAKE_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
165FAKE_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
110FAKE_RES_DETAIL_DATA_GETBASIC_INFO_ERROR = """ 176FAKE_RES_DETAIL_DATA_GETBASIC_INFO_ERROR = """
111 <QDocRoot version="1.0"> 177 <QDocRoot version="1.0">
112 <model> 178 <model>
@@ -439,6 +505,36 @@ class FakeGetBasicInfoResponseEs_1_1_3(object):
439 return FAKE_RES_DETAIL_DATA_GETBASIC_INFO_ES_1_1_3 505 return FAKE_RES_DETAIL_DATA_GETBASIC_INFO_ES_1_1_3
440 506
441 507
508class 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
518class 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
528class 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
442class FakeGetBasicInfoResponseTs_4_0_0(object): 538class FakeGetBasicInfoResponseTs_4_0_0(object):
443 """Fake GetBasicInfoTS response from TS nas.""" 539 """Fake GetBasicInfoTS response from TS nas."""
444 540
@@ -499,6 +595,36 @@ class FakeGetBasicInfoResponseTesEs_1_1_3(object):
499 return FAKE_RES_DETAIL_DATA_GETBASIC_INFO_TES_ES_1_1_3 595 return FAKE_RES_DETAIL_DATA_GETBASIC_INFO_TES_ES_1_1_3
500 596
501 597
598class 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
608class 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
618class 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
502class FakeGetBasicInfoResponseError(object): 628class FakeGetBasicInfoResponseError(object):
503 """Fake GetBasicInfoTS response from TS nas.""" 629 """Fake GetBasicInfoTS response from TS nas."""
504 630
diff --git a/manila/tests/share/drivers/qnap/test_qnap.py b/manila/tests/share/drivers/qnap/test_qnap.py
index 8e5974a..878c953 100644
--- a/manila/tests/share/drivers/qnap/test_qnap.py
+++ b/manila/tests/share/drivers/qnap/test_qnap.py
@@ -154,8 +154,20 @@ class QnapShareDriverLoginTestCase(QnapShareDriverBaseTestCase):
154 'fake_basic_info': fakes.FakeGetBasicInfoResponseTesEs_1_1_3(), 154 'fake_basic_info': fakes.FakeGetBasicInfoResponseTesEs_1_1_3(),
155 'expect_result': api.QnapAPIExecutor 155 'expect_result': api.QnapAPIExecutor
156 }, { 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
162 }, {
157 'fake_basic_info': fakes.FakeGetBasicInfoResponseEs_1_1_3(), 163 'fake_basic_info': fakes.FakeGetBasicInfoResponseEs_1_1_3(),
158 'expect_result': api.QnapAPIExecutor 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 @ddt.unpack 172 @ddt.unpack
161 def test_create_api_executor(self, fake_basic_info, expect_result): 173 def test_create_api_executor(self, fake_basic_info, expect_result):
@@ -180,8 +192,14 @@ class QnapShareDriverLoginTestCase(QnapShareDriverBaseTestCase):
180 'fake_basic_info': fakes.FakeGetBasicInfoResponseTesEs_1_1_1(), 192 'fake_basic_info': fakes.FakeGetBasicInfoResponseTesEs_1_1_1(),
181 'expect_result': exception.ShareBackendException 193 'expect_result': exception.ShareBackendException
182 }, { 194 }, {
195 'fake_basic_info': fakes.FakeGetBasicInfoResponseTesEs_2_2_0(),
196 'expect_result': exception.ShareBackendException
197 }, {
183 'fake_basic_info': fakes.FakeGetBasicInfoResponseEs_1_1_1(), 198 'fake_basic_info': fakes.FakeGetBasicInfoResponseEs_1_1_1(),
184 'expect_result': exception.ShareBackendException 199 'expect_result': exception.ShareBackendException
200 }, {
201 'fake_basic_info': fakes.FakeGetBasicInfoResponseEs_2_2_0(),
202 'expect_result': exception.ShareBackendException
185 }) 203 })
186 @ddt.unpack 204 @ddt.unpack
187 def test_create_api_executor_negative(self, 205 def test_create_api_executor_negative(self,
diff --git a/releasenotes/notes/qnap-support-qes-210-8775e6c210f3ca9f.yaml b/releasenotes/notes/qnap-support-qes-210-8775e6c210f3ca9f.yaml
new file mode 100644
index 0000000..34d70b0
--- /dev/null
+++ b/releasenotes/notes/qnap-support-qes-210-8775e6c210f3ca9f.yaml
@@ -0,0 +1,4 @@
1---
2features:
3 - |
4 QNAP Manila driver added support for QES fw 2.1.0.