]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
test_suite: add test for files without .yaml and .disable dirs
authorSamuel Just <sjust@redhat.com>
Wed, 13 May 2015 20:16:18 +0000 (13:16 -0700)
committerSamuel Just <sjust@redhat.com>
Wed, 13 May 2015 20:20:14 +0000 (13:20 -0700)
Signed-off-by: Samuel Just <sjust@redhat.com>
teuthology/test/test_suite.py

index 28bcd31cc7179516e8c3a7f62b8a4fcc6a501dbb..4280cf925c0070fc082e267740f24d749514a96b 100644 (file)
@@ -478,6 +478,76 @@ class TestBuildMatrix(object):
         assert len(result) == 11
         assert self.fragment_occurences(result, 'vps.yaml') == 1 / 11.0
 
+    def test_disable_extension(self):
+        fake_fs = {
+            'teuthology': {
+                'no-ceph': {
+                    '%': None,
+                    'clusters': {
+                        'single.yaml': None,
+                    },
+                    'distros': {
+                        'baremetal.yaml': None,
+                        'rhel7.0.yaml': None,
+                        'ubuntu12.04.yaml': None,
+                        'ubuntu14.04.yaml': None,
+                        'vps.yaml': None,
+                        'vps_centos6.5.yaml': None,
+                        'vps_debian7.yaml': None,
+                        'vps_rhel6.4.yaml': None,
+                        'vps_rhel6.5.yaml': None,
+                        'vps_rhel7.0.yaml': None,
+                        'vps_ubuntu14.04.yaml': None,
+                    },
+                    'tasks': {
+                        'teuthology.yaml': None,
+                    },
+                },
+            },
+        }
+        fake_listdir, fake_isfile, fake_isdir = make_fake_fstools(fake_fs)
+        result = suite.build_matrix('teuthology/no-ceph', fake_isfile,
+                                    fake_isdir, fake_listdir)
+        fake_fs2 = {
+            'teuthology': {
+                'no-ceph': {
+                    '%': None,
+                    'clusters': {
+                        'single.yaml': None,
+                    },
+                    'distros': {
+                        'baremetal.yaml': None,
+                        'rhel7.0.yaml': None,
+                        'ubuntu12.04.yaml': None,
+                        'ubuntu14.04.yaml': None,
+                        'vps.yaml': None,
+                        'vps_centos6.5.yaml': None,
+                        'vps_debian7.yaml': None,
+                        'vps_rhel6.4.yaml': None,
+                        'vps_rhel6.5.yaml': None,
+                        'vps_rhel7.0.yaml': None,
+                        'vps_ubuntu14.04.yaml': None,
+                        'forcefilevps_ubuntu14.04.yaml.disable': None,
+                        'forcefilevps_ubuntu14.04.yaml.anotherextension': None,
+                    },
+                    'tasks': {
+                        'teuthology.yaml': None,
+                        'forcefilevps_ubuntu14.04notyaml': None,
+                    },
+                    'forcefilevps_ubuntu14.04notyaml': None,
+                    'tasks.disable': {
+                        'teuthology2.yaml': None,
+                        'forcefilevps_ubuntu14.04notyaml': None,
+                    },
+                },
+            },
+        }
+        fake_listdir2, fake_isfile2, fake_isdir2 = make_fake_fstools(fake_fs2)
+        result2 = suite.build_matrix('teuthology/no-ceph', fake_isfile2,
+                                     fake_isdir2, fake_listdir2)
+        assert len(result) == 11
+        assert len(result2) == len(result)
+
     def test_sort_order(self):
         # This test ensures that 'ceph' comes before 'ceph-thrash' when yaml
         # fragments are sorted.