aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMaarten Vanraes <alien@mageia.org>2016-02-10 20:58:12 +0100
committerMaarten Vanraes <alien@mageia.org>2016-05-14 09:25:23 +0200
commit5df68c9d44b6c63f14c630b5710de774aa212ac9 (patch)
treefcab1fc1f0511d4944cea5ee903a1eda42fd4d71
parented6ed8be4829ab09ffaf7dc7506db12351b74ca8 (diff)
downloadmanatools-5df68c9d44b6c63f14c630b5710de774aa212ac9.tar
manatools-5df68c9d44b6c63f14c630b5710de774aa212ac9.tar.gz
manatools-5df68c9d44b6c63f14c630b5710de774aa212ac9.tar.bz2
manatools-5df68c9d44b6c63f14c630b5710de774aa212ac9.tar.xz
manatools-5df68c9d44b6c63f14c630b5710de774aa212ac9.zip
add a disk backend test file
-rw-r--r--t/10-Shared-disk_backend.t41
1 files changed, 41 insertions, 0 deletions
diff --git a/t/10-Shared-disk_backend.t b/t/10-Shared-disk_backend.t
new file mode 100644
index 00000000..3ce5e985
--- /dev/null
+++ b/t/10-Shared-disk_backend.t
@@ -0,0 +1,41 @@
+use 5.006;
+use strict;
+use warnings FATAL => 'all';
+use Test::More;
+use Data::Dumper;
+
+BEGIN {
+ use_ok( 'ManaTools::Shared::disk_backend' ) || print "ManaTools::Shared::disk_backend failed!\n";
+}
+
+ok ( my $obj = ManaTools::Shared::disk_backend->new(), 'new_disk_backend');
+diag Dumper($obj);
+# check load / probe / save
+ok ( $obj->load(), 'load_disk_backend');
+diag Dumper($obj);
+ok ( $obj->probe(), 'probe_disk_backend');
+diag Dumper($obj);
+ok ( $obj->save(), 'save_disk_backend');
+diag Dumper($obj);
+# check find* functions too
+ok ( my @parts = $obj->findnoin(), 'no_in_disk_backend');
+diag Dumper(@parts);
+my @ios = ();
+if (scalar(@parts) > 0) {
+ ok ( my @ios = $parts[0]->out_list(), 'ios_no_out_disk_backend');
+}
+diag Dumper(@ios);
+ok ( @parts = $obj->findnoout(), 'no_out_disk_backend');
+diag Dumper(@parts);
+@ios = ();
+if (scalar(@parts) > 0) {
+ ok ( @ios = $parts[0]->in_list(), 'ios_no_in_disk_backend');
+}
+diag Dumper(@ios);
+ok ( @parts = $obj->findpart('Disk'), 'find_part_disk_backend');
+diag Dumper(@parts);
+ok ( @ios = $obj->findioprop('dev', '8:0'), 'find_io_via_prop_disk_backend');
+diag Dumper(@ios);
+
+
+done_testing;