Skip to content

Commit

Permalink
false positive: systemd-service-without-service_del_postun
Browse files Browse the repository at this point in the history
  • Loading branch information
danigm committed Nov 6, 2024
1 parent 036a257 commit 76a1d26
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions test/test_systemd_install.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,26 @@ def test_systemd_service_without_service_macro(tmp_path, package, systemdinstall
files=['/usr/lib/systemd/system/greetd.service'],
header={},
), True),
(get_tested_mock_package(
name='MirrorCache',
files=['/usr/lib/systemd/system/mirrorcache-hypnotoad.service'],
header={
'POSTUN': '''
if [ $1 -ge 1 ] && [ -x /usr/lib/systemd/systemd-update-helper ]; then
# Package upgrade, not uninstall
DISABLE_RESTART_ON_UPDATE=no
[ -e /etc/sysconfig/services ] && . /etc/sysconfig/services || :
case "$DISABLE_RESTART_ON_UPDATE" in
yes|1) ;;
*) /usr/lib/systemd/systemd-update-helper mark-restart-system-units mirrorcache.service mirrorcache-backstage.service mirrorcache-backstage-hashes.service mirrorcache-subtree.service || :
esac
fi
:
''',
},
), False),
])
def test_systemd_service_without_service_macro2(package, error, systemdinstallcheck):
output, test = systemdinstallcheck
Expand Down

0 comments on commit 76a1d26

Please sign in to comment.