Add stable/stein branch support to fedora

Currently fedora only supports master release. Add stein support
to retrieve https://trunk.rdoproject.org/fedora28-stein/.

Change-Id: Ifbf0050b9899741c11faca22a6071de75fec97ee
This commit is contained in:
Rafael Folco 2019-03-28 14:51:36 -03:00
parent a7bc8dc4ab
commit d12fb5548d
2 changed files with 13 additions and 4 deletions

View File

@ -228,8 +228,9 @@ def _remove_existing(args):
def _get_base_path(args): def _get_base_path(args):
if args.branch != 'master': if args.branch != 'master':
if args.distro not in ['centos7']: if args.distro in ['fedora28'] and args.branch != 'stein':
raise InvalidArguments('Branches only suppported with centos7') raise InvalidArguments('Only stable/stein branch is suppported '
'with fedora28.')
distro_branch = '%s-%s' % (args.distro, args.branch) distro_branch = '%s-%s' % (args.distro, args.branch)
else: else:
distro_branch = args.distro distro_branch = args.distro

View File

@ -130,12 +130,20 @@ class TestTripleORepos(testtools.TestCase):
path = main._get_base_path(args) path = main._get_base_path(args)
self.assertEqual('http://trunk.rdoproject.org/fedora/', path) self.assertEqual('http://trunk.rdoproject.org/fedora/', path)
def test_get_base_path_fedora_branch(self): def test_get_base_path_fedora_unsup_branch(self):
args = mock.Mock() args = mock.Mock()
args.branch = 'rocky' args.branch = 'rocky'
args.distro = 'fedora' args.distro = 'fedora28'
self.assertRaises(main.InvalidArguments, main._get_base_path, args) self.assertRaises(main.InvalidArguments, main._get_base_path, args)
def test_get_base_path_fedora_sup_branch(self):
args = mock.Mock()
args.branch = 'stein'
args.distro = 'fedora28'
args.rdo_mirror = 'http://trunk.rdoproject.org'
path = main._get_base_path(args)
self.assertEqual('http://trunk.rdoproject.org/fedora28-stein/', path)
@mock.patch('subprocess.check_call') @mock.patch('subprocess.check_call')
def test_install_priorities(self, mock_check_call): def test_install_priorities(self, mock_check_call):
main._install_priorities() main._install_priorities()