History log of /systemd/test/sysv-generator-test.py
Revision Date Author Comments Expand
c584ffc0b75d4b9e9229bf1d8edb7d89562be3c1 21-Jan-2016 Lukas Nykryn <lnykryn@redhat.com>

sysv-generator: do not join dependencies on one line, split them If there is a lot of initscripts and dependencies between them we might end generating After= (and similar) lines which are longer then LINE_MAX and thus rejected by parser in systemd. Fixes #2099

52a321d839b366d40fdd72bbb6c494016fa3d608 01-Jul-2015 Martin Pitt <martin.pitt@ubuntu.com>

sysv-generator test: Fix random ordering failure test_simple_escaped() sometimes fails with AssertionError: Lists differ: ['foo\\x2b.service', 'foo-admin.service'] != ['foo-admin.service', 'foo\\x2b.service'] We don't need to assume any order here, so compare them as a set, not a list.

264581a2f1599a27de577549dc75fccefef6a579 29-Jun-2015 Felipe Sateler <fsateler@debian.org>

sysv-generator: escape names when translating from sysv name While the LSB suggests only [A-Za-z0-9], that doesn't prevent admins from doing the wrong thing. Lets not generate invalid names in that case.

6b7d32add4733a83f86e18bb86f914037a6688b7 15-Jun-2015 Martin Pitt <martin.pitt@ubuntu.com>

sysv-generator test: always log to console Set $SYSTEMD_LOG_TARGET so that the output always goes to stdout/stderr. This fixes running the test as root, as that logged to the journal previously. https://github.com/systemd/systemd/issues/195

230f04856647fcfb07d5658f4b8c1cb3557fa0d8 28-Apr-2015 Alberto Fanjul Alonso <albertofanjul@gmail.com>

sysv-generator test: Fix assertion

4e5589836c9e143796c3f3d81e67ab7a9209e2b0 19-Feb-2015 Martin Pitt <martin.pitt@ubuntu.com>

sysv-generator: fix wrong "Overwriting existing symlink" warnings Fix result testing of is_symlink() to ignore negative results, which happen if the file name does not exist at all. In this case we do not want a warning and unlink the non-existing link. https://bugs.debian.org/778700

0377e373d1b4973effe14ca19e21f0c10740085d 19-Feb-2015 Martin Pitt <martin.pitt@ubuntu.com>

systemd-sysv-generator test: Adjust to dropped runlevelN.target mapping Commit d5d8429a dropped the explicit runlevelN.target mapping. Adjust the tests accordingly to explicitly state the expected targets instead of runlevels.

f4f01ec146d91cb6943828851d98eee6a1ad4dd9 11-Feb-2015 Martin Pitt <martin.pitt@ubuntu.com>

sysv-generator: Skip init scripts for existing native services This avoids taking the SysV init script enablement state into account if we have native units. Otherwise systemctl disable on native unit would not be respected in the presence of an enabled SysV script. Also, there's no need to do all the parsing and creation of service files if we already have a native systemd unit for the processed SysV init script.

77354c7e6f096a447245a8781c1eaa4acbe67089 21-Jan-2015 Martin Pitt <martin.pitt@ubuntu.com>

sysv-generator: Replace Provides: symlinks with real units Since commit b7e7184 the SysV generator creates symlinks for all "Provides:" in the LSB header. However, this is too greedy; there are cases where the creation of a unit .service file fails because of an already existing symlink with the same name: - Backup files such as /etc/init.d/foo.bak still have "Provides: foo", and thus get a foo.service -> foo.bak.service link. foo.bak would not be enabled in rcN.d/, but we (deliberately) create units for all executables in init.d/ so that a manual "systemctl start" works. If foo.bak is processed before, the symlink already exists. - init.d/bar has "Provides: foo", while there also is a real init.d/foo. The former would create a link foo.service -> bar.service, while the latter would fail to create the real foo.service. If we encounter an existing symlink, just remove it before writing a real unit. Note that two init.d scripts "foo" and "bar" which both provide the same name "common" already work. The first processed init script wins and creates the "common.service" symlink, and the second just fails to create the symlink again. Thus create an additional test case for this to ensure that it keeps working sensibly. https://bugs.debian.org/775404

d816e2b7909e50ee887e1a0a825db760cf6fd3b0 21-Jan-2015 Martin Pitt <martin.pitt@ubuntu.com>

systemd-sysv-generator test: test scripts with hidden suffixes We don't expect any unit generated from temporary package manager, swap, and similar files.

29e0e6d8c1f7f648b7c998880d034eaa3e58c53a 21-Jan-2015 Martin Pitt <martin.pitt@ubuntu.com>

sysv-generator: Handle .sh suffixes when translating Provides: When deciding whether the provided name equals the file name in sysv_translate_facility(), also consider them equal if the file name has a ".sh" suffix. This was uncovered by commit b7e7184 which then created a symlink "<name>.service" to itself for ".sh" suffixed init.d scripts. For additional robustness, refuse to create symlinks to itself in add_alias(). Add test case which reproduces the bug. https://bugs.debian.org/775889

eb89bc1d25086a1b4117683697f35c1398a98c02 21-Jan-2015 Martin Pitt <martin.pitt@ubuntu.com>

systemd-sysv-generator test: fix enabled check Fix hardcoded "foo.service", test for the actual unit parameter.

56401ac57a543395d06690768e63b92633ad15dd 21-Jan-2015 Martin Pitt <martin.pitt@ubuntu.com>

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.

e28aa588f04ace17ca94e9e0667819bea265fbd9 21-Jan-2015 Martin Pitt <martin.pitt@ubuntu.com>

test: add integration test for systemd-sysv-generator This covers the general functionality as well as regression tests for recent fixes like commits b7e718 and 1ed0c19.