Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[6.12.z] Fix remotedb backup expected files #12655

Conversation

lpramuk
Copy link
Contributor

@lpramuk lpramuk commented Sep 19, 2023

Cherrypick of #12645 to 6.12.z branch

(cherry picked from commit e075c5e)

Fixes #12653

@lpramuk lpramuk self-assigned this Sep 19, 2023
@lpramuk lpramuk added No-CherryPick PR doesnt need CherryPick to previous branches 6.12.z Introduced in or relating directly to Satellite 6.12 labels Sep 19, 2023
@lpramuk lpramuk force-pushed the 612_fix_remotedb_offline_assert_files branch 2 times, most recently from a34f339 to 7a8100f Compare September 20, 2023 09:22
@lpramuk lpramuk force-pushed the 612_fix_remotedb_offline_assert_files branch from 7a8100f to 1110873 Compare September 20, 2023 09:25
@lpramuk
Copy link
Contributor Author

lpramuk commented Sep 22, 2023

trigger: test-robottelo
pytest: tests/foreman/maintain/test_backup_restore.py -n 4

@Gauravtalreja1
Copy link
Collaborator

@lpramuk Can you check the failing PRT? are this new backup expected files valid for remotedb?

@lpramuk
Copy link
Contributor Author

lpramuk commented Sep 22, 2023

@Gauravtalreja1 I did no changes to expected files list - just refactored logic around handling these lists

So to errors:
1) Failed to establish a new connection: [Errno 111] Connection refused capsule error is not related.

2) Incremental restore is failing due to unreported? product bug. Production (6.12) pipeline fails the same
reindexdb: error: could not connect to database template1: FATAL: could not open file "base/1/95874": No such file or directory

The assert I touched passes successfully (15 lines above the failure)

        expected_files = get_exp_files(sat_maintain, backup_type)
        assert set(files).issuperset(expected_files), assert_msg     <---- my changes affect this assert
    
        # restore initial backup and check system health
        result = sat_maintain.cli.Restore.run(
            backup_dir=init_backup_dir,
            options={'assumeyes': True, 'plaintext': True},
        )
        assert result.status == 0
        assert 'FAIL' not in result.stdout
    
        result = sat_maintain.cli.Health.check(
            options={'whitelist': 'foreman-tasks-not-paused', 'assumeyes': True, 'plaintext': True}
        )
        assert result.status == 0
    
        # check that the additional content is missing at this point
        result = sat_maintain.api.Repository().search(query={'search': f'name="{secondary_repo.name}"'})
        assert len(result) == 0
    
        # restore incremental backup and check system health
        result = sat_maintain.cli.Restore.run(
            backup_dir=inc_backup_dir,
            options={'assumeyes': True, 'plaintext': True},
        )
>       assert result.status == 0
E       AssertionError: assert 1 == 0

This PR can be safely merged.

@Griffin-Sullivan Griffin-Sullivan merged commit 18469d9 into SatelliteQE:6.12.z Sep 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.12.z Introduced in or relating directly to Satellite 6.12 No-CherryPick PR doesnt need CherryPick to previous branches
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants