@cryptotaxi247 / kubo / commits / fdccfea02

sharness: fix indent in few more places

License: MIT Signed-off-by: Łukasz Magiera <magik6k@gmail.com>

Łukasz Magiera committed Sep 6, 2017 at 21:14 UTC fdccfea02946bcfee6fecef5f7580ebfcd21738b
7 files changed +51 -51
test/sharness/lib/install-sharness.sh
+18 -18
@@ -15,35 +15,35 @@ sharnessdir=sharness
15
16 if test -f "$clonedir/$sharnessdir/SHARNESS_VERSION_$version"
17 then
18 - # There is the right version file. Great, we are done!
19 - exit 0
18 + # There is the right version file. Great, we are done!
19 + exit 0
20 fi
21
22 die() {
23 - echo >&2 "$@"
24 - exit 1
23 + echo >&2 "$@"
24 + exit 1
25 }
26
27 checkout_version() {
28 - git checkout "$version" || die "Could not checkout '$version'"
29 - rm -f SHARNESS_VERSION_* || die "Could not remove 'SHARNESS_VERSION_*'"
30 - touch "SHARNESS_VERSION_$version" || die "Could not create 'SHARNESS_VERSION_$version'"
31 - echo "Sharness version $version is checked out!"
28 + git checkout "$version" || die "Could not checkout '$version'"
29 + rm -f SHARNESS_VERSION_* || die "Could not remove 'SHARNESS_VERSION_*'"
30 + touch "SHARNESS_VERSION_$version" || die "Could not create 'SHARNESS_VERSION_$version'"
31 + echo "Sharness version $version is checked out!"
32 }
33
34 if test -d "$clonedir/$sharnessdir/.git"
35 then
36 - # We need to update sharness!
37 - cd "$clonedir/$sharnessdir" || die "Could not cd into '$clonedir/$sharnessdir' directory"
38 - git fetch || die "Could not fetch to update sharness"
39 - checkout_version
36 + # We need to update sharness!
37 + cd "$clonedir/$sharnessdir" || die "Could not cd into '$clonedir/$sharnessdir' directory"
38 + git fetch || die "Could not fetch to update sharness"
39 + checkout_version
40 else
41 - # We need to clone sharness!
42 - mkdir -p "$clonedir" || die "Could not create '$clonedir' directory"
43 - cd "$clonedir" || die "Could not cd into '$clonedir' directory"
41 + # We need to clone sharness!
42 + mkdir -p "$clonedir" || die "Could not create '$clonedir' directory"
43 + cd "$clonedir" || die "Could not cd into '$clonedir' directory"
44
45 - git clone "$urlprefix" || die "Could not clone '$urlprefix'"
46 - cd "$sharnessdir" || die "Could not cd into '$sharnessdir' directory"
47 - checkout_version
45 + git clone "$urlprefix" || die "Could not clone '$urlprefix'"
46 + cd "$sharnessdir" || die "Could not cd into '$sharnessdir' directory"
47 + checkout_version
48 fi
49 exit 0
test/sharness/lib/test-lib.sh
+25 -25
@@ -226,11 +226,11 @@ test_launch_ipfs_daemon() {
226 }
227
228 do_umount() {
229 - if [ "$(uname -s)" = "Linux" ]; then
229 + if [ "$(uname -s)" = "Linux" ]; then
230 fusermount -u "$1"
231 - else
231 + else
232 umount "$1"
233 - fi
233 + fi
234 }
235
236 test_mount_ipfs() {
@@ -335,36 +335,36 @@ test_str_contains() {
335 }
336
337 disk_usage() {
338 - # normalize du across systems
339 - case $(uname -s) in
340 - Linux)
341 - DU="du -sb"
338 + # normalize du across systems
339 + case $(uname -s) in
340 + Linux)
341 + DU="du -sb"
342 M=1
343 - ;;
344 - FreeBSD)
345 - DU="du -s -A -B 1"
343 + ;;
344 + FreeBSD)
345 + DU="du -s -A -B 1"
346 M=512
347 - ;;
348 - Darwin | DragonFly | *)
349 - DU="du -s"
347 + ;;
348 + Darwin | DragonFly | *)
349 + DU="du -s"
350 M=512
351 - ;;
352 - esac
351 + ;;
352 + esac
353 expr $($DU "$1" | awk "{print \$1}") "*" "$M"
354 }
355
356 # output a file's permission in human readable format
357 generic_stat() {
358 - # normalize stat across systems
359 - case $(uname -s) in
360 - Linux)
361 - _STAT="stat -c %A"
362 - ;;
363 - FreeBSD | Darwin | DragonFly)
364 - _STAT="stat -f %Sp"
365 - ;;
366 - esac
367 - $_STAT "$1" || echo "failed" # Avoid returning nothing.
358 + # normalize stat across systems
359 + case $(uname -s) in
360 + Linux)
361 + _STAT="stat -c %A"
362 + ;;
363 + FreeBSD | Darwin | DragonFly)
364 + _STAT="stat -f %Sp"
365 + ;;
366 + esac
367 + $_STAT "$1" || echo "failed" # Avoid returning nothing.
368 }
369
370 test_check_peerid() {
test/sharness/t0021-config.sh
+2 -2
@@ -41,12 +41,12 @@ test_config_cmd_set() {
41 # (i.e. just setting 'ipfs config --json foo "[1, 2, 3]"') may
42 # set it as astring instead of proper json. We leverage the
43 # unmarshalling that has to happen.
44 -CONFIG_SET_JSON_TEST='{
44 +CONFIG_SET_JSON_TEST=$(echo '{
45 "MDNS": {
46 "Enabled": true,
47 "Interval": 10
48 }
49 -}'
49 +}' | sed 's/\t/ /g')
50
51 test_config_cmd() {
52 test_config_cmd_set "beep" "boop"
test/sharness/t0042-add-skip.sh
+2 -2
@@ -49,8 +49,8 @@ test_add_skip() {
49 '
50
51 test_expect_success "'ipfs add' includes hidden files given explicitly even without --hidden" '
52 - mkdir -p mountdir/dotfiles &&
53 - echo "set nocompatible" > mountdir/dotfiles/.vimrc
52 + mkdir -p mountdir/dotfiles &&
53 + echo "set nocompatible" > mountdir/dotfiles/.vimrc
54 cat >expected <<-\EOF &&
55 added QmT4uMRDCN7EMpFeqwvKkboszbqeW1kWVGrBxBuCGqZcQc .vimrc
56 EOF
test/sharness/t0083-repo-fsck.sh
+1 -1
@@ -70,7 +70,7 @@ test_expect_success "'ipfs repo fsck' succeeds partial lock" '
70 '
71
72 test_expect_success "'ipfs repo fsck' output looks good with no daemon" '
73 - grep "Lockfiles have been removed." fsck_out_actual2
73 + grep "Lockfiles have been removed." fsck_out_actual2
74 '
75
76 # Make sure the files are actually removed
test/sharness/t0250-files-api.sh
+1 -1
@@ -533,7 +533,7 @@ test_files_api() {
533 verify_dir_contents /
534 '
535
536 - test_expect_success "repo gc" '
536 + test_expect_success "repo gc" '
537 ipfs repo gc
538 '
539 }
test/sharness/t0271-filestore-utils.sh
+2 -2
@@ -149,8 +149,8 @@ test_filestore_verify() {
149 grep changed verify_actual | grep -q somedir/file3
150 '
151
152 - # reset the state for the next test
153 - test_init_dataset
152 + # reset the state for the next test
153 + test_init_dataset
154 }
155
156 test_filestore_dups() {