5
0
mirror of git://git.proxmox.com/git/pve-common.git synced 2024-12-22 21:33:47 +03:00
Commit Graph

8 Commits

Author SHA1 Message Date
Fabian Grünbichler
4d22a9729d tests: run with static TZ value
else tests may randomly fail depending on which local TZ is set..

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2021-05-19 18:08:36 +02:00
Dominic Jäger
e37d592413 Add tests for verify_configid
Signed-off-by: Dominic Jäger <d.jaeger@proxmox.com>
2020-10-29 15:20:40 +01:00
Thomas Lamprecht
2f98cd72a8 ProcFSTools: add kernel_version
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-11-23 12:15:59 +01:00
Thomas Lamprecht
510f865b5c tests: allow to make tests in parallel
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-11-23 12:14:19 +01:00
Dominik Csapak
95386dafb7 fix convert_size with decimal numbers and add tests
converting from 0.5 gb to mb resulted in 0 mb
with this patch it correctly returns 512

also add tests and catch more errors

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2017-12-15 11:15:50 +01:00
Dietmar Maurer
3ebebd191d test/calendar_event_test.pl: regression tests for PVE::CalendarEvent 2017-05-17 13:38:16 +02:00
Wolfgang Bumiller
d9f86d0d87 Tools: make file-locking aware of external exception sources
Previously an external exception (eg. caused by a SIGARLM in a code
which is already inside a run_with_timeout() call) could happen in
various places where we did not properly this situation.
For instance after calling $lock_func() but before reaching the cleanup
code. In this case a lock was leaked.
Additionally the code was broken in that it used perl's automatic hash
creation side effect ($a->{x}->{y} implicitly initializing $a->{x} with
an empty hash when it did not exist). The effect was that if our own
time out was triggered after the initial check for an existing file
handle inside $lock_func() happened (extremely rare since perl would have
to be running insanely slow), the cleanup did:

    if (my $fh = $lock_handles->{$$}->{$filename}->{fh}) {

This recreated $lock_handles->{$$}->{$filename} as an empty hash.
A subsequent call to lock_file_full() will think a file descriptor
already exists because the check simply used:

    if (!$lock_handles->{$$}->{$filename}) {

While this could have been a one-line fix for this one particular case,
we'd still not be taking external timeouts into account causing the
first issue described above.
2017-05-12 11:40:26 +02:00
Wolfgang Bumiller
936218b86f importing etc_network_interfaces tests 2015-06-26 07:49:16 +02:00