Skip to content

Commit f0cfad5

Browse files
TST: Fixed regex to hold gcc version
Fixes #2185 Signed-off-by: Sebastian Waldbauer <waldbauer@cert.at>
1 parent 3b15e09 commit f0cfad5

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ CHANGELOG
100100
- Add GitHub Action to run regexploit on all Python, JSON and YAML files (PR#2059 by Sebastian Wagner).
101101
- `intelmq.lib.test`:
102102
- Decorator `skip_ci` also detects `dpkg-buildpackage` environments by checking the environment variable `DEB_BUILD_ARCH` (PR#2123 by Sebastian Wagner).
103+
- Fixing regex to check the GCC version too (PR#2216 by Sebastian Waldbauer, fixes #2185)
103104
- Also test on Python 3.10 (PR#2140 by Sebastian Wagner).
104105
- Switch from nosetests to pytest, as the former does not support Python 3.10 (PR#2140 by Sebastian Wagner).
105106
- CodeQL Github Actions `exponential backtracking on strings` fixed. (PR#2148 by Sebastian Waldbauer, fixes #2138)

intelmq/lib/test.py

+6-3
Original file line numberDiff line numberDiff line change
@@ -348,9 +348,12 @@ def run_bot(self, iterations: int = 1, error_on_pipeline: bool = False,
348348
self.assertIn('raw', event)
349349

350350
""" Test if bot log messages are correctly formatted. """
351-
self.assertLoglineMatches(0, "{} initialized with id {} and intelmq [0-9a-z.]* and python"
352-
r" [0-9a-z.]{{5,8}}\+? \(.+?\)( \[GCC.*?\])?"
353-
r" as process [0-9]+\."
351+
# regex credits for semver: https://ihateregex.io/expr/semver/
352+
self.assertLoglineMatches(0, "{} initialized with id {} and"
353+
r" intelmq [0-9a-z.]*"
354+
r" and python [0-9a-z.]*"
355+
r" \(.*?\)([0-9a-zA-Z.\ \[\]]*)"
356+
r"as process [0-9]+\."
354357
"".format(self.bot_name,
355358
self.bot_id), "INFO")
356359
self.assertRegexpMatchesLog("INFO - Bot is starting.")

0 commit comments

Comments
 (0)