1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-07-03 04:37:30 +08:00

sharness: fix indent in few more places

License: MIT
Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
This commit is contained in:
Łukasz Magiera
2017-09-06 21:14:21 +02:00
parent 9d14b47fef
commit fdccfea029
7 changed files with 51 additions and 51 deletions

View File

@ -15,35 +15,35 @@ sharnessdir=sharness
if test -f "$clonedir/$sharnessdir/SHARNESS_VERSION_$version" if test -f "$clonedir/$sharnessdir/SHARNESS_VERSION_$version"
then then
# There is the right version file. Great, we are done! # There is the right version file. Great, we are done!
exit 0 exit 0
fi fi
die() { die() {
echo >&2 "$@" echo >&2 "$@"
exit 1 exit 1
} }
checkout_version() { checkout_version() {
git checkout "$version" || die "Could not checkout '$version'" git checkout "$version" || die "Could not checkout '$version'"
rm -f SHARNESS_VERSION_* || die "Could not remove 'SHARNESS_VERSION_*'" rm -f SHARNESS_VERSION_* || die "Could not remove 'SHARNESS_VERSION_*'"
touch "SHARNESS_VERSION_$version" || die "Could not create 'SHARNESS_VERSION_$version'" touch "SHARNESS_VERSION_$version" || die "Could not create 'SHARNESS_VERSION_$version'"
echo "Sharness version $version is checked out!" echo "Sharness version $version is checked out!"
} }
if test -d "$clonedir/$sharnessdir/.git" if test -d "$clonedir/$sharnessdir/.git"
then then
# We need to update sharness! # We need to update sharness!
cd "$clonedir/$sharnessdir" || die "Could not cd into '$clonedir/$sharnessdir' directory" cd "$clonedir/$sharnessdir" || die "Could not cd into '$clonedir/$sharnessdir' directory"
git fetch || die "Could not fetch to update sharness" git fetch || die "Could not fetch to update sharness"
checkout_version checkout_version
else else
# We need to clone sharness! # We need to clone sharness!
mkdir -p "$clonedir" || die "Could not create '$clonedir' directory" mkdir -p "$clonedir" || die "Could not create '$clonedir' directory"
cd "$clonedir" || die "Could not cd into '$clonedir' directory" cd "$clonedir" || die "Could not cd into '$clonedir' directory"
git clone "$urlprefix" || die "Could not clone '$urlprefix'" git clone "$urlprefix" || die "Could not clone '$urlprefix'"
cd "$sharnessdir" || die "Could not cd into '$sharnessdir' directory" cd "$sharnessdir" || die "Could not cd into '$sharnessdir' directory"
checkout_version checkout_version
fi fi
exit 0 exit 0

View File

@ -226,11 +226,11 @@ test_launch_ipfs_daemon() {
} }
do_umount() { do_umount() {
if [ "$(uname -s)" = "Linux" ]; then if [ "$(uname -s)" = "Linux" ]; then
fusermount -u "$1" fusermount -u "$1"
else else
umount "$1" umount "$1"
fi fi
} }
test_mount_ipfs() { test_mount_ipfs() {
@ -335,36 +335,36 @@ test_str_contains() {
} }
disk_usage() { disk_usage() {
# normalize du across systems # normalize du across systems
case $(uname -s) in case $(uname -s) in
Linux) Linux)
DU="du -sb" DU="du -sb"
M=1 M=1
;; ;;
FreeBSD) FreeBSD)
DU="du -s -A -B 1" DU="du -s -A -B 1"
M=512 M=512
;; ;;
Darwin | DragonFly | *) Darwin | DragonFly | *)
DU="du -s" DU="du -s"
M=512 M=512
;; ;;
esac esac
expr $($DU "$1" | awk "{print \$1}") "*" "$M" expr $($DU "$1" | awk "{print \$1}") "*" "$M"
} }
# output a file's permission in human readable format # output a file's permission in human readable format
generic_stat() { generic_stat() {
# normalize stat across systems # normalize stat across systems
case $(uname -s) in case $(uname -s) in
Linux) Linux)
_STAT="stat -c %A" _STAT="stat -c %A"
;; ;;
FreeBSD | Darwin | DragonFly) FreeBSD | Darwin | DragonFly)
_STAT="stat -f %Sp" _STAT="stat -f %Sp"
;; ;;
esac esac
$_STAT "$1" || echo "failed" # Avoid returning nothing. $_STAT "$1" || echo "failed" # Avoid returning nothing.
} }
test_check_peerid() { test_check_peerid() {

View File

@ -41,12 +41,12 @@ test_config_cmd_set() {
# (i.e. just setting 'ipfs config --json foo "[1, 2, 3]"') may # (i.e. just setting 'ipfs config --json foo "[1, 2, 3]"') may
# set it as astring instead of proper json. We leverage the # set it as astring instead of proper json. We leverage the
# unmarshalling that has to happen. # unmarshalling that has to happen.
CONFIG_SET_JSON_TEST='{ CONFIG_SET_JSON_TEST=$(echo '{
"MDNS": { "MDNS": {
"Enabled": true, "Enabled": true,
"Interval": 10 "Interval": 10
} }
}' }' | sed 's/\t/ /g')
test_config_cmd() { test_config_cmd() {
test_config_cmd_set "beep" "boop" test_config_cmd_set "beep" "boop"

View File

@ -49,8 +49,8 @@ test_add_skip() {
' '
test_expect_success "'ipfs add' includes hidden files given explicitly even without --hidden" ' test_expect_success "'ipfs add' includes hidden files given explicitly even without --hidden" '
mkdir -p mountdir/dotfiles && mkdir -p mountdir/dotfiles &&
echo "set nocompatible" > mountdir/dotfiles/.vimrc echo "set nocompatible" > mountdir/dotfiles/.vimrc
cat >expected <<-\EOF && cat >expected <<-\EOF &&
added QmT4uMRDCN7EMpFeqwvKkboszbqeW1kWVGrBxBuCGqZcQc .vimrc added QmT4uMRDCN7EMpFeqwvKkboszbqeW1kWVGrBxBuCGqZcQc .vimrc
EOF EOF

View File

@ -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" ' 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 # Make sure the files are actually removed

View File

@ -533,7 +533,7 @@ test_files_api() {
verify_dir_contents / verify_dir_contents /
' '
test_expect_success "repo gc" ' test_expect_success "repo gc" '
ipfs repo gc ipfs repo gc
' '
} }

View File

@ -149,8 +149,8 @@ test_filestore_verify() {
grep changed verify_actual | grep -q somedir/file3 grep changed verify_actual | grep -q somedir/file3
' '
# reset the state for the next test # reset the state for the next test
test_init_dataset test_init_dataset
} }
test_filestore_dups() { test_filestore_dups() {