summaryrefslogtreecommitdiff
path: root/test/sysv-generator-test.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/sysv-generator-test.py')
-rw-r--r--test/sysv-generator-test.py14
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__':