1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-07-01 10:49:24 +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"
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

View File

@ -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() {
@ -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() {

View File

@ -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"

View File

@ -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

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" '
grep "Lockfiles have been removed." fsck_out_actual2
grep "Lockfiles have been removed." fsck_out_actual2
'
# Make sure the files are actually removed

View File

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

View File

@ -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() {