Skip to content

Commit caadc9b

Browse files
authored
Merge pull request #3973 from clumens/ctslab-fixes
Fix various problems in ctslab tests
2 parents 13e30fa + a4af998 commit caadc9b

File tree

8 files changed

+43
-18
lines changed

8 files changed

+43
-18
lines changed

lib/pengine/unpack.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -897,6 +897,9 @@ unpack_resources(const xmlNode *xml_resources, pcmk_scheduler_t *scheduler)
897897
/* pcs's CI tests look for this specific error message. Confer with the
898898
* pcs team before changing it. If the dependency still exists, bump the
899899
* CRM_FEATURE_SET and inform the pcs maintainers.
900+
*
901+
* Also, ResyncCIB.errors_to_ignore() looks for this specific error
902+
* message as well.
900903
*/
901904
pcmk__config_err("Resource start-up disabled since no fencing "
902905
"resources have been defined. Either configure some "

python/pacemaker/_cts/patterns.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ def __init__(self):
7676
"Pat:Fencing_start": r"Requesting peer fencing .* targeting %s",
7777
"Pat:Fencing_ok": r"pacemaker-fenced.*:\s*Operation .* targeting %s by .* for .*@.*: OK",
7878
"Pat:Fencing_recover": r"pacemaker-schedulerd.*: Recover\s+%s",
79-
"Pat:Fencing_active": r"stonith resource .* is active on 2 nodes (attempting recovery)",
79+
"Pat:Resource_active": r"resource .* might be active on \d+ nodes \(attempting recovery\)",
8080
"Pat:Fencing_probe": r"pacemaker-controld.* Result of probe operation for %s on .*: Error",
8181

8282
"Pat:RscOpOK": r"pacemaker-controld.*:\s+Result of %s operation for %s.*: (0 \()?OK",

python/pacemaker/_cts/scenarios.py

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -302,19 +302,20 @@ def audit(self, local_ignore=None):
302302
if self._bad_news:
303303
match = self._bad_news.look(0)
304304

305-
if match:
306-
add_err = True
305+
if not match:
306+
break
307307

308-
for ignore in ignorelist:
309-
if add_err and re.search(ignore, match):
310-
add_err = False
308+
add_err = True
311309

312-
if add_err:
313-
self._cm.log(f"BadNews: {match}")
314-
self.incr("BadNews")
315-
errcount += 1
316-
else:
317-
break
310+
for ignore in ignorelist:
311+
if add_err and re.search(ignore, match):
312+
add_err = False
313+
break
314+
315+
if add_err:
316+
self._cm.log(f"BadNews: {match}")
317+
self.incr("BadNews")
318+
errcount += 1
318319
else:
319320
print("Big problems")
320321
if not should_continue(self._cm.env):

python/pacemaker/_cts/tests/cibsecret.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,25 @@ def _insert_dummy(self, node):
6666

6767
return ""
6868

69+
def _remove_dummy(self, node):
70+
"""Remove the previously created dummy resource on the given node."""
71+
pats = [
72+
self._cm.templates["Pat:RscOpOK"] % ("stop", self._rid)
73+
]
74+
75+
watch = self.create_watch(pats, 60)
76+
watch.set_watch()
77+
self._cm.remove_dummy_rsc(node, self._rid)
78+
79+
with Timer(self._logger, self.name, "removeDummy"):
80+
watch.look_for_all()
81+
82+
if watch.unmatched:
83+
self.debug("Failed to find patterns when removing dummy resource")
84+
return repr(watch.unmatched)
85+
86+
return ""
87+
6988
def _check_cib_value(self, node, expected):
7089
"""Check that the secret has the expected value."""
7190
(rc, lines) = self._rsh(node, f"crm_resource -r {self._rid} -g {self._secret}",
@@ -224,6 +243,7 @@ def __call__(self, node):
224243
return False
225244

226245
self._test_secrets_removed()
246+
self._remove_dummy(node)
227247

228248
return self.success()
229249

python/pacemaker/_cts/tests/componentfail.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ def __call__(self, node):
7979
# Ignore actions for fence devices if fencer will respawn
8080
# (their registration will be lost, and probes will fail)
8181
self._okerrpatterns = [
82-
self._cm.templates["Pat:Fencing_active"],
82+
self._cm.templates["Pat:Resource_active"],
8383
]
8484
(_, lines) = self._rsh(node, "crm_resource -c", verbose=1)
8585

python/pacemaker/_cts/tests/resynccib.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ def errors_to_ignore(self):
6464
# Errors that occur as a result of the CIB being wiped
6565
return [
6666
r"error.*: v1 patchset error, patch failed to apply: Application of an update diff failed",
67-
r"error.*: Resource start-up disabled since no STONITH resources have been defined",
68-
r"error.*: Either configure some or disable STONITH with the stonith-enabled option",
69-
r"error.*: NOTE: Clusters with shared data need STONITH to ensure data integrity"
67+
r"error.*: Resource start-up disabled since no fencing resources have been defined. "
68+
"Either configure some or disable fencing with the fencing-enabled option. "
69+
"NOTE: Clusters with shared data need fencing to ensure data integrity."
7070
]

python/pacemaker/_cts/tests/splitbraintest.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,8 @@ def errors_to_ignore(self):
200200
r"Another DC detected:",
201201
r"(ERROR|error).*: .*Application of an update diff failed",
202202
r"pacemaker-controld.*:.*not in our membership list",
203-
r"CRIT:.*node.*returning after partition"
203+
r"CRIT:.*node.*returning after partition",
204+
self._cm.templates["Pat:Resource_active"],
204205
]
205206

206207
def is_applicable(self):

python/pacemaker/_cts/tests/stonithdtest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ def errors_to_ignore(self):
125125
return [
126126
self._cm.templates["Pat:Fencing_start"] % ".*",
127127
self._cm.templates["Pat:Fencing_ok"] % ".*",
128-
self._cm.templates["Pat:Fencing_active"],
128+
self._cm.templates["Pat:Resource_active"],
129129
r"error.*: Operation 'reboot' targeting .* by .* for stonith_admin.*: Timer expired"
130130
]
131131

0 commit comments

Comments
 (0)