From 0ecb36c727cd103655504d3ba53df67c7606da27 Mon Sep 17 00:00:00 2001 From: Shuhei Matsumoto Date: Tue, 8 Sep 2020 00:52:50 +0900 Subject: [PATCH] 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 Change-Id: Ia0a17e3bd37a76e4d808e5816ba6716920f8f340 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4090 Tested-by: SPDK CI Jenkins Community-CI: Broadcom CI Reviewed-by: Ben Walker Reviewed-by: Tomasz Zawadzki --- test/nvmf/host/perf.sh | 2 +- test/nvmf/target/nvmf_example.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/nvmf/host/perf.sh b/test/nvmf/host/perf.sh index 69fa28f0b..4d70bd83d 100755 --- a/test/nvmf/host/perf.sh +++ b/test/nvmf/host/perf.sh @@ -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 if [ -n "$local_nvme_trid" ]; 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 perf_app="$SPDK_EXAMPLE_DIR/perf" fi diff --git a/test/nvmf/target/nvmf_example.sh b/test/nvmf/target/nvmf_example.sh index 28045bc49..256295a87 100755 --- a/test/nvmf/target/nvmf_example.sh +++ b/test/nvmf/target/nvmf_example.sh @@ -12,7 +12,7 @@ MALLOC_BLOCK_SIZE=512 function build_nvmf_example_args() { 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 echo "$SPDK_EXAMPLE_DIR/nvmf -i $NVMF_APP_SHM_ID" -g 10000 fi