5
0
mirror of git://git.proxmox.com/git/pve-storage.git synced 2024-12-24 21:34:48 +03:00
Commit Graph

12 Commits

Author SHA1 Message Date
Fabian Ebner
b1ddc54a93 archive_info: use timelocal correctly
Because we always have 4-digit years, we can simply pass
the year itself to timelocal instead of subtracting 1900.
Like this it will also work for years not in the range 2000-2999.

See also:
https://perldoc.perl.org/Time/Local.html#Year-Value-Interpretation

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2020-07-08 10:45:49 +02:00
Fabian Ebner
e34afeb117 Extend archive_info to include filename and logfilename
Only expect the logfilename if the archive has a standard name.
This also gives a mechanism to get an untainted filename.

archive_info can take either a volume ID or a path as it's
currently implemented. This is useful for vzdump when there
is no storage (i.e. for 'vzdump --dumpdir'). Add a test case for this.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2020-06-30 13:59:23 +02:00
Fabian Ebner
fb821c1828 Expand archive_info to include ctime, vmid and is_std_name
where 'is_std_name' shows whether the backup name uses the standard naming
schema and most likely was created by our tools.

Also adds a '^' to the existing filename matching regex, which
should be fine since basename() is used beforehand.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2020-06-06 19:38:02 +02:00
Thomas Lamprecht
a6c4705a46 tests: re-add virt "none" negative test
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-05-15 19:32:21 +02:00
Thomas Lamprecht
5029f978c3 archive info: keep some basic strictness
we want to enforce at least the strictness that our tools can do
something with a backup archive..

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-05-15 19:18:24 +02:00
Thomas Lamprecht
bf5af0fbf5 archive info: include archive name in error message
so that we have some context if users report issues with it..

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-05-15 19:13:39 +02:00
Thomas Lamprecht
c265d42160 tests: archive info: avoid assembling arrays to just de-assemble them directly
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-05-15 19:11:48 +02:00
Thomas Lamprecht
5df46bf2d5 tests: archive info: make deterministic
nothing worse than jumping test results due to not sorting the tests
and thus making discussions harder (which test # failed) and it may
imply another error by mistake.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-05-15 19:10:23 +02:00
Thomas Lamprecht
3dde6a9cb9 tests: archive info: code cleanup
We could also do a hash array slice, like:
> my ($archive, $expected, $description) = $tt->@{'archive', 'expected', 'description'};

But as none are optional lets just access values directly..

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-05-15 19:01:39 +02:00
Alwin Antreich
4b26f8140d Fix: backup: relax file name matching regex
The rework of the backup file detection logic missed the non-standard
file name case. This patch allows to restore backups with different file
names. Though the config extraction fails, since the type is unknown.

Signed-off-by: Alwin Antreich <a.antreich@proxmox.com>
2020-05-15 18:12:01 +02:00
Alwin Antreich
014d36dbbb Fix: #2124 storage: add zstd support
Signed-off-by: Alwin Antreich <a.antreich@proxmox.com>
2020-04-30 18:37:19 +02:00
Alwin Antreich
cd554b79d1 storage: test: split archive format/compressor
detection into separate functions so they are reusable and easier
modifiable. This patch also adds the test for archive_info.

Signed-off-by: Alwin Antreich <a.antreich@proxmox.com>
2020-04-30 18:37:19 +02:00