]>
git.proxmox.com Git - pve-manager.git/blob - test/OSD_test.pl
10 use PVE
::API2
::Ceph
::OSD
;
14 # NOTE: not exhausive, reduced to actually required fields!
20 children
=> [ 0,1,2,3 ],
26 children
=> [ 4,5,6,7 ],
32 children
=> [ 8,9,10,11 ],
39 # Check if all the grep and casts are correct
40 my @belong_to_B = ( 4,5 );
41 my @not_belong_to_B = ( -1,1,10,15 );
42 foreach (@belong_to_B) {
44 PVE
::API2
::Ceph
::OSD
::osd_belongs_to_node
($tree, 'pveB', $_),
46 "OSD $_ belongs to node pveB",
49 foreach (@not_belong_to_B) {
51 PVE
::API2
::Ceph
::OSD
::osd_belongs_to_node
($tree, 'pveB', $_),
53 "OSD $_ does not belong to node pveB",
58 my $double_nodes_tree = {
70 eval { PVE
::API2
::Ceph
::OSD
::osd_belongs_to_node
($double_nodes_tree, 'pveA') };
71 like
($@, qr/duplicate host name found/, "Die if node occurs too often");
74 PVE
::API2
::Ceph
::OSD
::osd_belongs_to_node
(undef),
76 "Early-return false if there's no/empty node tree",
80 done_testing
(@belong_to_B + @not_belong_to_B + 2);