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

50 Commits

Author SHA1 Message Date
Alwin Antreich
c48801b52a test: parse_volname
Test to reduce the potential for accidental breakage on regex changes.
And to make sure that all vtype_subdirs are parsed.

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
Dominik Csapak
413862d2cb disk_tests: improve nvme smart test
by using an actual percentage for 'Percentage Used' instead of 0%

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2020-04-15 12:52:45 +02:00
Fabian Ebner
dcefd9dd28 fix #2085: add mountpoint property for non-default ZFS pool MPs
When adding a zfspool storage with 'pvesm add' the mount point is now
added automatically to the storage configuration if it can be
determined.  path() does not assume the default mountpoint anymore,
fixing 2085.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2019-11-21 12:42:38 +01:00
Fabian Grünbichler
56362cfb55 ZFS: refactor waiting for zvol symlinks
and actually do that not just for creating zvols, but also when
activating them. this should fix a range of issues/races that sometimes
occured on bootup, snapshot rollback or similar operations.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2019-08-06 13:39:43 +02:00
Dominik Csapak
bfb3d42daf Diskmanage: add flag for encrypted osds
we can only do this here, since the ceph cluster is not aware of
osd encryption, only the local node is (via ceph-volume and lv tags)

this way, we are able to show an 'encrypted' flag in the disk gui at least

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2019-07-12 15:38:24 +02:00
Dominik Csapak
1e6057d1b4 Diskmanage: fix usage test for sdd
sdd1 and sdd2 were listed in the zfs output but were not included
in the partlist, so the zfs detection test was wrong

now it is correct and more in line with the real world

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2019-07-12 15:37:57 +02:00
Dominik Csapak
b8cbfd362f Diskmanage: add test for lsblk by simulating zfs disk
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2019-07-12 15:37:57 +02:00
Dominik Csapak
8cd6d7e8e3 Diskmanage: change parttype uuid detection
previously ceph included a udev rule to populate
/dev/disk/by-parttypeuuid/

but not anymore, so we now use 'lsblk --json -o path,parttype' to
get a mapping between parttype uuid and partition

fix the test by simulating empty lsblk output

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2019-07-12 15:37:57 +02:00
Dominik Csapak
79f4a7bfd3 fix #2266: Diskmanage: get correct osd id
The osdid can consist of multiple digits, cope with that and add more
regression tests for this

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2019-07-08 19:04:08 +02:00
Dominik Csapak
35ccd3d004 fix missing osd info for osd 0
0 is falsy, we have to check for definedness
also adapt the tests so we test for this

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2019-07-03 08:59:47 +02:00
Dominik Csapak
ea928fd41a Diskmanage: extract nvme wearout from smartctl text
extract the info from the line:
Percentage Used: XX%

also adapt the tests

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2019-06-04 13:14:45 +02:00
Dominik Csapak
d0a217f624 tests: test get_disks single/multi disk filter
this executes all tests again with each disk as a single parameter
and all disks again as an array ref

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2019-06-04 12:51:44 +02:00
Dominik Csapak
b12883ded1 tests: improve error handling of run_disk_tests
if Diskmanage.pm has a syntax error, this will now catch it
during build

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2019-06-04 10:27:51 +02:00
Dominik Csapak
19dcd1adcb Diskmanage: detect osds/journals/etc. created with ceph-volume
ceph-volume creates osds/journal/etc. on LVM instead of partitions,
so to detect them, we have to parse the lv_tags of the LVs and
match them with the underlying device

also add tests for this detection

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2019-05-31 11:41:33 +02:00
Stoiko Ivanov
e71336ad88 add 3 bwlimit tests
1) checking that the empty storage list is treated correctly (only override
and datacenter config limit considered)
2) checking that the empty storage list is treated correctly (as with 1).
3) checking that undef can be passed as one element of the storage list (it is
ignored)

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2019-04-05 18:15:01 +02:00
Dominik Csapak
eebcdb1119 fix tests when one has iscsi devices
the test would read the real device and if one is an iscsi device
it would fail, move the test code to a sub and mock it in the tests

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2019-03-07 11:08:43 +01:00
Wolfgang Bumiller
c3442aa554 Fix #2020: use /sys to map nvmeXnY to nvmeX
`nvmeX` devices nodes are apparently allocated independently
from their namespace block devices `nvmeXnY` and therefore
they are not strictly related by name. For instance:
  $ readlink /sys/block/nvme0n1/device
  ../../nvme1
  $ readlink /sys/block/nvme1n1/device
  ../../nvme0

