Skip to content
This repository was archived by the owner on Apr 7, 2022. It is now read-only.

Commit 929396b

Browse files
committed
merged two tests
Signed-off-by: Pavel Simovec <psimovec@redhat.com>
1 parent 1014941 commit 929396b

File tree

1 file changed

+6
-31
lines changed

1 file changed

+6
-31
lines changed

cfme/tests/cli/test_appliance_update.py

Lines changed: 6 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import re
12
from collections import namedtuple
23

34
import fauxfactory
@@ -120,9 +121,9 @@ def do_yum_update(appliance):
120121
return result
121122

122123

123-
@pytest.mark.meta(automates=[1714236])
124+
@pytest.mark.meta(automates=[1714236], coverage=[1674055])
124125
def test_update_yum(appliance_preupdate, appliance):
125-
"""Tests appliance update between versions
126+
"""Tests appliance update between versions - version changed no warnings or errors
126127
127128
Polarion:
128129
assignee: jhenner
@@ -133,37 +134,11 @@ def test_update_yum(appliance_preupdate, appliance):
133134
Bugzilla:
134135
1714236
135136
"""
136-
do_yum_update(appliance_preupdate)
137+
update_output = do_yum_update(appliance_preupdate).output
137138
result = appliance_preupdate.ssh_client.run_command('cat /var/www/miq/vmdb/VERSION')
138139
assert result.output in appliance.version
139-
140-
141-
@pytest.mark.meta(coverage=[1674055])
142-
def test_update_yum_no_errors(appliance_preupdate):
143-
""" Test that the yum update doesn't spill any erros or warnings.
144-
145-
Polarion:
146-
assignee: jhenner
147-
caseimportance: high
148-
casecomponent: Appliance
149-
initialEstimate: 1/4h
150-
testSteps:
151-
1. Boot preupdate CFME
152-
2. Add repos to update to.
153-
3. Do the yum update, check there are no errors in the stderr and
154-
perhaps also in stdout.
155-
expectedResults:
156-
1.
157-
2.
158-
3. No errors in the stderr and stdout, yum exit status is 0
159-
160-
Bugzilla:
161-
1674055
162-
"""
163-
result = do_yum_update(appliance_preupdate)
164-
for phrase in ["fail", "error", "warning"]:
165-
assert phrase not in result.output.lower(), f"update output contains {phrase}\n\
166-
n{result.output}"
140+
matches = re.search(r'error|warning|fail', update_output, re.IGNORECASE)
141+
assert not matches, f"update output contains {matches.group()}\n\n{update_output}"
167142

168143

169144
@pytest.mark.ignore_stream("upstream")

0 commit comments

Comments
 (0)