29 Commits

Author SHA1 Message Date
Thomas Lamprecht
89c0452d6e fix replication fail count tests & bump libpve-guest-common-perl b-d
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-04-27 18:53:27 +02:00
Dominik Csapak
8a6681900a fix tests in 'vzdump_new_test.pl'
commmit
b241deb7 ("close #3476: vzdump: add job-init hook")

introduces a 'cfs_update' in VZDump->new(), which overwrites our
carefully prepared storage/vm config which can break the tests

to prevent this, mock 'cfs_update' to do nothing, since we never
want to load the 'real' configs during tests anyway

fixes commit b241deb731369ff96b26bfa670c5c8d273aea02c

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2022-01-28 09:45:53 +01:00
Fabian Ebner
4af70154fd test: replication: remove mocking for obsolete volume_snapshot_list
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2021-11-09 11:33:16 +01:00
Fabian Ebner
3847fb5ec0 test: replication: mock volume_snapshot_info
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2021-11-09 11:33:16 +01:00
Fabian Ebner
0a7bd2d204 test: replication: avoid implicit return for volume_snapshot
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2021-11-09 11:33:16 +01:00
Fabian Ebner
1b06f7bc4e test: vzdump: adapt to new default
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2021-06-09 10:08:58 +02:00
Thomas Lamprecht
d7a63207a3 ceph: osd_belongs_to_node: only check tree-entries of type host, refactor
We want to check explicitly for type host, so filter for that first
and create a hash map for easier usage afterwards.

Drop the error when there's no tree, as either RADOS error'd on bad
command already, or there really is no tree (but RADOS worked OK), in
which case we simply return that the OSD did not belong to this node.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-04-20 18:06:07 +02:00
Dominic Jäger
e12c5dbf22 Add tests for OSD-belongs-to-node helper
Signed-off-by: Dominic Jäger <d.jaeger@proxmox.com>
2021-04-20 16:42:12 +02:00
Fabian Ebner
52116f8b45 test: vzdump: rename vzdump_new_retention_test.pl to vzdump_new_test.pl
as it now also includes tests for new() with non-retention options.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
Reviewed-By: Dominik Csapak <d.csapak@proxmox.com>
2021-02-19 16:34:32 +01:00
Fabian Ebner
99f125bc51 test: vzdump: add tests for mailto
Re-use the existing code, by allowing special kinds of 'tests' that just set
the options that are tested for.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
Reviewed-By: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-02-19 16:33:43 +01:00
Thomas Lamprecht
492d4039a6 test: allow running replication tests in parallel
running multiple workers reduces built time from >3s to ~0.6s here.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-12-02 18:00:47 +01:00
Thomas Lamprecht
d59f1fa868 test: replication: cleanup use statements
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-12-02 17:59:51 +01:00
Thomas Lamprecht
41303e9779 test: buildsys: allow to execute vzdump tests in parallel
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-12-02 16:19:34 +01:00
Thomas Lamprecht
13f8e3b073 test: buildsys: rework target names, prefix with test
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-12-02 16:18:41 +01:00
Fabian Ebner
acc963c3e5 vzdump: defaults: correctly parse prune-backups and convert maxfiles
Also simplify handling in new(), now that we never have maxfiles there anymore.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2020-12-02 13:15:52 +01:00
Fabian Ebner
550d8e71e6 test: add tests for retention parameters for vzdump's new()
To get a more complete picture, instead of mocking storage_config,
PVE::Cluster's get_config is mocked. This ensures that the prune-backups
validation and the maxfiles conversion are also called.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2020-12-02 13:15:52 +01:00
Fabian Ebner
7f87414894 backup: include IDs for non-existent guests
Like this, there will be a backup task (within the big worker task)
for such IDs, which will then visibly (i.e. also visible in the
notification mail) fail with, e.g.:
unable to find VM '123'

In get_included_guests, the key '' was chosen for the orphaned IDs,
because it cannot possibly denote a nodename.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2020-10-22 16:29:26 +02:00
Fabian Ebner
83b2191464 remove outdated comment
Commit df5875b41e12d164cfe3c722e929f4c41fc94d34 moved the
all/exclude logic into the single method

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2020-10-22 16:29:26 +02:00
Fabian Grünbichler
6a545c326c test: fix mail_test for non-root user
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2020-08-13 12:54:51 +02:00
Aaron Lauterer
5d807cf56d vzdump: test: adapt and add more tests that are possible now
Now, with the logic for `all` and `exclude` in the same single method,
additional tests for these cases are possible.

Adapt to hash return value of `get_included_guests`.

Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
2020-06-17 15:16:06 +02:00
Aaron Lauterer
54df211432 vzdump: test: add first tests to the guest include logic
Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
2020-06-08 15:54:42 +02:00
Fabian Grünbichler
58d46211e5 test: s/expeted/expected
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2020-04-10 10:34:13 +02:00
Dominic Jäger
8b449830dd replication test: Add log rate and transport type
pve-guest-common got a new log line [0] for rate and transport type of a
replication. This line must be added to the replication tests.

[0] e90f586aab5caad4d4c5e18711316e8dc5225c07

Signed-off-by: Dominic Jäger <d.jaeger@proxmox.com>
2020-04-10 10:31:47 +02:00
Thomas Lamprecht
cd3b6b0177 allow to run some tests in parallel
the replication test are not yet ready for that, but the others can
be run in parallel

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-11-19 15:02:50 +01:00
Thomas Lamprecht
f1ea8ca4f1 followup: cleanup/refactor mail test
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-11-19 15:02:50 +01:00
Dominic Jäger
ce84a9506d Fix #352: Limit the length of backup logs for mails
When creating a backup the log part can make the mail too big to be
transferred. To ensure delivery, two measures are taken:
1. Always omit the status lines
2. Omit the whole log part if a mail becomes (too) big

Additionally, add a check for missing log files.

Co-developed-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Signed-off-by: Dominic Jäger <d.jaeger@proxmox.com>
2019-11-19 15:02:50 +01:00
Fabian Grünbichler
33cd5dfefe test: also mock cfs_read_file
needed for tests to work without a functional running pmxcfs instance.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2019-11-18 12:25:35 +01:00
Fabian Grünbichler
fe57e096cc test: mock PVE::SSHInfo module
since it is now used for getting a cluster node's migration IP address.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2019-11-18 12:25:35 +01:00
Thomas Lamprecht
73ed0af158 cleanup: move bin/test to toplevel
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-06-20 13:04:51 +02:00