blob: c119bbc8a441720955e8d035460ee003c0c13ee1 [file] [log] [blame]
Dennis Dmitriev7b9538f2017-05-15 17:01:34 +03001# Copyright 2016 Mirantis, Inc.
2#
3# Licensed under the Apache License, Version 2.0 (the "License"); you may
4# not use this file except in compliance with the License. You may obtain
5# a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12# License for the specific language governing permissions and limitations
13# under the License.
14import copy
15import os
16import time
17
18import pytest
19
20from tcp_tests import settings
21from tcp_tests.helpers import ext
22from tcp_tests import logger
23
24LOG = logger.logger
25
26
27class TestIronicStandalone(object):
28 """Test class for testing TCP deployment"""
29
30 @pytest.mark.fail_snapshot
31 def test_install_ironic_standalone(self, config, underlay):
32 """Install a VM with standalone ironic
33
34 Before using, please set the correct roles and timeout:
35
Dennis Dmitrievfa911f52017-05-15 17:42:22 +030036 export ROLES='["ironic_master"]'
Dennis Dmitriev7b9538f2017-05-15 17:01:34 +030037 export BOOTSTRAP_TIMEOUT=900
38
39 , and unset these variables after the bootstrap is completed.
40
41 Scenario:
42 1. Install Ironic service and helper services
43 2. Build ironic agent image
44 3. Download Ubuntu cloud image and calculate MD5
45 4. export environment variables to further use
46
47 """
Dennis Dmitriev7b9538f2017-05-15 17:01:34 +030048
Dennis Dmitriev82535812017-05-15 19:28:41 +030049 nodes = underlay.node_names()
50 host = underlay.host_by_node_name(nodes[0])
51 cmd = ("md5sum /httpboot/xenial-server-cloudimg-amd64.qcow2 "
52 "| awk '{print $1}'")
53 res = underlay.check_call(cmd, host=host, verbose=True)
Dennis Dmitriev7b9538f2017-05-15 17:01:34 +030054
Dennis Dmitriev82535812017-05-15 19:28:41 +030055 ironic_url = 'http://{0}:6385/'.format(host)
56
57 LOG.info("Ironic standalone server installed, to use it:\n\n"
58 "export OS_AUTH_TOKEN=fake-token\n"
59 "export IRONIC_URL={0}\n"
60 "export CLOUDINIT_IMAGE_MD5={1}"
61 .format(ironic_url, ''.join(res['stdout'])))