Skip to content

Commit

Permalink
Fix pulp tasks purge test case (#17190)
Browse files Browse the repository at this point in the history
  • Loading branch information
vsedmik authored Dec 17, 2024
1 parent 3ac153b commit 8ef5d53
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions tests/foreman/cli/test_repositories.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,15 +194,16 @@ def test_purge_pulp_tasks(module_target_sat, module_org, module_repository, sett
:customerscenario: true
"""
original_ptc = int(module_target_sat.execute('pulp task list | jq length').stdout)
cmd = 'pulp task list --limit 99999 | jq length'
original_ptc = int(module_target_sat.execute(cmd).stdout)
module_target_sat.run_orphan_cleanup(smart_proxy_id=1)
new_ptc = int(module_target_sat.execute('pulp task list | jq length').stdout)
new_ptc = int(module_target_sat.execute(cmd).stdout)
assert new_ptc > original_ptc, 'Pulp tasks were unexpectedly purged'

setting_update.value = 0
setting_update.update({'value'})

original_ptc = int(module_target_sat.execute('pulp task list | jq length').stdout)
original_ptc = int(module_target_sat.execute(cmd).stdout)
module_target_sat.run_orphan_cleanup(smart_proxy_id=1)
new_ptc = int(module_target_sat.execute('pulp task list | jq length').stdout)
new_ptc = int(module_target_sat.execute(cmd).stdout)
assert new_ptc < original_ptc, 'Pulp tasks were not purged'

0 comments on commit 8ef5d53

Please sign in to comment.