]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
Add reproducer for teuthology-suite regression
authorZack Cerza <zack@redhat.com>
Wed, 27 Jul 2016 18:38:05 +0000 (12:38 -0600)
committerZack Cerza <zack@redhat.com>
Wed, 27 Jul 2016 19:48:17 +0000 (13:48 -0600)
http://tracker.ceph.com/issues/16838

Signed-off-by: Zack Cerza <zack@redhat.com>
teuthology/suite/test/test_run_.py

index 182e1ed3a2e2558d5f271b10ce090c88e2d79191..d9898de222098ce2eaa00f028ae3e8b4862d1731 100644 (file)
@@ -4,7 +4,7 @@ import requests
 import yaml
 
 from datetime import datetime
-from mock import patch, call, ANY
+from mock import patch, call, ANY, DEFAULT
 from StringIO import StringIO
 
 from teuthology.config import config, YamlConfig
@@ -130,6 +130,45 @@ class TestRun(object):
         with pytest.raises(ScheduleFailError):
             self.klass(self.args)
 
+    @patch('teuthology.suite.run.util.fetch_repos')
+    @patch('teuthology.suite.run.util.git_branch_exists')
+    @patch('teuthology.suite.run.util.package_version_for_hash')
+    @patch('teuthology.suite.run.util.git_ls_remote')
+    def test_regression(
+        self,
+        m_git_ls_remote,
+        m_package_version_for_hash,
+        m_git_branch_exists,
+        m_fetch_repos,
+    ):
+        config.gitbuilder_host = 'example.com'
+        m_package_version_for_hash.return_value = 'ceph_hash'
+        m_git_branch_exists.return_value = True
+        m_git_ls_remote.return_value = "suite_branch"
+        self.args_dict = {
+            'base_yaml_paths': [],
+            'ceph_branch': 'master',
+            'machine_type': 'smithi',
+            'kernel_flavor': 'basic',
+            'kernel_branch': 'testing',
+            'suite': 'krbd',
+        }
+        self.args = YamlConfig.from_dict(self.args_dict)
+        with patch.multiple(
+            'teuthology.suite.util.GitbuilderProject',
+            _get_package_sha1=DEFAULT,
+        ) as m:
+            assert m != dict()
+            m['_get_package_sha1'].return_value = 'SHA1'
+            conf = dict(
+                os_type='ubuntu',
+                os_version='16.04',
+            )
+            assert run.util.GitbuilderProject('ceph', conf).sha1 == 'SHA1'
+            run_ = self.klass(self.args)
+            assert run_.base_config['kernel']['sha1'] == 'SHA1'
+
+
 class TestScheduleSuite(object):
     klass = run.Run