-
Notifications
You must be signed in to change notification settings - Fork 115
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cu-case-verify-worker-hosts-queue-1-service-has-proceed (#14621)
(cherry picked from commit 1bf74b5)
- Loading branch information
1 parent
cd020bd
commit 2fa1241
Showing
1 changed file
with
42 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,7 @@ | |
""" | ||
from datetime import date, datetime, timedelta | ||
from operator import itemgetter | ||
import re | ||
|
||
from broker import Broker | ||
import pytest | ||
|
@@ -1534,3 +1535,44 @@ def test_errata_list_by_contentview_filter(module_sca_manifest_org, module_targe | |
) | ||
) | ||
assert errata_count != errata_count_cvf | ||
|
||
|
||
@pytest.mark.rhel_ver_match('8') | ||
def test_positive_verify_errata_recalculate_tasks(target_sat, errata_host): | ||
"""Verify 'Actions::Katello::Applicability::Hosts::BulkGenerate' tasks proceed on 'worker-hosts-queue-1.service' | ||
:id: d5f89df2-b8fb-4aec-839d-b548b0aadc0c | ||
:setup: Register host which has applicable errata with satellite | ||
:steps: | ||
1. Run 'hammer host errata recalculate --host-id NUMBER' (will trigger inside errata_host fixture) | ||
2. Check systemctl or journalctl or /var/log/messages for '[email protected]' | ||
:expectedresults: worker-hosts-queue-1 should proceed with task and this can be cross verify using unique PID | ||
:customerscenario: true | ||
:BZ: 2249736 | ||
""" | ||
# Recalculate errata command has triggered inside errata_host fixture | ||
|
||
# get PID of 'worker-hosts-queue-1' from /var/log/messages | ||
message_log = target_sat.execute( | ||
'grep "dynflow-sidekiq@worker-hosts-queue-1" /var/log/messages | tail -1' | ||
) | ||
assert message_log.status == 0 | ||
pattern_1 = r'\[(.*?)\]' # pattern to capture PID of 'worker-hosts-queue-1' | ||
match = re.search(pattern_1, message_log.stdout) | ||
pid_log_message = match.group(1) | ||
|
||
# get PID of 'worker-hosts-queue-1' from systemctl command output | ||
systemctl_log = target_sat.execute( | ||
'systemctl status [email protected] | grep -i "Main PID:"' | ||
) | ||
assert systemctl_log.status == 0 | ||
pattern_2 = r'\: (.*?) \(' # pattern to capture PID of 'worker-hosts-queue-1' | ||
match = re.search(pattern_2, systemctl_log.stdout) | ||
pid_systemctl_cmd = match.group(1) | ||
|
||
assert pid_log_message == pid_systemctl_cmd |