From 6d103a7ff845076da984afbd317cd8cf4504fb7a Mon Sep 17 00:00:00 2001 From: Jens Harbott Date: Wed, 19 Dec 2018 11:53:16 +0000 Subject: [PATCH] Fix testing for the write-devstack-local-conf role The test_plugin_deps function in the test code for the write-devstack-local-conf role was missing the import part of actually executing the code under test and asserting the expected result. Change-Id: I125870b13d2581cdec0dede11157b19b702565cd --- roles/write-devstack-local-conf/library/test.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/roles/write-devstack-local-conf/library/test.py b/roles/write-devstack-local-conf/library/test.py index 791552d1ad..65d327b267 100644 --- a/roles/write-devstack-local-conf/library/test.py +++ b/roles/write-devstack-local-conf/library/test.py @@ -104,6 +104,22 @@ class TestDevstackLocalConf(unittest.TestCase): plugins=plugins, base_dir=self.tmpdir, path=os.path.join(self.tmpdir, 'test.local.conf')) + lc = LocalConf(p.get('localrc'), + p.get('local_conf'), + p.get('base_services'), + p.get('services'), + p.get('plugins'), + p.get('base_dir'), + p.get('projects'), + p.get('project')) + lc.write(p['path']) + + plugins = [] + with open(p['path']) as f: + for line in f: + if line.startswith('enable_plugin'): + plugins.append(line.split()[1]) + self.assertEqual(['foo', 'bar'], plugins) def test_libs_from_git(self): "Test that LIBS_FROM_GIT is auto-generated"