]> git-server-git.apps.pok.os.sepia.ceph.com Git - teuthology.git/commitdiff
packaging.GitbuilderProject: add a test to ensure base_url is correct for wheezy
authorAndrew Schoen <aschoen@redhat.com>
Tue, 11 Aug 2015 16:20:42 +0000 (11:20 -0500)
committerAndrew Schoen <aschoen@redhat.com>
Thu, 13 Aug 2015 20:06:26 +0000 (15:06 -0500)
remote.os.codename returns an empty string for debian which resulted in
the base_url missing the 'wheezy' part of it, this fixes that.

Signed-off-by: Andrew Schoen <aschoen@redhat.com>
teuthology/test/test_packaging.py

index 67ba2a8926751e8d1685ba747e9a017cff7a5a29..7559b817d073631f5f7b5cd470dffc132636fae9 100644 (file)
@@ -303,6 +303,20 @@ class TestGitbuilderProject(object):
         expected = "http://gitbuilder.ceph.com/ceph-deb-trusty-x86_64-basic/ref/master"
         assert result == expected
 
+    @patch("teuthology.packaging.config")
+    @patch("teuthology.packaging._get_config_value_for_remote")
+    def test_init_from_remote_base_url_debian(self, m_get_config_value, m_config):
+        m_config.baseurl_template = 'http://{host}/{proj}-{pkg_type}-{dist}-{arch}-{flavor}/{uri}'
+        m_config.gitbuilder_host = "gitbuilder.ceph.com"
+        m_get_config_value.return_value = None
+        # remote.os.codename returns and empty string on debian
+        rem = self._get_remote(distro="debian", codename='', version="7.1")
+        ctx = dict(foo="bar")
+        gp = packaging.GitbuilderProject("ceph", {}, ctx=ctx, remote=rem)
+        result = gp.base_url
+        expected = "http://gitbuilder.ceph.com/ceph-deb-wheezy-x86_64-basic/ref/master"
+        assert result == expected
+
     @patch("teuthology.packaging.config")
     def test_init_from_config_base_url(self, m_config):
         m_config.baseurl_template = 'http://{host}/{proj}-{pkg_type}-{dist}-{arch}-{flavor}/{uri}'