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:
parent
56401ac57a
commit
eb89bc1d25
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user