Add possibility to update ccp.yaml

- fix test_err_ccp_exit_codes
- test should failed due to LB #1628046

Change-Id: Iba1a8a9ef8a6e74ddc3b06fc80dfff43fe35eae6
This commit is contained in:
Egor Kotko 2016-09-30 14:19:37 +02:00
parent 762cb1d492
commit 2c8346d1f1
2 changed files with 33 additions and 11 deletions

View File

@ -56,7 +56,7 @@ class CCPManager(object):
LOG.info("Use defaults config from ccp")
cmd = ('cat fuel-ccp/etc/topology-example.yaml '
'>> {deploy_config}').format(
deploy_config=settings.DEPLOY_CONFIG)
deploy_config=settings.DEPLOY_CONFIG)
remote.check_call(cmd, verbose=True)
@property

View File

@ -15,6 +15,7 @@
import pytest
from fuel_ccp_tests.helpers import ext
from fuel_ccp_tests.helpers import utils
from fuel_ccp_tests.logger import logger
@ -44,20 +45,32 @@ class TestCppCliErrorInFetch(object):
@pytest.mark.fail_snapshot
def test_wrong_repo_name(self, admin_node):
cmd = ('ccp --repositories-names maria fetch')
utils.update_yaml(["repositories"], {'names': ['fuel-ccp-maria']},
yaml_file='./.ccp.yaml', remote=admin_node)
cmd = 'ccp fetch'
admin_node.check_call(cmd, expected=[1], verbose=True)
@pytest.mark.fail_snapshot
def test_wrong_repo_url(self, admin_node):
cmd = ('ccp --repositories-fuel-ccp-debian-base '
'http://example.org fetch')
utils.update_yaml(
["repositories"], {'names': ['fuel-ccp-debian-base']},
yaml_file="./.ccp.yaml", remote=admin_node)
utils.update_yaml(
["repositories"], {'fuel_ccp_debian_base': 'http://example.org'},
yaml_file="./.ccp.yaml", remote=admin_node)
cmd = 'ccp fetch'
admin_node.check_call(cmd, expected=[1], verbose=True)
clean_repos(admin_node)
@pytest.mark.fail_snapshot
def test_wrong_scheme_url(self, admin_node):
cmd = ('ccp --repositories-fuel-ccp-debian-base '
'htt://example.org fetch')
utils.update_yaml(
["repositories"], {'names': ['fuel-ccp-debian-base']},
yaml_file="./.ccp.yaml", remote=admin_node)
utils.update_yaml(
["repositories"], {'fuel_ccp_debian_base': 'htt://example.org'},
yaml_file="./.ccp.yaml", remote=admin_node)
cmd = 'ccp fetch'
admin_node.check_call(cmd, expected=[1], verbose=True)
clean_repos(admin_node)
@ -73,14 +86,20 @@ class TestCppCliBuildExitCode(object):
module pytest.mark: ccp_cli_errexit_codes
"""
@pytest.mark.fail_snapshot
def test_nonexistent_repo_name(self, admin_node):
cmd = 'ccp build --components example'
def test_nonexistent_repo_name_build(self, admin_node):
utils.update_yaml(
['action'], {'components': ['example']},
yaml_file="./.ccp.yaml", remote=admin_node)
cmd = 'ccp build'
admin_node.check_call(cmd, expected=[1], verbose=True)
clean_repos(admin_node)
@pytest.mark.fail_snapshot
def test_error_build_image(self, admin_node):
cmd = ('ccp --repositories-names fuel-ccp-debian-base fetch && '
utils.update_yaml(
['repositories'], {'names': ['fuel-ccp-debian-base']},
yaml_file="./.ccp.yaml", remote=admin_node)
cmd = ('ccp fetch && '
'echo "RUN exit 1" >> '
'~/ccp-repos/fuel-ccp-debian-base/'
'docker/base/Dockerfile.j2')
@ -102,8 +121,11 @@ class TestCppCliDeploy(object):
"""
@pytest.mark.fail_snapshot
def test_nonexistent_repo_name(self, admin_node):
cmd = 'ccp deploy --components example'
def test_nonexistent_repo_name_deploy(self, admin_node):
utils.update_yaml(
['action'], {'components': ['example']},
yaml_file="./.ccp.yaml", remote=admin_node)
cmd = 'ccp deploy'
admin_node.check_call(cmd, expected=[1], verbose=True)
clean_repos(admin_node)