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.15.z] cu-case-verify-worker-hosts-queue-1-service-has-proceed #14627

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions tests/foreman/cli/test_errata.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"""
from datetime import date, datetime, timedelta
from operator import itemgetter
import re

from broker import Broker
import pytest
Expand Down Expand Up @@ -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
Loading