diff --git a/Dockerfile-controllers.test b/Dockerfile-controllers.test index b9a4474dc..86c6a129c 100644 --- a/Dockerfile-controllers.test +++ b/Dockerfile-controllers.test @@ -16,7 +16,7 @@ # This Dockerfile.test is for running the csi controller local tests inside a container. # Its similar to the Dockerfile, but with additional requirements-tests.txt and ENTRYPOINT to run the local tests. -FROM registry.access.redhat.com/ubi8/python-38:1-131 as builder +FROM registry.access.redhat.com/ubi8/python-38:1-131 AS builder USER root RUN if [[ "$(uname -m)" != "x86"* ]]; then yum install -y rust-toolset; fi USER default diff --git a/Dockerfile-csi-controller b/Dockerfile-csi-controller index e271db885..6b75b633e 100644 --- a/Dockerfile-csi-controller +++ b/Dockerfile-csi-controller @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -FROM registry.access.redhat.com/ubi8/python-38:1-131 as builder +FROM registry.access.redhat.com/ubi8/python-38:1-131 AS builder USER root RUN if [[ "$(uname -m)" != "x86"* ]]; then yum install -y rust-toolset; fi diff --git a/Dockerfile-csi-host-definer b/Dockerfile-csi-host-definer index 8bfb99002..38a3b237e 100644 --- a/Dockerfile-csi-host-definer +++ b/Dockerfile-csi-host-definer @@ -1,4 +1,4 @@ -FROM registry.access.redhat.com/ubi8/python-38:1-131 as builder +FROM registry.access.redhat.com/ubi8/python-38:1-131 AS builder USER root RUN yum update -y diff --git a/Dockerfile-csi-node b/Dockerfile-csi-node index 79dc1d04e..861082187 100644 --- a/Dockerfile-csi-node +++ b/Dockerfile-csi-node @@ -13,7 +13,7 @@ # limitations under the License. # Build stage -FROM golang:1.20 as builder +FROM golang:1.20 AS builder WORKDIR /go/src/github.com/ibm/ibm-block-csi-driver ENV GO111MODULE=on diff --git a/Dockerfile-csi-node.test b/Dockerfile-csi-node.test index 9d19ecbaa..1cd73fec9 100644 --- a/Dockerfile-csi-node.test +++ b/Dockerfile-csi-node.test @@ -13,7 +13,7 @@ # limitations under the License. # Build stage -FROM golang:1.20 as builder +FROM golang:1.20 AS builder WORKDIR /go/src/github.com/ibm/ibm-block-csi-driver ENV GO111MODULE=on diff --git a/controllers/tests/array_action/abstract/test_array_mediator_abstract.py b/controllers/tests/array_action/abstract/test_array_mediator_abstract.py index 5be1c8e9f..14c73c07e 100644 --- a/controllers/tests/array_action/abstract/test_array_mediator_abstract.py +++ b/controllers/tests/array_action/abstract/test_array_mediator_abstract.py @@ -4,7 +4,6 @@ import controllers.array_action.errors as array_errors import controllers.tests.array_action.test_settings as array_settings import controllers.tests.common.test_settings as common_settings -from controllers.array_action.array_action_types import Host from controllers.array_action.array_mediator_abstract import ArrayMediatorAbstract from controllers.common.node_info import Initiators from controllers.tests import utils @@ -40,8 +39,6 @@ class BaseMediatorAbstractSetUp(unittest.TestCase): def setUp(self): self.mediator = _get_array_mediator_abstract_class() - self.mediator.get_volume_mappings.return_value = {} - self.fc_ports = [array_settings.DUMMY_FC_WWN1, array_settings.DUMMY_FC_WWN2] self.lun_id = array_settings.DUMMY_LUN_ID self.connectivity_type = array_settings.FC_CONNECTIVITY_TYPE @@ -89,33 +86,6 @@ def test_map_volume_by_initiators_get_iscsi_targets_by_iqn_excpetions(self): with self.assertRaises(array_errors.NoIscsiTargetsFoundError): self.mediator.map_volume_by_initiators('', self.initiators) - def test_map_volume_by_initiators_get_volume_mappings_more_then_one_mapping(self): - self.mediator.get_volume_mappings.return_value = {array_settings.DUMMY_HOST_ID1: array_settings.DUMMY_HOST_ID1, - array_settings.DUMMY_HOST_ID2: array_settings.DUMMY_HOST_ID2} - - with self.assertRaises(array_errors.VolumeAlreadyMappedToDifferentHostsError): - self.mediator.map_volume_by_initiators('', self.initiators) - - def test_map_volume_by_initiators_get_volume_mappings_one_mapping(self): - self.mediator.get_volume_mappings.return_value = {array_settings.DUMMY_HOST_ID1: array_settings.DUMMY_HOST_ID1} - self.mediator.get_host_by_name.return_value = Host(name=self.hostname, - connectivity_types=[array_settings.ISCSI_CONNECTIVITY_TYPE], - iscsi_iqns=[self.iqn]) - - with self.assertRaises(array_errors.VolumeAlreadyMappedToDifferentHostsError): - self.mediator.map_volume_by_initiators('', self.initiators) - - def test_map_volume_by_initiators_get_volume_mappings_one_map_for_existing_host(self): - self.mediator.get_volume_mappings = Mock() - self.mediator.get_volume_mappings.return_value = {self.hostname: self.lun_id} - self.mediator.get_host_by_name.return_value = Host(name=self.hostname, - connectivity_types=[array_settings.ISCSI_CONNECTIVITY_TYPE], - iscsi_iqns=[self.iqn]) - - self.initiators.iscsi_iqns = [self.iqn] - response = self.mediator.map_volume_by_initiators('', self.initiators) - self.assertEqual((self.lun_id, array_settings.ISCSI_CONNECTIVITY_TYPE, self.iscsi_targets_by_iqn), response) - def test_map_volume_by_initiators_map_volume_excpetions(self): self.mediator.map_volume.side_effect = [array_errors.PermissionDeniedError('')]