diff --git a/scstadmin/scstadmin.sysfs/scst-0.9.10/t/01-start-scst.t b/scstadmin/scstadmin.sysfs/scst-0.9.10/t/01-start-scst.t index 24b5f7e50..d1de1754f 100644 --- a/scstadmin/scstadmin.sysfs/scst-0.9.10/t/01-start-scst.t +++ b/scstadmin/scstadmin.sysfs/scst-0.9.10/t/01-start-scst.t @@ -4,15 +4,24 @@ use strict; use Test; BEGIN { - plan tests => ($> == 0) ? 2 : 0; + plan tests => ($> == 0) ? 3 : 0; } if ($> == 0) { - system("/etc/init.d/scst stop"); + ok(system("killall iscsi-scstd >/dev/null 2>&1; " . + "modprobe -r scst_local; " . + "modprobe -r iscsi-scst; " . + "modprobe -r ib_srpt; " . + "modprobe -r qla2x00tgt; " . + "modprobe -r qla2xxx_scst; " . + "modprobe -r scst_vdisk"), 0); + ok(!(-d "/sys/module/scst")); ok(system("modprobe scst_local add_default_tgt=0 && " . "modprobe iscsi-scst && " . + "modprobe ib_srpt && " . + "modprobe qla2x00tgt && " . "modprobe scst_vdisk && " . "/usr/local/sbin/iscsi-scstd"), 0); } diff --git a/scstadmin/scstadmin.sysfs/scst-0.9.10/t/03-targets.t b/scstadmin/scstadmin.sysfs/scst-0.9.10/t/03-targets.t index d0f9d98b5..547ed82af 100644 --- a/scstadmin/scstadmin.sysfs/scst-0.9.10/t/03-targets.t +++ b/scstadmin/scstadmin.sysfs/scst-0.9.10/t/03-targets.t @@ -4,7 +4,7 @@ use strict; use Test; BEGIN { - plan tests => 179; + plan tests => 181; } use Data::Dumper; @@ -17,7 +17,20 @@ sub addTargets { ok($SCST->{'err_string'}, "targets(): Driver 'no-such-driver' is not available"); - ok(Dumper($SCST->drivers()), Dumper(['iscsi', 'scst_local'])); + my %drivers = map { $_ => 1 } @{$SCST->drivers()}; + ok(exists($drivers{'iscsi'})); + ok(exists($drivers{'scst_local'})); + + my $all_hw_tgt = 1; + for my $driver (@{$SCST->drivers()}) { + for my $target (@{$SCST->targets($driver)}) { + if ($SCST->targetType($driver, $target) != + $SCST::SCST::TGT_TYPE_HARDWARE) { + $all_hw_tgt = undef; + } + } + } + ok($all_hw_tgt); ok(Dumper($SCST->targets()), Dumper(undef)); ok(Dumper($SCST->targets('no-such-driver')), Dumper(undef)); diff --git a/scstadmin/scstadmin.sysfs/scst-0.9.10/t/04-alua.t b/scstadmin/scstadmin.sysfs/scst-0.9.10/t/04-alua.t index 9949b9211..be0ffcbde 100644 --- a/scstadmin/scstadmin.sysfs/scst-0.9.10/t/04-alua.t +++ b/scstadmin/scstadmin.sysfs/scst-0.9.10/t/04-alua.t @@ -4,7 +4,7 @@ use strict; use Test; BEGIN { - plan tests => 64; + plan tests => 65; } use Data::Dumper; @@ -13,7 +13,9 @@ use SCST::SCST; sub setup { my $SCST = shift; - ok(Dumper($SCST->drivers()), Dumper(['iscsi', 'scst_local'])); + my %drivers = map { $_ => 1 } @{$SCST->drivers()}; + ok(exists($drivers{'iscsi'})); + ok(exists($drivers{'scst_local'})); ok($SCST->openDevice("vdisk_fileio", "disk01", { 'filename' => '/proc/cpuinfo' }), 0); diff --git a/scstadmin/scstadmin.sysfs/scst-0.9.10/t/05-dynattr.t b/scstadmin/scstadmin.sysfs/scst-0.9.10/t/05-dynattr.t index fc60e3482..47592e516 100644 --- a/scstadmin/scstadmin.sysfs/scst-0.9.10/t/05-dynattr.t +++ b/scstadmin/scstadmin.sysfs/scst-0.9.10/t/05-dynattr.t @@ -4,7 +4,7 @@ use strict; use Test; BEGIN { - plan tests => 56; + plan tests => 57; } use Data::Dumper; @@ -13,7 +13,9 @@ use SCST::SCST; sub setup { my $SCST = shift; - ok(Dumper($SCST->drivers()), Dumper(['iscsi', 'scst_local'])); + my %drivers = map { $_ => 1 } @{$SCST->drivers()}; + ok(exists($drivers{'iscsi'})); + ok(exists($drivers{'scst_local'})); ok($SCST->openDevice("vdisk_fileio", "disk01", { 'filename' => '/proc/cpuinfo' }), 0); diff --git a/scstadmin/scstadmin.sysfs/scst-0.9.10/t/99-stop-scst.t b/scstadmin/scstadmin.sysfs/scst-0.9.10/t/99-stop-scst.t index b7a762fbd..6aeda35bd 100644 --- a/scstadmin/scstadmin.sysfs/scst-0.9.10/t/99-stop-scst.t +++ b/scstadmin/scstadmin.sysfs/scst-0.9.10/t/99-stop-scst.t @@ -4,11 +4,17 @@ use strict; use Test; BEGIN { - plan tests => 1; + plan tests => 2; } if ($> == 0) { - system("/etc/init.d/scst stop"); + ok(system("killall iscsi-scstd; " . + "modprobe -r scst_local; " . + "modprobe -r iscsi-scst; " . + "modprobe -r ib_srpt; " . + "modprobe -r qla2x00tgt; " . + "modprobe -r qla2xxx_scst; " . + "modprobe -r scst_vdisk"), 0); ok(!(-d "/sys/module/scst")); } else { ok(1);