From da414d766f94e387f031f130872f2dce2db4aac5 Mon Sep 17 00:00:00 2001 From: Daniel Verkamp Date: Thu, 16 Feb 2017 10:01:50 -0700 Subject: [PATCH] test/iscsi_tgt/fio: pass pid to running_config We already know the PID of the iscsi_tgt process since we launched it ourselves; drop the use of the pidfile. Change-Id: Ib1569c5b507ac85f26020937a007f5d7df090d99 Signed-off-by: Daniel Verkamp --- test/iscsi_tgt/fio/fio.sh | 2 +- test/iscsi_tgt/fio/running_config.sh | 13 +++++-------- 2 files changed, 6 insertions(+), 9 deletions(-) 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