Here /dev/nvme0n1 is the first namespace of /dev/nvme1 while
/dev/nvme1n1 is the first namespace of /dev/nvme0.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2018-12-10 14:54:11 +01:00
Thomas Lamprecht
59fa9fd6a3 next diskname: start ids with 0 to honor MAX_VOLUMES_PER_GUEST
else we can only have MAX_VOLUMES_PER_GUEST-1 disk per VMID,
not tragic but possible confusing

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-09-10 11:21:12 +02:00
Thomas Lamprecht
361481cfd0 test: zfspoolplugin: fix perl lib path for test
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-08-28 16:40:31 +02:00
Dominik Csapak
1b8efb424c skip zfs tests when not building with root
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2018-08-01 10:46:12 +02:00
Wolfgang Link
c7b06c4f54 Remove pool with -f parameter.
The test pool will not removed if we do not force it.
2018-03-14 10:49:41 +01:00
Wolfgang Bumiller
77445e9b80 bwlimit: apply limits when there's no override
Before, 'undef' was equivalent to unlimited, but '0' is the
"explicitly unlimited" value, so if the user doesn't request
an override, apply limits as if the user was unprivileged
(otherwise there's no way for privileged users to explicitly
ask to not override the configured limits).

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2018-03-07 14:19:07 +01:00
Wolfgang Bumiller
9edb99a5a7 add Storage::get_bandwidth_limit helper
Takes an operation, an optional requested bandwidth
limit override, and a list of storages involved in the
operation and lowers the requested bandwidth against global
and storage-specific limits unless the user has permissions
to change those.
This means:
 * Global limits apply to all users without Sys.Modify on /
   (as they can change datacenter.cfg options via the API).
 * Storage specific limits apply to users without
   Datastore.Allocate access on /storage/X for any involved
   storage X.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2018-01-31 12:25:32 +01:00
Dominik Csapak
fc7c0e0504 (finally) fix #1099: return disklist correctly
in get_disks, when called with a parameter 'cciss/cXdY', we replaced
the '/' with '!' so that we can properly poll the information
about it from /sys/block/

but we have to replace the '!' with '/' again in our result list,
because the caller does not know anything about it and fails, because
the original dev is not in the list

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2017-11-14 13:23:52 +01:00
Dominik Csapak
e2bd817ccc add info about bluestore to disklist
this patch adds information about bluestore/db/wal to the disklist,
and we set the journal count only when we have at least one journal on
the disk

also adapt the regression tests

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2017-08-07 14:52:10 +02:00
Fabian Grünbichler
d1aa38aec2 disktest: exit with -1 in case of failures
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2017-06-06 16:15:42 +02:00
Fabian Grünbichler
e93e1bed73 zfstest: exit with -1 in case of failures
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2017-06-06 16:15:42 +02:00
Fabian Grünbichler
722eb1fe8a zfstest: skip tests if ZFS is not available
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2017-06-06 16:15:42 +02:00
Fabian Grünbichler
88ed02a391 zfstest: remove unused variable
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2017-06-06 16:15:42 +02:00
Fabian Grünbichler
2acdffbbb5 zfstest: fix typos
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2017-06-06 16:15:42 +02:00
Fabian Grünbichler
ca276fcbc2 zfstest: use truncate instead of dd
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2017-06-06 16:15:42 +02:00
Fabian Grünbichler
b13cf56109 zfstest: improve reset behaviour
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2017-06-06 16:15:42 +02:00
Fabian Grünbichler
078c28aac6 zfstest: wait for devices to settle after creation
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2017-06-06 16:15:42 +02:00
Fabian Grünbichler
a3b7bc374c zfstest: fix test description
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2017-06-06 16:15:42 +02:00
Fabian Grünbichler
91877ee016 zfstest: fix test 17 to actually deactivate storage
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2017-06-06 16:15:42 +02:00
Dominik Csapak
4661e1020b change regression test for crucial
as we now can parse the wearout

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2016-11-30 17:20:21 +01:00
Dominik Csapak
18d686368b correct regression test for sandisk ssds
in my initial patch series for the regression test, i failed to notice
the missing attributes for the sandisk ssds (which had not been parsed)

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2016-11-30 17:19:56 +01:00
Dominik Csapak
95089d78f8 add disk usages regression test
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2016-10-28 10:22:38 +02:00
Dominik Csapak
c78e2c57a4 add cciss regression test
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2016-10-28 10:22:31 +02:00
Dominik Csapak
d29f2c8136 add sas regression tests
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2016-10-28 10:22:23 +02:00
Dominik Csapak
1c7fb31e57 add nvme regression test
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2016-10-28 10:22:15 +02:00
Dominik Csapak
8ae0b78f64 add ssd and smart regression tests
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2016-10-28 10:22:08 +02:00
Dominik Csapak
b069cdec67 add hdd and smart regression tests
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2016-10-28 10:21:59 +02:00
Dominik Csapak
5774fe6262 add disklist test
and add to makefile

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2016-10-28 10:21:35 +02:00
Fabian Grünbichler
9924228be1 remove unused method
only used by test case, which should use what the rest of
the codebase uses as well
2016-09-15 13:42:55 +02:00
Wolfgang Link
3672677da5 add test PVE::Storage::path 2016-04-05 15:40:24 +02:00
Wolfgang Link
460015816b Select test form command
It is possible to select the test what should run.
synopsis: run_test_zfspoolplugin.pl [<test_num> | <start_test_num> <end_test_num>]
2016-04-05 15:39:46 +02:00
Dietmar Maurer
b3bb525e45 fix zfs tests: isBase is a boolean flag 2016-04-04 08:50:12 +02:00
Wolfgang Link
81ebc68f34 Add Tests for ZFSPoolPlugin 2016-04-04 06:38:15 +02:00