1
0
mirror of https://github.com/systemd/systemd.git synced 2024-12-23 21:35:11 +03:00

systemd-sysv-generator test: fix enabled check

Fix hardcoded "foo.service", test for the actual unit parameter.
This commit is contained in:
Martin Pitt 2015-01-21 10:21:08 +01:00
parent 56401ac57a
commit eb89bc1d25

View File

@ -133,11 +133,11 @@ class SysvGeneratorTest(unittest.TestCase):
# should be enabled
for runlevel in all_runlevels:
link = os.path.join(self.out_dir, 'runlevel%i.target.wants' % runlevel, 'foo.service')
link = os.path.join(self.out_dir, 'runlevel%i.target.wants' % runlevel, unit)
if runlevel in runlevels:
target = os.readlink(link)
self.assertTrue(os.path.exists(target))
self.assertEqual(os.path.basename(target), 'foo.service')
self.assertEqual(os.path.basename(target), unit)
else:
self.assertFalse(os.path.exists(link),
'%s unexpectedly exists' % link)