diff options
author | Mao Zhongyi <maozhongyi@cmss.chinamobile.com> | 2018-11-16 14:33:03 -0600 |
---|---|---|
committer | Eric Blake <eblake@redhat.com> | 2018-11-19 10:08:19 -0600 |
commit | e8d81a61e1b9e28267164f751dee5b9b59444e71 (patch) | |
tree | 1086e80b29b3a17243fc4b527379d4a9a6b1aa31 /tests/qemu-iotests | |
parent | bf22957309369cf6f642e715ff6c470671920e7e (diff) |
qemu-iotests: convert `pwd` and $(pwd) to $PWD
POSIX requires $PWD to be reliable, and we expect all
shells used by qemu scripts to be relatively close to
POSIX. Thus, it is smarter to avoid forking the pwd
executable for something that is already available in
the environment.
So replace it with the following:
sed -i 's/\(`pwd`\|\$(pwd)\)/$PWD/g' $(git grep -l pwd)
Then delete a pointless line assigning PWD to itself.
Cc: kwolf@redhat.com
Cc: mreitz@redhat.com
Cc: eblake@redhat.com
Suggested-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Mao Zhongyi <maozhongyi@cmss.chinamobile.com>
Message-Id: <20181024094051.4470-2-maozhongyi@cmss.chinamobile.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
[eblake: touch up commit message, reorder series, tweak a couple more files]
Signed-off-by: Eric Blake <eblake@redhat.com>
Diffstat (limited to 'tests/qemu-iotests')
-rwxr-xr-x | tests/qemu-iotests/check | 2 | ||||
-rw-r--r-- | tests/qemu-iotests/common.config | 2 | ||||
-rw-r--r-- | tests/qemu-iotests/common.rc | 2 |
3 files changed, 2 insertions, 4 deletions
diff --git a/tests/qemu-iotests/check b/tests/qemu-iotests/check index aa94c6c7ea..b37713277d 100755 --- a/tests/qemu-iotests/check +++ b/tests/qemu-iotests/check @@ -99,7 +99,7 @@ set_prog_path() } if [ -z "$TEST_DIR" ]; then - TEST_DIR=`pwd`/scratch + TEST_DIR=$PWD/scratch fi if [ ! -e "$TEST_DIR" ]; then diff --git a/tests/qemu-iotests/common.config b/tests/qemu-iotests/common.config index 102aa6878a..3cda0fe569 100644 --- a/tests/qemu-iotests/common.config +++ b/tests/qemu-iotests/common.config @@ -25,8 +25,6 @@ HOSTOS=`uname -s` arch=`uname -m` [[ "$arch" =~ "ppc64" ]] && qemu_arch=ppc64 || qemu_arch="$arch" -export PWD=`pwd` - # make sure we have a standard umask umask 022 diff --git a/tests/qemu-iotests/common.rc b/tests/qemu-iotests/common.rc index 70ca65b49b..e15e7a7c8e 100644 --- a/tests/qemu-iotests/common.rc +++ b/tests/qemu-iotests/common.rc @@ -160,7 +160,7 @@ fi ORIG_TEST_IMG="$TEST_IMG" if [ -z "$TEST_DIR" ]; then - TEST_DIR=`pwd`/scratch + TEST_DIR=$PWD/scratch fi QEMU_TEST_DIR="${TEST_DIR}" |