)
-def get_gitbuilder_url(project, distro, pkg_type, arch, kernel_flavor):
- """
- Return a base URL like:
- http://gitbuilder.ceph.com/ceph-deb-squeeze-x86_64-basic/
-
- :param project: 'ceph' or 'kernel'
- :param distro: A distro-ish string like 'trusty' or 'fedora20'
- :param pkg_type: Probably 'rpm' or 'deb'
- :param arch: A string like 'x86_64'
- :param kernel_flavor: A string like 'basic'
- """
- templ = 'http://{host}/{proj}-{pkg}-{distro}-{arch}-{flav}/'
- return templ.format(proj=project, pkg=pkg_type, distro=distro, arch=arch,
- flav=kernel_flavor, host=config.gitbuilder_host)
-
-
def package_version_for_hash(hash, kernel_flavor='basic',
distro='rhel', machine_type='plana'):
"""
'mtype', user='USER')
assert name.startswith('USER-')
- def test_gitbuilder_url(self):
- ref_url = "http://{host}/ceph-deb-squeeze-x86_64-basic/".format(
- host=config.gitbuilder_host
- )
- assert suite.get_gitbuilder_url('ceph', 'squeeze', 'deb', 'x86_64',
- 'basic') == ref_url
-
def test_substitute_placeholders(self):
suite_hash = 'suite_hash'
input_dict = dict(
input_dict)
assert 'os_type' not in output_dict
- @patch('teuthology.suite.get_gitbuilder_url')
@patch('requests.get')
- def test_get_hash_success(self, m_get, m_get_gitbuilder_url):
- m_get_gitbuilder_url.return_value = "http://baseurl.com"
+ def test_get_hash_success(self, m_get):
mock_resp = Mock()
mock_resp.ok = True
mock_resp.text = "the_hash"
result = suite.get_gitbuilder_hash()
assert result == "the_hash"
- @patch('teuthology.suite.get_gitbuilder_url')
@patch('requests.get')
- def test_get_hash_fail(self, m_get, m_get_gitbuilder_url):
- m_get_gitbuilder_url.return_value = "http://baseurl.com"
+ def test_get_hash_fail(self, m_get):
mock_resp = Mock()
mock_resp.ok = False
m_get.return_value = mock_resp