Dennis Dmitriev | 7b9538f | 2017-05-15 17:01:34 +0300 | [diff] [blame] | 1 | # 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 Dmitriev | 7b9538f | 2017-05-15 17:01:34 +0300 | [diff] [blame] | 14 | |
| 15 | import pytest |
| 16 | |
Dennis Dmitriev | 7b9538f | 2017-05-15 17:01:34 +0300 | [diff] [blame] | 17 | from tcp_tests import logger |
| 18 | |
| 19 | LOG = logger.logger |
| 20 | |
| 21 | |
| 22 | class 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 Dmitriev | fa911f5 | 2017-05-15 17:42:22 +0300 | [diff] [blame] | 31 | export ROLES='["ironic_master"]' |
Dennis Dmitriev | 7b9538f | 2017-05-15 17:01:34 +0300 | [diff] [blame] | 32 | 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 Dmitriev | 7b9538f | 2017-05-15 17:01:34 +0300 | [diff] [blame] | 43 | |
Dennis Dmitriev | 8253581 | 2017-05-15 19:28:41 +0300 | [diff] [blame] | 44 | 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 Dmitriev | 7b9538f | 2017-05-15 17:01:34 +0300 | [diff] [blame] | 49 | |
Dennis Dmitriev | 8253581 | 2017-05-15 19:28:41 +0300 | [diff] [blame] | 50 | 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']))) |