예제 #1
0
    def test_validate_instance_and_node(self, mock_gbiui):
        node_uuid = 'aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee'
        instance_uuid = uuidutils.generate_uuid()
        node = ironic_utils.get_test_node(uuid=node_uuid,
                                          instance_uuid=instance_uuid)
        instance = fake_instance.fake_instance_obj(self.ctx,
                                                   uuid=instance_uuid)
        icli = cw.IronicClientWrapper()

        mock_gbiui.return_value = node
        result = ironic_driver.validate_instance_and_node(icli, instance)
        self.assertEqual(result.uuid, node_uuid)
예제 #2
0
    def test_validate_instance_and_node(self, mock_gbiui):
        node_uuid = 'aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee'
        instance_uuid = uuidutils.generate_uuid()
        node = ironic_utils.get_test_node(uuid=node_uuid,
                                          instance_uuid=instance_uuid)
        instance = fake_instance.fake_instance_obj(self.ctx,
                                                   uuid=instance_uuid)
        icli = cw.IronicClientWrapper()

        mock_gbiui.return_value = node
        result = ironic_driver.validate_instance_and_node(icli, instance)
        self.assertEqual(result.uuid, node_uuid)
예제 #3
0
    def test_validate_instance_and_node(self):
        node_uuid = 'aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee'
        instance_uuid = uuidutils.generate_uuid()
        node = ironic_utils.get_test_node(uuid=node_uuid,
                                          instance_uuid=instance_uuid)
        instance = fake_instance.fake_instance_obj(self.ctx,
                                                   uuid=instance_uuid)
        icli = cw.IronicClientWrapper()

        with mock.patch.object(FAKE_CLIENT.node, 'get_by_instance_uuid') \
            as mock_gbiui:
            mock_gbiui.return_value = node
            result = ironic_driver.validate_instance_and_node(icli, instance)
            self.assertEqual(result.uuid, node_uuid)
예제 #4
0
파일: test_driver.py 프로젝트: nkaul/ironic
    def test_validate_instance_and_node(self):
        node_uuid = 'aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee'
        instance_uuid = uuidutils.generate_uuid()
        node = ironic_utils.get_test_node(uuid=node_uuid,
                                          instance_uuid=instance_uuid)
        instance = fake_instance.fake_instance_obj(self.ctx,
                                                   uuid=instance_uuid)
        icli = cw.IronicClientWrapper()

        with mock.patch.object(FAKE_CLIENT.node, 'get_by_instance_uuid') \
            as mock_gbiui:
            mock_gbiui.return_value = node
            result = ironic_driver.validate_instance_and_node(icli, instance)
            self.assertEqual(result.uuid, node_uuid)