[systemd-commits] test/sysv-generator-test.py
Martin Pitt
martin at kemper.freedesktop.org
Wed Jan 21 00:46:34 PST 2015
test/sysv-generator-test.py | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
New commits:
commit 56401ac57a543395d06690768e63b92633ad15dd
Author: Martin Pitt <martin.pitt at ubuntu.com>
Date: Wed Jan 21 09:45:15 2015 +0100
systemd-sysv-generator test: don't parse symlinks
Generated services which are symlinks should be tested/handled differently from
files, so ignore them in run_generator()'s result parsing.
diff --git a/test/sysv-generator-test.py b/test/sysv-generator-test.py
index 028de91..492e99d 100644
--- a/test/sysv-generator-test.py
+++ b/test/sysv-generator-test.py
@@ -74,6 +74,8 @@ class SysvGeneratorTest(unittest.TestCase):
results = {}
for service in glob(self.out_dir + '/*.service'):
+ if os.path.islink(service):
+ continue
cp = RawConfigParser()
cp.optionxform = lambda o: o # don't lower-case option names
with open(service) as f:
@@ -260,8 +262,9 @@ class SysvGeneratorTest(unittest.TestCase):
'''multiple Provides: names'''
self.add_sysv('foo', {'Provides': 'foo bar baz'})
- s = self.run_generator()[1]['foo.service']
- self.assertEqual(set(s.options('Unit')),
+ err, results = self.run_generator()
+ self.assertEqual(list(results), ['foo.service'])
+ self.assertEqual(set(results['foo.service'].options('Unit')),
set(['Documentation', 'SourcePath', 'Description']))
# should create symlinks for the alternative names
for f in ['bar.service', 'baz.service']:
More information about the systemd-commits
mailing list