Browse code

Merge "Fix testing for the write-devstack-local-conf role"

Zuul authored on 2019/01/10 04:40:47
Showing 1 changed files
... ...
@@ -104,6 +104,22 @@ class TestDevstackLocalConf(unittest.TestCase):
104 104
                  plugins=plugins,
105 105
                  base_dir=self.tmpdir,
106 106
                  path=os.path.join(self.tmpdir, 'test.local.conf'))
107
+        lc = LocalConf(p.get('localrc'),
108
+                       p.get('local_conf'),
109
+                       p.get('base_services'),
110
+                       p.get('services'),
111
+                       p.get('plugins'),
112
+                       p.get('base_dir'),
113
+                       p.get('projects'),
114
+                       p.get('project'))
115
+        lc.write(p['path'])
116
+
117
+        plugins = []
118
+        with open(p['path']) as f:
119
+            for line in f:
120
+                if line.startswith('enable_plugin'):
121
+                    plugins.append(line.split()[1])
122
+        self.assertEqual(['foo', 'bar'], plugins)
107 123
 
108 124
     def test_libs_from_git(self):
109 125
         "Test that LIBS_FROM_GIT is auto-generated"