Skip to content

Add tests for backup#588

Open
sjha4 wants to merge 1 commit into
theforeman:masterfrom
sjha4:backup_tests
Open

Add tests for backup#588
sjha4 wants to merge 1 commit into
theforeman:masterfrom
sjha4:backup_tests

Conversation

@sjha4

@sjha4 sjha4 commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Why are you introducing these changes? (Problem description, related links)

Add tests for foremanctl backup

What are the changes introduced in this pull request?

  • Add tests for foremanctl backup

How to test this pull request

The CI should run the new tests.
Steps to reproduce:

  • Check CI

Checklist

  • Tests added/updated (if applicable)
  • Documentation updated (if applicable)

PS: I had some issues with the OBSAH_STATE_PATH running these locally in a repo checkout. The backup is supposed to work on a host with services deployed and with path as /var/lib/foremanctl. The repo setup is different from production-like installs where the quadlet is mapped to localhost. On dev setup, quadlet is actual VM so the test finds OBSAH_STATE_PATH as /.var/lib/foremanctl inside the VM. Hence the conditional test for foremanctl state archive which archives this path.

@sjha4 sjha4 force-pushed the backup_tests branch 5 times, most recently from 95d6d11 to 727cdd8 Compare June 23, 2026 05:55
name: postgresql.service
register: backup_postgres_status
until: backup_postgres_status.status.ActiveState == 'inactive'
until: backup_postgres_status.status.ActiveState in ['inactive', 'failed']

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed this to include failed as an acceptable state to continue with backup. This was happening in the CI test because postgresql.service was getting a SIGTERM and also makes sense for actual backup scenario where we may want to take a backup if state is failed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant