test/iscsi_tgt: Port running_config test to JSON config and re-enable it.
Change-Id: I7619ea8dc94e76934c8ebb37f4248376feaa23ef Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com> Reviewed-on: https://review.gerrithub.io/433200 Reviewed-by: Jim Harris <james.r.harris@intel.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com> Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
This commit is contained in:
parent
a66c9ffd50
commit
78a45b3f45
@ -6,13 +6,13 @@ source $rootdir/test/common/autotest_common.sh
|
||||
source $rootdir/test/iscsi_tgt/common.sh
|
||||
|
||||
delete_tmp_files() {
|
||||
rm -f $testdir/iscsi2.json
|
||||
rm -f ./local-job0-0-verify.state
|
||||
}
|
||||
|
||||
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 $pid
|
||||
# dump a config file from the running iscsi_tgt
|
||||
$rpc_py save_config > $testdir/iscsi2.json
|
||||
sleep 1
|
||||
|
||||
# now start iscsi_tgt again using the generated config file
|
||||
@ -23,11 +23,14 @@ function running_config() {
|
||||
|
||||
timing_enter start_iscsi_tgt2
|
||||
|
||||
$ISCSI_APP -c /tmp/iscsi.conf &
|
||||
$ISCSI_APP --wait-for-rpc &
|
||||
pid=$!
|
||||
echo "Process pid: $pid"
|
||||
trap "iscsicleanup; killprocess $pid; delete_tmp_files; exit 1" SIGINT SIGTERM EXIT
|
||||
waitforlisten $pid
|
||||
|
||||
$rpc_py load_config < $testdir/iscsi2.json
|
||||
|
||||
echo "iscsi_tgt is listening. Running tests..."
|
||||
|
||||
timing_exit start_iscsi_tgt2
|
||||
|
@ -1,22 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -xe
|
||||
|
||||
pid="$1"
|
||||
|
||||
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 "$pid"
|
||||
|
||||
if [ ! -f $(ls /tmp/iscsi.conf.*) ]; then
|
||||
echo "iscsi_tgt did not generate config file"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
mv $(ls /tmp/iscsi.conf.*) /tmp/iscsi.conf
|
Loading…
Reference in New Issue
Block a user