@cryptotaxi247 / kubo / commits / 667a9c899

add test for sharness locking

License: MIT Signed-off-by: Steven Allen <steven@stebalien.com>

Steven Allen committed Jul 5, 2018 at 14:26 UTC 667a9c899922f8349de7468241c8cab841096f34
1 file changed +16 -5
test/sharness/t0063-external.sh
+16 -5
@@ -14,17 +14,28 @@ PATH=`pwd`/bin:$PATH
14
15 test_init_ipfs
16
17 -test_launch_ipfs_daemon
18 -
17 test_expect_success "create fake ipfs-update bin" '
18 mkdir bin &&
19 echo "#!/bin/sh" > bin/ipfs-update &&
20 echo "pwd" >> bin/ipfs-update &&
23 - chmod +x bin/ipfs-update
21 + echo "test -e \"$IPFS_PATH/repo.lock\" || echo \"repo not locked\" " >> bin/ipfs-update &&
22 + chmod +x bin/ipfs-update &&
23 + mkdir just_for_test
24 +'
25 +
26 +test_expect_success "external command runs from current user directory and doesn't lock repo" '
27 + (cd just_for_test && ipfs update) > actual
28 +'
29 +
30 +test_expect_success "output looks good" '
31 + echo `pwd`/just_for_test > exp &&
32 + echo "repo not locked" >> exp &&
33 + test_cmp exp actual
34 '
35
26 -test_expect_success "external command runs from current user directory" '
27 - mkdir just_for_test &&
36 +test_launch_ipfs_daemon
37 +
38 +test_expect_success "external command runs from current user directory when daemon is running" '
39 (cd just_for_test && ipfs update) > actual
40 '
41