assert gp.dist_release == expected
-class TestGitbuilderProject(TestBuilderProject):
- klass = packaging.GitbuilderProject
-
- def setup(self):
- self.p_config = patch('teuthology.packaging.config')
- self.m_config = self.p_config.start()
- self.m_config.baseurl_template = \
- 'http://{host}/{proj}-{pkg_type}-{dist}-{arch}-{flavor}/{uri}'
- self.m_config.gitbuilder_host = "gitbuilder.ceph.com"
- self.p_get_config_value = \
- patch('teuthology.packaging._get_config_value_for_remote')
- self.m_get_config_value = self.p_get_config_value.start()
- self.m_get_config_value.return_value = None
- self.p_get = patch('requests.get')
- self.m_get = self.p_get.start()
- self.p_get_response = patch("teuthology.packaging._get_response")
- self.m_get_response = self.p_get_response.start()
-
- def teardown(self):
- self.p_config.stop()
- self.p_get_config_value.stop()
- self.p_get.stop()
- self.p_get_response.stop()
-
- def test_init_from_remote_base_url(self, expected=None):
- super(TestGitbuilderProject, self)\
- .test_init_from_remote_base_url(
- "http://gitbuilder.ceph.com/"
- "ceph-deb-trusty-x86_64-basic/ref/master"
- )
-
- def test_init_from_remote_base_url_debian(self):
- super(TestGitbuilderProject, self)\
- .test_init_from_remote_base_url_debian(
- "http://gitbuilder.ceph.com/"
- "ceph-deb-wheezy-x86_64-basic/ref/master"
- )
-
- def test_init_from_config_base_url(self):
- super(TestGitbuilderProject, self).test_init_from_config_base_url(
- "http://gitbuilder.ceph.com/ceph-deb-trusty-x86_64-basic/sha1/sha1"
- )
-
- def test_get_package_version_found(self):
- resp = Mock()
- resp.ok = True
- resp.text = "0.90.0"
- self.m_get_response.return_value = resp
- super(TestGitbuilderProject, self)\
- .test_get_package_version_found()
-
- def test_version_strip_v(self):
- resp = Mock()
- resp.ok = True
- resp.text = "v0.90.0"
- self.m_get_response.return_value = resp
- super(TestGitbuilderProject, self)\
- .test_get_package_version_found()
-
- def test_get_package_sha1_fetched_found(self):
- resp = Mock()
- resp.ok = True
- resp.text = "the_sha1"
- self.m_get.return_value = resp
- super(TestGitbuilderProject, self)\
- .test_get_package_sha1_fetched_found()
-
- def test_get_package_sha1_fetched_not_found(self):
- resp = Mock()
- resp.ok = False
- self.m_get.return_value = resp
- super(TestGitbuilderProject, self)\
- .test_get_package_sha1_fetched_not_found()
-
- DISTRO_MATRIX = [
- ('rhel', '7.0', None, 'centos7'),
- ('centos', '6.5', None, 'centos6'),
- ('centos', '7.0', None, 'centos7'),
- ('centos', '7.1', None, 'centos7'),
- ('centos', '8.1', None, 'centos8'),
- ('fedora', '20', None, 'fedora20'),
- ('ubuntu', '14.04', 'trusty', 'trusty'),
- ('ubuntu', '14.04', None, 'trusty'),
- ('debian', '7.0', None, 'wheezy'),
- ('debian', '7', None, 'wheezy'),
- ('debian', '7.1', None, 'wheezy'),
- ('ubuntu', '12.04', None, 'precise'),
- ('ubuntu', '14.04', None, 'trusty'),
- ('ubuntu', '16.04', None, 'xenial'),
- ('ubuntu', '18.04', None, 'bionic'),
- ('ubuntu', '20.04', None, 'focal'),
- ]
-
-
class TestShamanProject(TestBuilderProject):
klass = packaging.ShamanProject