mirror of
https://github.com/systemd/systemd.git
synced 2024-12-23 21:35:11 +03:00
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.
This commit is contained in:
parent
e28aa588f0
commit
56401ac57a
@ -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']:
|
||||
|
Loading…
Reference in New Issue
Block a user