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
2871decd
Commit
2871decd
authored
Sep 29, 2016
by
Jeromy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
clean up test, run checks on all nodes
License: MIT Signed-off-by:
Jeromy
<
why@ipfs.io
>
parent
56a8c43a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
37 deletions
+12
-37
test/sharness/t0131-multinode-client-routing.sh
test/sharness/t0131-multinode-client-routing.sh
+12
-37
No files found.
test/sharness/t0131-multinode-client-routing.sh
View file @
2871decd
...
...
@@ -22,21 +22,17 @@ check_file_fetch() {
'
}
check_dir_fetch
()
{
node
=
$1
ref
=
$2
test_expect_success
"node can fetch all refs for dir"
'
ipfsi $node refs -r $ref > /dev/null
'
}
run_single_file_test
()
{
test_expect_success
"add a file on node1"
'
random 1000000 > filea &&
FILEA_HASH=$(ipfsi 1 add -q filea)
'
check_file_fetch 9
$FILEA_HASH
filea
check_file_fetch 8
$FILEA_HASH
filea
check_file_fetch 7
$FILEA_HASH
filea
check_file_fetch 6
$FILEA_HASH
filea
check_file_fetch 5
$FILEA_HASH
filea
check_file_fetch 4
$FILEA_HASH
filea
check_file_fetch 3
$FILEA_HASH
filea
check_file_fetch 2
$FILEA_HASH
filea
...
...
@@ -44,35 +40,10 @@ run_single_file_test() {
check_file_fetch 0
$FILEA_HASH
filea
}
run_random_dir_test
()
{
test_expect_success
"create a bunch of random files"
'
random-files -depth=4 -dirs=5 -files=8 foobar > /dev/null
'
test_expect_success
"add those on node 2"
'
DIR_HASH=$(ipfsi 2 add -r -q foobar | tail -n1)
'
check_dir_fetch 0
$DIR_HASH
check_dir_fetch 1
$DIR_HASH
check_dir_fetch 2
$DIR_HASH
check_dir_fetch 3
$DIR_HASH
check_dir_fetch 4
$DIR_HASH
}
run_advanced_test
()
{
run_single_file_test
run_random_dir_test
test_expect_success
"shut down nodes"
'
iptb stop
'
}
NNODES
=
10
test_expect_success
"set up testbed"
'
iptb init -n
10
-p 0 -f --bootstrap=none
iptb init -n
$NNODES
-p 0 -f --bootstrap=none
'
test_expect_success
"start up nodes"
'
...
...
@@ -93,6 +64,10 @@ test_expect_success "retrieve that file on a client mode node" '
check_file_fetch 9 $FILE_HASH filea
'
run_advanced_test
run_single_file_test
test_expect_success
"shut down nodes"
'
iptb stop
'
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