test/nvmf: Use $USER instead of logname to follow other cases

$USER gives the login name who logged in the terminal and
logname prints the login name who logged in the session.

test/nvmf/common.sh has used $USER to start the SPDK application,
as non-root but test/nvmf/host/perf.sh and
test/nvmf/target/nvmf_example.sh have used logname to start the
example application as non-root.

It looks OK to use $USER to start application as non-root like other
cases.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Ia0a17e3bd37a76e4d808e5816ba6716920f8f340
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4090
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
This commit is contained in:
Shuhei Matsumoto 2020-09-08 00:52:50 +09:00 committed by Tomasz Zawadzki
parent 5cf0c3707f
commit 0ecb36c727
2 changed files with 2 additions and 2 deletions

View File

@ -32,7 +32,7 @@ $rpc_py nvmf_subsystem_add_listener nqn.2016-06.io.spdk:cnode1 -t $TEST_TRANSPOR
# Test multi-process access to local NVMe device # Test multi-process access to local NVMe device
if [ -n "$local_nvme_trid" ]; then if [ -n "$local_nvme_trid" ]; then
if [ $SPDK_RUN_NON_ROOT -eq 1 ]; then if [ $SPDK_RUN_NON_ROOT -eq 1 ]; then
perf_app="sudo -u $(logname) $SPDK_EXAMPLE_DIR/perf" perf_app="sudo -u $USER $SPDK_EXAMPLE_DIR/perf"
else else
perf_app="$SPDK_EXAMPLE_DIR/perf" perf_app="$SPDK_EXAMPLE_DIR/perf"
fi fi

View File

@ -12,7 +12,7 @@ MALLOC_BLOCK_SIZE=512
function build_nvmf_example_args() { function build_nvmf_example_args() {
if [ $SPDK_RUN_NON_ROOT -eq 1 ]; then if [ $SPDK_RUN_NON_ROOT -eq 1 ]; then
echo "sudo -u $(logname) $SPDK_EXAMPLE_DIR/nvmf -i $NVMF_APP_SHM_ID" -g 10000 echo "sudo -u $USER $SPDK_EXAMPLE_DIR/nvmf -i $NVMF_APP_SHM_ID" -g 10000
else else
echo "$SPDK_EXAMPLE_DIR/nvmf -i $NVMF_APP_SHM_ID" -g 10000 echo "$SPDK_EXAMPLE_DIR/nvmf -i $NVMF_APP_SHM_ID" -g 10000
fi fi