]> git-server-git.apps.pok.os.sepia.ceph.com Git - teuthology.git/commitdiff
More properly test ref precedence for Shaman
authorZack Cerza <zack@redhat.com>
Wed, 21 Sep 2016 23:19:44 +0000 (17:19 -0600)
committerZack Cerza <zack@redhat.com>
Tue, 4 Oct 2016 15:01:21 +0000 (09:01 -0600)
Signed-off-by: Zack Cerza <zack@redhat.com>
teuthology/test/test_packaging.py

index 9c99739ca683124c8d776145bb293d9bf78eb895..2d1ff8451ef162e9490f8ca2da3c822757b2bdbf 100644 (file)
@@ -384,6 +384,22 @@ class TestBuilderProject(object):
         assert result == expected
         expected_log = 'More than one of ref, tag, branch, or sha1 supplied; using tag'
         assert expected_log in caplog.text()
+        return gp
+
+    def test_init_from_config_branch_overrides_sha1(self, caplog):
+        config = dict(
+            os_type="ubuntu",
+            os_version="14.04",
+            branch='jewel',
+            sha1='sha1',
+        )
+        gp = self.klass("ceph", config)
+        result = gp.uri_reference
+        expected = 'ref/jewel'
+        assert result == expected
+        expected_log = 'More than one of ref, tag, branch, or sha1 supplied; using branch'
+        assert expected_log in caplog.text()
+        return gp
 
     REFERENCE_MATRIX = [
         ('the_ref', 'the_tag', 'the_branch', 'the_sha1', dict(ref='the_ref')),
@@ -660,6 +676,20 @@ class TestShamanProject(TestBuilderProject):
                 "&flavor=default&distros=ubuntu%2F14.04%2Fx86_64&sha1=sha1"
             )
 
+    def test_init_from_config_tag_overrides_branch_ref(self, caplog):
+        obj = super(TestShamanProject, self)\
+            .test_init_from_config_tag_overrides_branch_ref(caplog)
+        search_uri = obj._search_uri
+        assert 'v10.0.1' in search_uri
+        assert 'jewel' not in search_uri
+
+    def test_init_from_config_branch_overrides_sha1(self, caplog):
+        obj = super(TestShamanProject, self)\
+            .test_init_from_config_branch_overrides_sha1(caplog)
+        search_uri = obj._search_uri
+        assert 'jewel' in search_uri
+        assert 'sha1' not in search_uri
+
     def test_get_package_version_found(self):
         resp = Mock()
         resp.ok = True