Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
go-dms3
Commits
be96d8d7
Commit
be96d8d7
authored
Aug 27, 2015
by
rht
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix test cases for ipfs api check
License: MIT Signed-off-by:
rht
<
rhtbot@gmail.com
>
parent
e1d8200f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
6 deletions
+27
-6
test/sharness/t0062-daemon-api.sh
test/sharness/t0062-daemon-api.sh
+27
-6
No files found.
test/sharness/t0062-daemon-api.sh
View file @
be96d8d7
...
...
@@ -9,8 +9,23 @@ test_description="Test daemon command"
test_init_ipfs
test_expect_success
"client should work when there is no api file"
'
ipfs --api "$differentapi" id
differentport
=
$((
PORT_API
+
1
))
differentapi
=
"/ip4/127.0.0.1/tcp/
$differentport
"
peerid
=
$(
ipfs config Identity.PeerID
)
test_client
()
{
args
=
"
$@
"
printf
$peerid
>
expected
ipfs
$args
id
-f
=
"<id>"
>
actual
test_cmp expected actual
}
test_expect_success
"client should work when there is no api file and no --api is specified"
'
test_client
'
test_expect_success
"client should err when there is no api file and with --api is specified"
'
test_must_fail test_client --api "$differentapi"
'
test_launch_ipfs_daemon
...
...
@@ -19,8 +34,10 @@ test_expect_success "'ipfs daemon' creates api file" '
test -f ".ipfs/api"
'
differentport
=
$((
PORT_API
+
1
))
differentapi
=
"/ip4/127.0.0.1/tcp/
$differentport
"
test_expect_success
"api file looks good"
'
printf "$ADDR_API" >expected &&
test_cmp expected .ipfs/api
'
test_expect_success
"client should err if client api != api file while daemon is on"
'
echo "Error: api not running" >expected &&
...
...
@@ -42,12 +59,16 @@ ADDR_API=$differentapi
test_launch_ipfs_daemon
--api
"
$ADDR_API
"
test_expect_success
"'ipfs daemon' api option works"
'
printf "$differentapi" >
expected &&
printf "$differentapi" >expected &&
test_cmp expected .ipfs/api
'
test_expect_success
"client should work if client api == api file, != cfg api while daemon is on"
'
ipfs --api "$differentapi" id
test_client --api "$differentapi"
'
test_expect_success
"client should read the api file while daemon is on"
'
test_client
'
test_kill_ipfs_daemon
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment