Prefer = over == for older shell compatibility (#1857)

This commit is contained in:
Andrew Gaul 2022-01-14 12:40:55 +09:00 committed by GitHub
parent 2892d3b755
commit 6300859c80
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 8 deletions

View File

@ -108,7 +108,7 @@ function retry {
for i in $(seq $N); do
echo "Trying: $*"
eval $@; rc=$?
if [ $rc == 0 ]; then
if [ $rc = 0 ]; then
break
fi
sleep 1

View File

@ -262,7 +262,7 @@ function test_chmod {
# if they're the same, we have a problem.
local CHANGED_PERMISSIONS=$(get_permissions $TEST_TEXT_FILE)
if [ $CHANGED_PERMISSIONS == $ORIGINAL_PERMISSIONS ]
if [ $CHANGED_PERMISSIONS = $ORIGINAL_PERMISSIONS ]
then
echo "Could not modify $TEST_TEXT_FILE permissions"
return 1
@ -299,9 +299,9 @@ function test_chown {
else
local CHANGED_PERMISSIONS=$(stat --format=%u:%g $TEST_TEXT_FILE)
fi
if [ $CHANGED_PERMISSIONS == $ORIGINAL_PERMISSIONS ]
if [ $CHANGED_PERMISSIONS = $ORIGINAL_PERMISSIONS ]
then
if [ $ORIGINAL_PERMISSIONS == "1000:1000" ]
if [ $ORIGINAL_PERMISSIONS = "1000:1000" ]
then
echo "Could not be strict check because original file permission 1000:1000"
else

View File

@ -115,7 +115,7 @@ function check_file_size() {
}
function mk_test_file {
if [ $# == 0 ]; then
if [ $# = 0 ]; then
local TEXT=$TEST_TEXT
else
local TEXT=$1
@ -144,7 +144,7 @@ function mk_test_file {
}
function rm_test_file {
if [ $# == 0 ]; then
if [ $# = 0 ]; then
local FILE=$TEST_TEXT_FILE
else
local FILE=$1
@ -178,7 +178,7 @@ function rm_test_dir {
# Create and cd to a unique directory for this test run
# Sets RUN_DIR to the name of the created directory
function cd_run_dir {
if [ "$TEST_BUCKET_MOUNT_POINT_1" == "" ]; then
if [ "$TEST_BUCKET_MOUNT_POINT_1" = "" ]; then
echo "TEST_BUCKET_MOUNT_POINT_1 variable not set"
exit 1
fi
@ -240,7 +240,7 @@ function run_suite {
TEST_DIR=testdir-$RANDOM
$t $key_prefix && rc=$? || rc=$?
if [[ $rc == 0 ]] ; then
if [[ $rc = 0 ]] ; then
report_pass $t
else
report_fail $t