From 198cb64c8d997717366334e3090ec410579852f0 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Thu, 14 May 2020 16:37:18 +0000 Subject: [PATCH] scstadmin: Make test 06 more robust git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8913 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- .../scstadmin.sysfs/scst-1.0.0/t/06-cont-on-err.t | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/scstadmin/scstadmin.sysfs/scst-1.0.0/t/06-cont-on-err.t b/scstadmin/scstadmin.sysfs/scst-1.0.0/t/06-cont-on-err.t index 8027c5a68..a47e6e5d9 100644 --- a/scstadmin/scstadmin.sysfs/scst-1.0.0/t/06-cont-on-err.t +++ b/scstadmin/scstadmin.sysfs/scst-1.0.0/t/06-cont-on-err.t @@ -24,7 +24,7 @@ BEGIN { unless(grep /blib/, @INC) { unshift(@INC, File::Spec->catdir($scstadmin_pm_dir, "lib")); } - plan tests => 5; + plan tests => 6; } use Data::Dumper; @@ -46,12 +46,15 @@ sub testRestoreConfig { "scstadmin-test-06-$$-1"); my $tmpfilename2 = File::Spec->catfile(File::Spec->tmpdir(), "scstadmin-test-06-$$-2"); + my $scstadmin_output = File::Spec->catfile(File::Spec->tmpdir(), + "scstadmin-test-06-$$-adm-out"); my $diff = File::Spec->catfile(File::Spec->tmpdir(), "scstadmin-test-06-$$-diff"); - ok(system("$scstadmin -clear_config -force -noprompt -no_lip $redirect"), 0); - system("$scstadmin -cont_on_err -no_lip -config $to_be_restored" . - " >/dev/null"); + ok(system("$scstadmin -clear_config -force -noprompt -no_lip $redirect"), + 0); + ok(system("$scstadmin -cont_on_err -no_lip -config $to_be_restored" . + " > " . $scstadmin_output . " 2>&1"), 256); ok(system("$scstadmin -write_config $tmpfilename1 >/dev/null"), 0); ok(system("awk 'BEGIN {t = 0 } /^# Automatically generated by SCST Configurator v/ " . '{ $0 = "# Automatically generated by SCST Configurator v..." } ' . @@ -78,6 +81,8 @@ if ($_DEBUG_) { $redirect = ">/dev/null"; } +unlink("/var/lib/scst/vdev_mode_pages/disk01"); + my $SCST = eval { new SCST::SCST($_DEBUG_) }; die("Creation of SCST object failed") if (!defined($SCST));