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
16e29dae
Commit
16e29dae
authored
Sep 06, 2015
by
Matt Bell
Committed by
rht
Oct 13, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sharness: Added tests for 'ipfs resolve'
License: MIT Signed-off-by:
Matt Bell
<
mappum@gmail.com
>
parent
3a2b83d9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
55 additions
and
0 deletions
+55
-0
test/sharness/t0101-resolve.sh
test/sharness/t0101-resolve.sh
+55
-0
No files found.
test/sharness/t0101-resolve.sh
0 → 100755
View file @
16e29dae
#!/bin/sh
#
# Copyright (c) 2015 Matt Bell
# MIT Licensed; see the LICENSE file in this repository.
#
test_description
=
"Test ipfs resolve operations"
.
lib/test-lib.sh
test_init_ipfs
# setup
test_expect_success
"setup: add files"
'
mkdir mountdir/foodir &&
echo "Hello Mars!" >mountdir/foodir/mars.txt &&
echo "/ipfs/`ipfs add -q mountdir/foodir/mars.txt`" >filehash &&
ipfs add -q -r mountdir/foodir | tail -n 1 >dirhash
'
test_expect_success
"setup: get IPFS ID"
'
ID=`ipfs id --format="<id>\n"`
'
# resolve an IPNS name to a simple /ipfs/ path
test_expect_success
"setup: publish file to IPNS name"
'
ipfs name publish `cat filehash`
'
test_expect_success
"'ipfs resolve' succeeds with IPNS->path"
'
echo `ipfs resolve "/ipns/$ID"` >actual
'
test_expect_success
"'ipfs resolve' output looks good"
'
test_cmp filehash actual
'
# resolve an IPNS name to a /ipfs/HASH/link/name path
test_expect_success
"setup: publish link path to IPNS name"
'
ipfs name publish "`cat dirhash`/mars.txt"
'
test_expect_success
"'ipfs resolve' succeeds with IPNS->link path"
'
echo `ipfs resolve "/ipns/$ID"` >actual
'
test_expect_success
"'ipfs resolve' output looks good"
'
test_cmp filehash actual
'
test_done
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