tripleo-ci/scripts/emit_releases_file/test_unsupported_upgrades.py
Sofer Athlan-Guyot f3702f4335 Add standalone upgrade to emit release.
This also add dlrn_hash_newest variable to be able to make proper repo
switching.

The $title is just adding the necessary bits into emit_release to take
standalone_upgrade into account.

The dlrn_hash_newest is a forgotten variable from the initial emit
release.  It has been included for standalone upgrade where the
problem first appeared, but will likely be needed for other upgrade
jobs as well when they switch to non specific release file.

Currently we only set dlrn_hash which becomes TRIPLEO_DLRN_REPO which
becomes delorean url. We don't do anything about dlrn_hash_tag_newest
which becomes RDO_DLRN_REPO which becomes delorean-current.

This means that when we are upgrading we get the dlrn_hash_tag_newest
that was defined in the previous run, ie during deployment.

Change-Id: I0e298fc37eb7b3fd0afaa13ab021330b789b2f5e
Closes-Bug: #1795367
2018-10-24 00:18:40 +02:00

79 lines
2.4 KiB
Python

from emit_releases_file import compose_releases_dictionary
import pytest
@pytest.mark.parametrize('featureset', [{
'mixed_upgrade': True,
'overcloud_upgrade': True
}, {
'undercloud_upgrade': True
}])
def test_upgrade_to_newton_is_unsupported(featureset):
stable_release = 'newton'
upgrade_from = False
with pytest.raises(RuntimeError):
compose_releases_dictionary(stable_release, featureset, upgrade_from)
def test_only_mixed_overcloud_upgrades_are_supported():
featureset = {
'overcloud_upgrade': True,
'undercloud_upgrade': True,
}
stable_release = 'queens'
upgrade_from = False
with pytest.raises(RuntimeError):
compose_releases_dictionary(stable_release, featureset, upgrade_from)
def test_undercloud_upgrades_from_newton_to_ocata_are_unsupported():
featureset = {
'undercloud_upgrade': True,
}
stable_release = 'ocata'
upgrade_from = False
with pytest.raises(RuntimeError):
compose_releases_dictionary(stable_release, featureset, upgrade_from)
@pytest.mark.parametrize('upgrade_type',
['ffu_overcloud_upgrade', 'overcloud_upgrade'])
def test_overcloud_upgrades_has_to_be_mixed(upgrade_type):
featureset = {
upgrade_type: True,
}
stable_release = 'queens'
upgrade_from = False
with pytest.raises(RuntimeError):
compose_releases_dictionary(stable_release, featureset, upgrade_from)
@pytest.mark.parametrize('stable_release',
['ocata', 'pike', 'newton', 'rocky', 'master'])
def test_ffu_overcloud_upgrade_only_supported_from_newton(stable_release):
featureset = {
'mixed_upgrade': True,
'ffu_overcloud_upgrade': True,
}
upgrade_from = False
with pytest.raises(RuntimeError):
compose_releases_dictionary(stable_release, featureset, upgrade_from)
@pytest.mark.parametrize('stable_release',
['newton', 'ocata', 'pike', 'queens', 'rocky'])
def test_standalone_upgrade_only_supported_from_stein(stable_release):
featureset = {
'standalone_upgrade': True,
}
upgrade_from = False
with pytest.raises(RuntimeError):
compose_releases_dictionary(stable_release, featureset, upgrade_from)
def test_fail_with_wrong_release():
with pytest.raises(RuntimeError):
compose_releases_dictionary('foobar', {}, False)