scstadmin: Fix a few bugs in the regression test code

git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7166 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Bart Van Assche
2017-05-04 02:36:37 +00:00
parent 642744c9fc
commit 3abfda9ec0
3 changed files with 4 additions and 6 deletions

View File

@@ -25,7 +25,6 @@ if ($> == 0) {
ok(system("modprobe scst_local add_default_tgt=0 && " .
"modprobe iscsi-scst && " .
"modprobe ib_srpt && " .
"modprobe qla2x00tgt && " .
"modprobe scst_vdisk && " .
"iscsi-scstd"), 0);
"../../../iscsi-scst/usr/iscsi-scstd"), 0);
}

View File

@@ -14,9 +14,7 @@ HANDLER vdisk_fileio {
}
HANDLER vdisk_nullio {
DEVICE nodev {
dummy 1
}
DEVICE nodev
}
TARGET_DRIVER scst_local {

View File

@@ -68,7 +68,8 @@ sub attributeTest {
system("$scstadmin -driver scst_local -target local -group ig " .
"-add_lun 1 -device disk1 $redirect");
system("$scstadmin -write_config $tmpfilename1 >/dev/null");
system("awk 'BEGIN { t = 0 } /^# Automatically generated by SCST Configurator v/ { \$0 = \"# Automatically generated by SCST Configurator v...\" } /^TARGET_DRIVER.*{\$/ { if (\$0 != \"TARGET_DRIVER scst_local {\") t = 1 } /^}\$/ { if (t == 1) t = 2 } /^\$/ { if (t == 2) { t = 3 } } /^./ { if (t == 3) { t = 0 } } { if (t == 0) print }' <$tmpfilename1 >$tmpfilename2");
# Keep only the scst_local target driver information.
system("awk 'BEGIN { t = 0 } /^# Automatically generated by SCST Configurator v/ { \$0 = \"# Automatically generated by SCST Configurator v...\" } /^TARGET_DRIVER.*{\$/ { if (match(\$0, \"TARGET_DRIVER ([^ ]*) {\", d) && d[1] != \"scst_local\") t = 1 } /^}\$/ { if (t == 1) t = 2 } /^\$/ { if (t == 2) { t = 3 } } /^./ { if (t == 3) { t = 0 } } { if (t == 0) print }' <$tmpfilename1 >$tmpfilename2");
my $compare_result = system("diff -u $tmpfilename2 $expected >$diff");
ok($compare_result, 0);
if ($compare_result == 0) {