Skip to content

Commit

Permalink
Add coverage for 2055790 to service enable disable (SatelliteQE#12756)
Browse files Browse the repository at this point in the history
* Adding wait for to service enable test

* Add coverage for 2055790 to enable disable
  • Loading branch information
Griffin-Sullivan authored Oct 3, 2023
1 parent 8d98645 commit 89b779b
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions tests/foreman/maintain/test_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"""
from fauxfactory import gen_string
import pytest
from wait_for import wait_for

from robottelo.config import settings
from robottelo.constants import (
Expand Down Expand Up @@ -173,6 +174,10 @@ def test_positive_service_enable_disable(sat_maintain):
2. Run satellite-maintain service enable
:expectedresults: Services should enable/disable
:BZ: 1995783, 2055790
:customerscenario: true
"""
result = sat_maintain.cli.Service.stop()
assert 'FAIL' not in result.stdout
Expand All @@ -183,6 +188,28 @@ def test_positive_service_enable_disable(sat_maintain):
result = sat_maintain.cli.Service.enable()
assert 'FAIL' not in result.stdout
assert result.status == 0
sat_maintain.power_control(state='reboot')
if isinstance(sat_maintain, Satellite):
result, _ = wait_for(
sat_maintain.cli.Service.status,
func_kwargs={'options': {'brief': True, 'only': 'foreman.service'}},
fail_condition=lambda res: "FAIL" in res.stdout,
handle_exception=True,
delay=30,
timeout=300,
)
assert 'FAIL' not in sat_maintain.cli.Base.ping()
else:
result, _ = wait_for(
sat_maintain.cli.Service.status,
func_kwargs={'options': {'brief': True}},
fail_condition=lambda res: "FAIL" in res.stdout,
handle_exception=True,
delay=30,
timeout=300,
)
assert 'FAIL' not in result.stdout
assert result.status == 0


@pytest.mark.usefixtures('start_satellite_services')
Expand Down

0 comments on commit 89b779b

Please sign in to comment.