Skip to content

Commit

Permalink
sharness: fix indent in few more places
Browse files Browse the repository at this point in the history
License: MIT
Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
  • Loading branch information
magik6k committed Sep 6, 2017
1 parent 4dd12cc commit b6b1f6a
Show file tree
Hide file tree
Showing 7 changed files with 51 additions and 51 deletions.
36 changes: 18 additions & 18 deletions test/sharness/lib/install-sharness.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,35 +15,35 @@ sharnessdir=sharness

if test -f "$clonedir/$sharnessdir/SHARNESS_VERSION_$version"
then
# There is the right version file. Great, we are done!
exit 0
# There is the right version file. Great, we are done!
exit 0
fi

die() {
echo >&2 "$@"
exit 1
echo >&2 "$@"
exit 1
}

checkout_version() {
git checkout "$version" || die "Could not checkout '$version'"
rm -f SHARNESS_VERSION_* || die "Could not remove 'SHARNESS_VERSION_*'"
touch "SHARNESS_VERSION_$version" || die "Could not create 'SHARNESS_VERSION_$version'"
echo "Sharness version $version is checked out!"
git checkout "$version" || die "Could not checkout '$version'"
rm -f SHARNESS_VERSION_* || die "Could not remove 'SHARNESS_VERSION_*'"
touch "SHARNESS_VERSION_$version" || die "Could not create 'SHARNESS_VERSION_$version'"
echo "Sharness version $version is checked out!"
}

if test -d "$clonedir/$sharnessdir/.git"
then
# We need to update sharness!
cd "$clonedir/$sharnessdir" || die "Could not cd into '$clonedir/$sharnessdir' directory"
git fetch || die "Could not fetch to update sharness"
checkout_version
# We need to update sharness!
cd "$clonedir/$sharnessdir" || die "Could not cd into '$clonedir/$sharnessdir' directory"
git fetch || die "Could not fetch to update sharness"
checkout_version
else
# We need to clone sharness!
mkdir -p "$clonedir" || die "Could not create '$clonedir' directory"
cd "$clonedir" || die "Could not cd into '$clonedir' directory"
# We need to clone sharness!
mkdir -p "$clonedir" || die "Could not create '$clonedir' directory"
cd "$clonedir" || die "Could not cd into '$clonedir' directory"

git clone "$urlprefix" || die "Could not clone '$urlprefix'"
cd "$sharnessdir" || die "Could not cd into '$sharnessdir' directory"
checkout_version
git clone "$urlprefix" || die "Could not clone '$urlprefix'"
cd "$sharnessdir" || die "Could not cd into '$sharnessdir' directory"
checkout_version
fi
exit 0
50 changes: 25 additions & 25 deletions test/sharness/lib/test-lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -226,11 +226,11 @@ test_launch_ipfs_daemon() {
}

do_umount() {
if [ "$(uname -s)" = "Linux" ]; then
if [ "$(uname -s)" = "Linux" ]; then
fusermount -u "$1"
else
else
umount "$1"
fi
fi
}

test_mount_ipfs() {
Expand Down Expand Up @@ -335,36 +335,36 @@ test_str_contains() {
}

disk_usage() {
# normalize du across systems
case $(uname -s) in
Linux)
DU="du -sb"
# normalize du across systems
case $(uname -s) in
Linux)
DU="du -sb"
M=1
;;
FreeBSD)
DU="du -s -A -B 1"
;;
FreeBSD)
DU="du -s -A -B 1"
M=512
;;
Darwin | DragonFly | *)
DU="du -s"
;;
Darwin | DragonFly | *)
DU="du -s"
M=512
;;
esac
;;
esac
expr $($DU "$1" | awk "{print \$1}") "*" "$M"
}

# output a file's permission in human readable format
generic_stat() {
# normalize stat across systems
case $(uname -s) in
Linux)
_STAT="stat -c %A"
;;
FreeBSD | Darwin | DragonFly)
_STAT="stat -f %Sp"
;;
esac
$_STAT "$1" || echo "failed" # Avoid returning nothing.
# normalize stat across systems
case $(uname -s) in
Linux)
_STAT="stat -c %A"
;;
FreeBSD | Darwin | DragonFly)
_STAT="stat -f %Sp"
;;
esac
$_STAT "$1" || echo "failed" # Avoid returning nothing.
}

test_check_peerid() {
Expand Down
4 changes: 2 additions & 2 deletions test/sharness/t0021-config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@ test_config_cmd_set() {
# (i.e. just setting 'ipfs config --json foo "[1, 2, 3]"') may
# set it as astring instead of proper json. We leverage the
# unmarshalling that has to happen.
CONFIG_SET_JSON_TEST='{
CONFIG_SET_JSON_TEST=$(echo '{
"MDNS": {
"Enabled": true,
"Interval": 10
}
}'
}' | sed 's/\t/ /g')

test_config_cmd() {
test_config_cmd_set "beep" "boop"
Expand Down
4 changes: 2 additions & 2 deletions test/sharness/t0042-add-skip.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ test_add_skip() {
'

test_expect_success "'ipfs add' includes hidden files given explicitly even without --hidden" '
mkdir -p mountdir/dotfiles &&
echo "set nocompatible" > mountdir/dotfiles/.vimrc
mkdir -p mountdir/dotfiles &&
echo "set nocompatible" > mountdir/dotfiles/.vimrc
cat >expected <<-\EOF &&
added QmT4uMRDCN7EMpFeqwvKkboszbqeW1kWVGrBxBuCGqZcQc .vimrc
EOF
Expand Down
2 changes: 1 addition & 1 deletion test/sharness/t0083-repo-fsck.sh
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ test_expect_success "'ipfs repo fsck' succeeds partial lock" '
'

test_expect_success "'ipfs repo fsck' output looks good with no daemon" '
grep "Lockfiles have been removed." fsck_out_actual2
grep "Lockfiles have been removed." fsck_out_actual2
'

# Make sure the files are actually removed
Expand Down
2 changes: 1 addition & 1 deletion test/sharness/t0250-files-api.sh
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,7 @@ test_files_api() {
verify_dir_contents /
'

test_expect_success "repo gc" '
test_expect_success "repo gc" '
ipfs repo gc
'
}
Expand Down
4 changes: 2 additions & 2 deletions test/sharness/t0271-filestore-utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,8 @@ test_filestore_verify() {
grep changed verify_actual | grep -q somedir/file3
'

# reset the state for the next test
test_init_dataset
# reset the state for the next test
test_init_dataset
}

test_filestore_dups() {
Expand Down

0 comments on commit b6b1f6a

Please sign in to comment.