Functional tests fail on Xenial kernel

Bug #1913645 reported by Xav Paice
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Telegraf Charm
Won't Fix
Low
Unassigned

Bug Description

When running functional tests on Openstack instances - i.e. KVM VMS rather than LXD - I see test failures for Xenial when checking the metrics available. The zoneinfo metric is missing.

I added a patch to get more detail:

diff --git a/src/tests/functional/tests/base.py b/src/tests/functional/tests/base.py
index 1197396..3433c5d 100644
--- a/src/tests/functional/tests/base.py
+++ b/src/tests/functional/tests/base.py
@@ -32,7 +32,8 @@ class BaseTelegrafTest(unittest.TestCase):
     def check_re_pattern(self, re_pattern, text):
         logging.info("checking metrics %s", re_pattern)
         # findall returns a list, [] when no match
- self.assertTrue(re.findall(re_pattern, text, flags=re.M))
+ self.assertTrue(re.findall(re_pattern, text, flags=re.M),
+ msg="Failed to find {}".format(re_pattern))

     def check_metrics(self, patterns):
         principal_units = (

2021-01-28 17:01:25 [INFO] ======================================================================
2021-01-28 17:01:25 [INFO] FAIL: test_01_metrics_available (tests.test_telegraf.TestTelegraf)
2021-01-28 17:01:25 [INFO] ----------------------------------------------------------------------
2021-01-28 17:01:25 [INFO] Traceback (most recent call last):
2021-01-28 17:01:25 [INFO] File "./tests/test_telegraf.py", line 37, in test_01_metrics_available
2021-01-28 17:01:25 [INFO] self.check_metrics(re_patterns)
2021-01-28 17:01:25 [INFO] File "./tests/base.py", line 70, in check_metrics
2021-01-28 17:01:25 [INFO] self.check_re_pattern(re_pattern, text)
2021-01-28 17:01:25 [INFO] File "./tests/base.py", line 35, in check_re_pattern
2021-01-28 17:01:25 [INFO] self.assertTrue(re.findall(re_pattern, text, flags=re.M),
2021-01-28 17:01:25 [INFO] AssertionError: [] is not true : Failed to find ^zoneinfo_
2021-01-28 17:01:25 [INFO] ----------------------------------------------------------------------

https://git.launchpad.net/charm-telegraf/tree/src/files/telegraf_exec_metrics.py#n233 shows the regex it's trying to match. https://pastebin.canonical.com/p/s96jZ8Cb7t/ is an example of the zoneinfo from a Xenial machine.

Revision history for this message
Drew Freiberger (afreiberger) wrote :

The xenial zoneinfo file appears to have a "scanned" line between "high" and "spanned" counters.

Updating the regex to have another non-greedy line-eater between those two counters should do the trick.

Edin S (exsdev)
Changed in charm-telegraf:
importance: Undecided → Low
Revision history for this message
Robert Gildein (rgildein) wrote :

Since support for Xenial was dropped, so also all bundles for Xenial, I'm marking this as "Won't Fix".

Changed in charm-telegraf:
status: New → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.