import BaseHTTPServer
import httplib
+import logging as generic_logging
import shutil
import StringIO
import tempfile
LOG = logging.getLogger("cinder.volume.driver")
+#NOTE(rushiagr): A bug in Suds package
+# (https://fedorahosted.org/suds/ticket/359) causes nasty errors
+# with tests while using debug-level logging. Unfortunately,
+# the maintainers of the package stopped tending to any patch
+# requests almost two years back. So setting the logging level to
+# INFO here seems the only plausible workaround.
+generic_logging.getLogger('suds.mx.core').setLevel(generic_logging.INFO)
+
WSDL_HEADER = """<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<definitions xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:na="http://www.netapp.com/management/v1"
shutil.rmtree(self.tempdir)
super(NetAppDriverTestCase, self).tearDown()
- @test.skip_test("Failing due to suds error - skip until fixed")
def test_connect(self):
self.driver.check_for_setup_error()
- @test.skip_test("Failing due to suds error - skip until fixed")
def test_create_destroy(self):
self.driver._discover_luns()
self.driver._provision(self.VOLUME_NAME, None, self.PROJECT_ID,
def test_destroy_uncreated_volume(self):
self.driver._remove_destroy('fake-nonexistent-volume', self.PROJECT_ID)
- @test.skip_test("Failing due to suds error - skip until fixed")
def test_map_unmap(self):
self.driver._discover_luns()
self.driver._provision(self.VOLUME_NAME, None, self.PROJECT_ID,
self.driver.terminate_connection(volume, connector)
self.driver._remove_destroy(self.VOLUME_NAME, self.PROJECT_ID)
- @test.skip_test("Failing due to suds error - skip until fixed")
def test_clone(self):
self.driver._discover_luns()
self.driver._clone_lun(0, '/vol/vol/qtree/src', '/vol/vol/qtree/dst',
False)
- @test.skip_test("Failing due to suds error - skip until fixed")
def test_clone_fail(self):
self.driver._discover_luns()
self.driver._is_clone_done(0, '0', 'xxx')
hostname='localhost', port=8080, cache=False)
self.driver = driver
- @test.skip_test("Failing due to suds error - skip until fixed")
def test_connect(self):
self.driver.check_for_setup_error()
- @test.skip_test("Failing due to suds error - skip until fixed")
def test_create_destroy(self):
self.driver.create_volume(self.volume)
self.driver.delete_volume(self.volume)
- @test.skip_test("Failing due to suds error - skip until fixed")
def test_create_vol_snapshot_destroy(self):
self.driver.create_volume(self.volume)
self.driver.create_snapshot(self.snapshot)
self.driver.delete_snapshot(self.snapshot)
self.driver.delete_volume(self.volume)
- @test.skip_test("Failing due to suds error - skip until fixed")
def test_map_unmap(self):
self.driver.create_volume(self.volume)
updates = self.driver.create_export(None, self.volume)
self.driver.terminate_connection(self.volume, self.connector)
self.driver.delete_volume(self.volume)
- @test.skip_test("Failing due to suds error - skip until fixed")
def test_fail_vol_from_snapshot_creation(self):
self.driver.create_volume(self.volume)
try:
finally:
self.driver.delete_volume(self.volume)
- @test.skip_test("Failing due to suds error - skip until fixed")
def test_cloned_volume_destroy(self):
self.driver.create_volume(self.volume)
self.driver.create_cloned_volume(self.snapshot, self.volume)
self.driver.delete_volume(self.snapshot)
self.driver.delete_volume(self.volume)
- @test.skip_test("Failing due to suds error - skip until fixed")
def test_fail_cloned_volume_creation(self):
self.driver.create_volume(self.volume)
try:
init_found = True
query = FakeDirectCMODEServerHandler._get_child_by_name(request,
'query')
- if query:
+ if query is not None:
igroup_info = FakeDirectCMODEServerHandler._get_child_by_name(
query, 'initiator-group-info')
- if igroup_info:
+ if igroup_info is not None:
inits = FakeDirectCMODEServerHandler._get_child_by_name(
igroup_info, 'initiators')
- if inits:
+ if inits is not None:
init_info = \
FakeDirectCMODEServerHandler._get_child_by_name(
inits, 'initiator-info')