Commit 667a9c89 authored by Steven Allen's avatar Steven Allen

add test for sharness locking

License: MIT
Signed-off-by: default avatarSteven Allen <steven@stebalien.com>
parent b6081be3
......@@ -14,17 +14,28 @@ PATH=`pwd`/bin:$PATH
test_init_ipfs
test_launch_ipfs_daemon
test_expect_success "create fake ipfs-update bin" '
mkdir bin &&
echo "#!/bin/sh" > bin/ipfs-update &&
echo "pwd" >> bin/ipfs-update &&
chmod +x bin/ipfs-update
echo "test -e \"$IPFS_PATH/repo.lock\" || echo \"repo not locked\" " >> bin/ipfs-update &&
chmod +x bin/ipfs-update &&
mkdir just_for_test
'
test_expect_success "external command runs from current user directory and doesn't lock repo" '
(cd just_for_test && ipfs update) > actual
'
test_expect_success "output looks good" '
echo `pwd`/just_for_test > exp &&
echo "repo not locked" >> exp &&
test_cmp exp actual
'
test_expect_success "external command runs from current user directory" '
mkdir just_for_test &&
test_launch_ipfs_daemon
test_expect_success "external command runs from current user directory when daemon is running" '
(cd just_for_test && ipfs update) > actual
'
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment