blob: 2a76e9f3f3815585c880670d15227a771fadbf76 [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.
Dennis Dmitriev7b9538f2017-05-15 17:01:34 +030014
15import pytest
16
Dennis Dmitriev7b9538f2017-05-15 17:01:34 +030017from tcp_tests import logger
18
19LOG = logger.logger
20
21
22class TestIronicStandalone(object):
23 """Test class for testing TCP deployment"""
24
25 @pytest.mark.fail_snapshot
26 def test_install_ironic_standalone(self, config, underlay):
27 """Install a VM with standalone ironic
28
29 Before using, please set the correct roles and timeout:
30
Dennis Dmitrievfa911f52017-05-15 17:42:22 +030031 export ROLES='["ironic_master"]'
Dennis Dmitriev7b9538f2017-05-15 17:01:34 +030032 export BOOTSTRAP_TIMEOUT=900
33
34 , and unset these variables after the bootstrap is completed.
35
36 Scenario:
37 1. Install Ironic service and helper services
38 2. Build ironic agent image
39 3. Download Ubuntu cloud image and calculate MD5
40 4. export environment variables to further use
41
42 """
Dennis Dmitriev7b9538f2017-05-15 17:01:34 +030043
Dennis Dmitriev82535812017-05-15 19:28:41 +030044 nodes = underlay.node_names()
45 host = underlay.host_by_node_name(nodes[0])
46 cmd = ("md5sum /httpboot/xenial-server-cloudimg-amd64.qcow2 "
47 "| awk '{print $1}'")
48 res = underlay.check_call(cmd, host=host, verbose=True)
Dennis Dmitriev7b9538f2017-05-15 17:01:34 +030049
Dennis Dmitriev82535812017-05-15 19:28:41 +030050 ironic_url = 'http://{0}:6385/'.format(host)
51
52 LOG.info("Ironic standalone server installed, to use it:\n\n"
53 "export OS_AUTH_TOKEN=fake-token\n"
54 "export IRONIC_URL={0}\n"
55 "export CLOUDINIT_IMAGE_MD5={1}"
56 .format(ironic_url, ''.join(res['stdout'])))