diff options
author | Martin Pitt <martin.pitt@ubuntu.com> | 2015-01-21 15:30:01 +0100 |
---|---|---|
committer | Martin Pitt <martin.pitt@ubuntu.com> | 2015-01-21 15:30:01 +0100 |
commit | d816e2b7909e50ee887e1a0a825db760cf6fd3b0 (patch) | |
tree | 1370ed47241c3d45c0469944a9d20d136b05cdce | |
parent | c7088e4999f2e5dd33259948c806f4e2706e77ce (diff) |
systemd-sysv-generator test: test scripts with hidden suffixes
We don't expect any unit generated from temporary package manager, swap, and
similar files.
-rw-r--r-- | test/sysv-generator-test.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/sysv-generator-test.py b/test/sysv-generator-test.py index a3daa9fc6b..df13c98e29 100644 --- a/test/sysv-generator-test.py +++ b/test/sysv-generator-test.py @@ -313,6 +313,20 @@ class SysvGeneratorTest(unittest.TestCase): self.assertEqual(os.readlink(os.path.join(self.out_dir, 'bar.service')), 'foo.service') + def test_hidden_files(self): + '''init.d script with hidden file suffix''' + + script = self.add_sysv('foo', {}, enable=True) + # backup files (not enabled in rcN.d/) + shutil.copy(script, script + '.dpkg-new') + shutil.copy(script, script + '.dpkg-dist') + shutil.copy(script, script + '.swp') + shutil.copy(script, script + '.rpmsave') + + err, results = self.run_generator() + self.assertEqual(list(results), ['foo.service']) + + self.assert_enabled('foo.service', [2, 3, 4, 5]) if __name__ == '__main__': |