Commit Graph

8 Commits

Author SHA1 Message Date
Stoiko Ivanov
b154004956 tests: explicitly set timezone for testcases with unix timestamps
noticed when building with sbuild, which uses UTC as timezone:
Due to the parsing of traditional syslog time information (which does
not contain timezone information) the testcases passing
unix-timestamps as arguments failed.

Explicitly setting TZ to Europe/Vienna fixes the tests (and makes the
assumption visible)

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2023-06-26 13:01:27 +02:00
Mira Limbeck
2912583794 fix mutable borrow panic on duplicate msgid
Because of the relay before lmtp issue we now add and remove QEntrys
based on their message-id. But if the cleanup line containing the
message-id appears twice in the log for the same QEntry it keeps a weak
reference to itself which leads to a panic because of a mutable borrow
while it is already mutably borrowed in the 'finalize' function.

To circumvent this we check after the lookup if it is the same QEntry
and if so, insert it again with that message-id in the lookup table and
don't add the weak reference.

Signed-off-by: Mira Limbeck <m.limbeck@proxmox.com>
Tested-By: Aaron Lauterer <a.lauterer@proxmox.com>
2021-05-11 15:48:57 +02:00
Mira Limbeck
f6cbaf2f48 add test case for relay removed before lmtp
Signed-off-by: Mira Limbeck <m.limbeck@proxmox.com>
2021-03-23 15:40:19 +01:00
Mira Limbeck
ef4e4370a3 change tests to use faketime
We only have the month, day, hours, minutes and seconds available to us,
but not the year. Because of this we assume the logs are always relative
to the current year. This means when running the log tracker the CTIME
is calculated based on the current year and once a new year starts, all
old tests have to be updated to match the new year.

To work around this issue, use 'faketime' to set the time to 2020-12-31
23:59:59 as all tests assume 2020 as the year.

Signed-off-by: Mira Limbeck <m.limbeck@proxmox.com>
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2021-03-22 16:20:32 +01:00
Fabian Grünbichler
77b430e04a debcargo: fix maintainer directive
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2021-02-01 11:29:02 +01:00
Mira Limbeck
c409629f80 change case sensitive string match to case insensitive
With the rewrite from C to Rust the search string match was changed to
be case sensitive by accident. Fix this by comparing the lowercase values
of both the input and the search string.

Signed-off-by: Mira Limbeck <m.limbeck@proxmox.com>
Reviewed-By: Stoiko Ivanov <s.ivanov@proxmox.com>
Tested-By: Stoiko Ivanov <s.ivanov@proxmox.com>
2020-11-17 08:18:21 +01:00
Fabian Grünbichler
abd7fe2d82 packaging cleanup
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2020-02-28 11:58:09 +01:00
Mira Limbeck
aee1def7c3 add tests
Add tests for some command line options. Not all have a test yet, but at
least most of the ones used by the GUI (-s, -e, -q, -x). '-g' and '-n' are
currently still missing.

The tests will only be valid until end of January 31st 2021 because of
missing year info in the syslog.

Signed-off-by: Mira Limbeck <m.limbeck@proxmox.com>
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-02-21 09:47:37 +01:00