diff --git a/test/iscsi_tgt/fio/fio.sh b/test/iscsi_tgt/fio/fio.sh index 7936e4611..5778c4102 100755 --- a/test/iscsi_tgt/fio/fio.sh +++ b/test/iscsi_tgt/fio/fio.sh @@ -7,7 +7,7 @@ source $rootdir/scripts/autotest_common.sh function running_config() { # generate a config file from the running iscsi_tgt # running_config.sh will leave the file at /tmp/iscsi.conf - $testdir/running_config.sh + $testdir/running_config.sh $pid sleep 1 # now start iscsi_tgt again using the generated config file diff --git a/test/iscsi_tgt/fio/running_config.sh b/test/iscsi_tgt/fio/running_config.sh index 796132408..d2bbcecf6 100755 --- a/test/iscsi_tgt/fio/running_config.sh +++ b/test/iscsi_tgt/fio/running_config.sh @@ -2,23 +2,20 @@ set -xe -if [ $EUID -ne 0 ]; then - echo "$0 must be run as root" - exit 1 -fi +pid="$1" -if [ ! -f /var/run/iscsi.pid.0 ]; then - echo "ids is not running" +if [[ -z "$pid" ]]; then + echo "usage: $0 pid" exit 1 fi # delete any existing temporary iscsi.conf files rm -f /tmp/iscsi.conf.* -kill -USR1 `cat /var/run/iscsi.pid.0` +kill -USR1 "$pid" if [ ! -f `ls /tmp/iscsi.conf.*` ]; then - echo "ids did not generate config file" + echo "iscsi_tgt did not generate config file" exit 1 fi