diff options
| author | Colin Wilk <colin@wilk.cx> | 2026-06-26 22:35:40 +0000 |
|---|---|---|
| committer | Colin Wilk <colin@wilk.cx> | 2026-06-27 15:43:21 +0200 |
| commit | e15d494e96e9f9e6cdf21676ce3644c7894b3b53 (patch) | |
| tree | 51266a035df33c1ff9204299fdd0b89bd8adca4a /molecule/default/tests/test_systemd_success_exit_status.py | |
| parent | b8d11180605fbf193e76fba04bb63b5ea4908dcf (diff) | |
| download | ansible-role-borgbackup-e15d494e96e9f9e6cdf21676ce3644c7894b3b53.tar.gz ansible-role-borgbackup-e15d494e96e9f9e6cdf21676ce3644c7894b3b53.zip | |
test: add larger test suite for role
- Add test systems for client/server setup
- Add tests for systemd service and timer files
- Add tests for SSH connectivity
- Add tests for security configurations
- Add tests for multi-instance backup scenarios
Diffstat (limited to 'molecule/default/tests/test_systemd_success_exit_status.py')
| -rw-r--r-- | molecule/default/tests/test_systemd_success_exit_status.py | 33 |
1 files changed, 0 insertions, 33 deletions
diff --git a/molecule/default/tests/test_systemd_success_exit_status.py b/molecule/default/tests/test_systemd_success_exit_status.py deleted file mode 100644 index 61c20c4..0000000 --- a/molecule/default/tests/test_systemd_success_exit_status.py +++ /dev/null @@ -1,33 +0,0 @@ -"""Tests for systemd success exit status functionality""" -import pytest - -testinfra_hosts = ['borg-client', 'borg-client-success-exit-status'] - - -def test_systemd_service_has_correct_success_exit_status(host): - service = host.file('/etc/systemd/system/borg_backup@borg-server.service') - assert service.exists - - if host.backend.get_hostname() == 'borg-client-success-exit-status': - assert service.contains('SuccessExitStatus=1 TEMPFAIL') - else: - assert not service.contains('SuccessExitStatus=') - - -def test_systemd_timer_is_enabled(host): - timer_name = 'borg_backup@borg-server.timer' - c = host.run(f"systemctl is-enabled {timer_name}") - assert c.rc == 0 - - -def test_systemd_timer_is_active(host): - timer_name = 'borg_backup@borg-server.timer' - c = host.run(f"systemctl is-active {timer_name}") - assert c.rc == 0 - - -@pytest.mark.parametrize('exit_status', [1, 'TEMPFAIL']) -def test_success_exit_status_values(host, exit_status): - if host.backend.get_hostname() == 'borg-client-success-exit-status': - service = host.file('/etc/systemd/system/borg_backup@borg-server.service') - assert service.contains(str(exit_status)) |