From 6d9bb4bdc915b1ed6ac9d49012eb185a369cc624 Mon Sep 17 00:00:00 2001 From: "Walter A. Boring IV" Date: Mon, 10 Mar 2014 10:27:43 -0700 Subject: [PATCH] Fixed some FCZM unit tests hacking issues This patch is a follow up to a review that merged included and had some issues raised after it was merged. This patch includes some hacking cleanup and some unit test cleanup for the Fibre Channel Zone Manager. Change-Id: Ibb6974b2279f08720c2469893245bc888d35899c Closes-Bug: #1285029 --- cinder/tests/zonemanager/__init__.py | 14 -------------- .../zonemanager/test_brcd_fc_san_lookup_service.py | 3 +-- cinder/tests/zonemanager/test_volume_manager_fc.py | 7 +++++++ 3 files changed, 8 insertions(+), 16 deletions(-) diff --git a/cinder/tests/zonemanager/__init__.py b/cinder/tests/zonemanager/__init__.py index 31285c4fc21..e69de29bb2d 100644 --- a/cinder/tests/zonemanager/__init__.py +++ b/cinder/tests/zonemanager/__init__.py @@ -1,14 +0,0 @@ -# Copyright 2011 OpenStack Foundation -# All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. diff --git a/cinder/tests/zonemanager/test_brcd_fc_san_lookup_service.py b/cinder/tests/zonemanager/test_brcd_fc_san_lookup_service.py index 52ba43fd6fd..ca9c3a8920f 100644 --- a/cinder/tests/zonemanager/test_brcd_fc_san_lookup_service.py +++ b/cinder/tests/zonemanager/test_brcd_fc_san_lookup_service.py @@ -73,9 +73,8 @@ class TestBrcdFCSanLookupService(brcd_lookup.BrcdFCSanLookupService, default=22, help='')) fc_fabric_opts.append(cfg.StrOpt('principal_switch_wwn', default='100000051e55a100', help='')) - self.fabric_configs = {} config = conf.Configuration(fc_fabric_opts, 'BRCD_FAB_2') - self.fabric_configs['BRCD_FAB_2'] = config + self.fabric_configs = {'BRCD_FAB_2': config} @mock.patch.object(brcd_lookup.BrcdFCSanLookupService, 'get_nameserver_info') diff --git a/cinder/tests/zonemanager/test_volume_manager_fc.py b/cinder/tests/zonemanager/test_volume_manager_fc.py index d44a4a7e50f..a4d3ce3a5d4 100644 --- a/cinder/tests/zonemanager/test_volume_manager_fc.py +++ b/cinder/tests/zonemanager/test_volume_manager_fc.py @@ -71,6 +71,13 @@ class TestVolumeManager(manager.VolumeManager, test.TestCase): self.zonemanager = fc_zone_manager.ZoneManager( configuration=self.configuration) + def tearDown(self): + super(TestVolumeManager, self).tearDown() + self.configuration = None + self.db = None + self.driver = None + self.zonemanager = None + def __init__(self, *args, **kwargs): test.TestCase.__init__(self, *args, **kwargs)