Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
G
go-ipfs
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
jihao
go-ipfs
Commits
569eeb8f
提交
569eeb8f
authored
10月 23, 2018
作者:
Travis Person
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Update IPTB test - WIP
Related to #5521 License: MIT Signed-off-by:
Travis Person
<
travis@protocol.ai
>
上级
1c463819
隐藏空白字符变更
内嵌
并排
正在显示
23 个修改的文件
包含
85 行增加
和
80 行删除
+85
-80
package.json
package.json
+2
-2
Rules.mk
test/bin/Rules.mk
+5
-1
iptb-lib.sh
test/sharness/lib/iptb-lib.sh
+5
-5
t0030-mount.sh
test/sharness/t0030-mount.sh
+1
-1
t0031-mount-publish.sh
test/sharness/t0031-mount-publish.sh
+1
-1
t0041-ping.sh
test/sharness/t0041-ping.sh
+3
-3
t0101-iptb-name.sh
test/sharness/t0101-iptb-name.sh
+3
-3
t0121-bootstrap-iptb.sh
test/sharness/t0121-bootstrap-iptb.sh
+9
-9
t0125-twonode.sh
test/sharness/t0125-twonode.sh
+1
-1
t0130-multinode.sh
test/sharness/t0130-multinode.sh
+3
-3
t0131-multinode-client-routing.sh
test/sharness/t0131-multinode-client-routing.sh
+3
-3
t0140-swarm.sh
test/sharness/t0140-swarm.sh
+5
-5
t0170-dht.sh
test/sharness/t0170-dht.sh
+5
-5
t0175-reprovider.sh
test/sharness/t0175-reprovider.sh
+6
-6
t0180-p2p.sh
test/sharness/t0180-p2p.sh
+3
-3
t0180-pubsub-gossipsub.sh
test/sharness/t0180-pubsub-gossipsub.sh
+3
-3
t0180-pubsub.sh
test/sharness/t0180-pubsub.sh
+3
-3
t0181-private-network.sh
test/sharness/t0181-private-network.sh
+4
-4
t0182-circuit-relay.sh
test/sharness/t0182-circuit-relay.sh
+6
-6
t0183-namesys-pubsub.sh
test/sharness/t0183-namesys-pubsub.sh
+2
-2
t0190-quic-ping.sh
test/sharness/t0190-quic-ping.sh
+3
-3
t0240-republisher.sh
test/sharness/t0240-republisher.sh
+2
-2
t0276-cidv0v1.sh
test/sharness/t0276-cidv0v1.sh
+7
-6
没有找到文件。
package.json
浏览文件 @
569eeb8f
...
...
@@ -47,9 +47,9 @@
"version"
:
"0.1.4"
},
{
"hash"
:
"Qm
V1DPm5F46LvQMxCVPhu35zHgZEeMvyVtpxjb5TwfGiua
"
,
"hash"
:
"Qm
U5w6sBozzDcfHXuKn1ZZAYuBw1rE57YYRVxgUcCjEX8C
"
,
"name"
:
"iptb"
,
"version"
:
"
1.3.19
"
"version"
:
"
2.0.0
"
},
{
"hash"
:
"QmPnFwZ2JXKnXgMw8CdBPxn7FWh6LLdjUjxV1fKHuJnkr8"
,
...
...
test/bin/Rules.mk
浏览文件 @
569eeb8f
...
...
@@ -14,6 +14,10 @@ $(d)/go-timeout: test/dependencies/go-timeout
$(go-build)
TGTS_$(d) += $(d)/go-timeout
$(d)/iptb: test/dependencies/iptb
$(go-build)
TGTS_$(d) += $(d)/iptb
$(d)/ma-pipe-unidir: test/dependencies/ma-pipe-unidir
$(go-build)
TGTS_$(d) += $(d)/ma-pipe-unidir
...
...
@@ -22,7 +26,7 @@ $(d)/json-to-junit: test/dependencies/json-to-junit
$(go-build)
TGTS_$(d) += $(d)/json-to-junit
TGTS_GX_$(d) := hang-fds
iptb
TGTS_GX_$(d) := hang-fds
TGTS_GX_$(d) := $(addprefix $(d)/,$(TGTS_GX_$(d)))
$(TGTS_GX_$(d)):
...
...
test/sharness/lib/iptb-lib.sh
浏览文件 @
569eeb8f
...
...
@@ -8,7 +8,7 @@ export IPTB_ROOT="$(pwd)/.iptb"
ipfsi
()
{
dir
=
"
$1
"
shift
IPFS_PATH
=
"
$IPTB_ROOT
/
$dir
"
ipfs
"
$@
"
IPFS_PATH
=
"
$IPTB_ROOT
/
testbeds/default/
$dir
"
ipfs
"
$@
"
}
check_has_connection
()
{
...
...
@@ -21,7 +21,7 @@ iptb() {
if
!
command
iptb
"
$@
"
;
then
case
"
$1
"
in
start|stop|connect
)
test_fsh
command
iptb logs
'*'
test_fsh
command
iptb logs
;;
esac
return
1
...
...
@@ -36,11 +36,11 @@ startup_cluster() {
if
test
-n
"
$other_args
"
;
then
test_expect_success
"start up nodes with additional args"
"
iptb start -
-args
\"
${
other_args
[@]
}
\"
iptb start -
wait --
${
other_args
[@]
}
"
else
test_expect_success
"start up nodes"
'
iptb start
iptb start
-wait
'
fi
...
...
@@ -58,7 +58,7 @@ startup_cluster() {
}
iptb_wait_stop
()
{
while
!
iptb
for
-each
sh
-c
'! { test -e "$IPFS_PATH/repo.lock" && fuser -f "$IPFS_PATH/repo.lock" >/dev/null; }'
;
do
while
!
iptb
run
--
sh
-c
'! { test -e "$IPFS_PATH/repo.lock" && fuser -f "$IPFS_PATH/repo.lock" >/dev/null; }'
;
do
go-sleep 10ms
done
}
test/sharness/t0030-mount.sh
浏览文件 @
569eeb8f
...
...
@@ -18,7 +18,7 @@ fi
# start iptb + wait for peering
NUM_NODES
=
5
test_expect_success
'init iptb'
'
iptb
init -n $NUM_NODES --bootstrap=none --port=0
iptb
testbed create -type localipfs -count $NUM_NODES -init
'
startup_cluster
$NUM_NODES
...
...
test/sharness/t0031-mount-publish.sh
浏览文件 @
569eeb8f
...
...
@@ -17,7 +17,7 @@ test_init_ipfs
# start iptb + wait for peering
NUM_NODES
=
3
test_expect_success
'init iptb'
'
iptb
init -n $NUM_NODES -f --bootstrap=none --port=0
&&
iptb
testbed create -type localipfs -count $NUM_NODES -force -init
&&
startup_cluster $NUM_NODES
'
...
...
test/sharness/t0041-ping.sh
浏览文件 @
569eeb8f
...
...
@@ -10,14 +10,14 @@ BAD_PEER="QmNnooDu7bfjPFoTZYxMNLWUQJyrVwtbZg5gBMjTezGAJx"
# start iptb + wait for peering
test_expect_success
'init iptb'
'
iptb
init -n 2 --bootstrap=none --port=0
iptb
testbed create -type localipfs -count 2 -init
'
startup_cluster 2
test_expect_success
'peer ids'
'
PEERID_0=$(iptb
get id 0
) &&
PEERID_1=$(iptb
get id 1
)
PEERID_0=$(iptb
attr get 0 id
) &&
PEERID_1=$(iptb
attr get 1 id
)
'
test_expect_success
"test ping other"
'
...
...
test/sharness/t0101-iptb-name.sh
浏览文件 @
569eeb8f
...
...
@@ -11,7 +11,7 @@ test_description="Test ipfs repo operations"
num_nodes
=
4
test_expect_success
"set up an iptb cluster"
'
iptb
init -n $num_nodes -p 0 -f --bootstrap=none
iptb
testbed create -type localipfs -count $num_nodes -force -init
'
startup_cluster
$num_nodes
...
...
@@ -26,12 +26,12 @@ test_expect_success "publish that object as an ipns entry" '
'
test_expect_success
"add an entry on another node pointing to that one"
'
NODE1_ID=$(iptb
get id 1
) &&
NODE1_ID=$(iptb
attr get 1 id
) &&
ipfsi 2 name publish /ipns/$NODE1_ID
'
test_expect_success
"cat that entry on a third node"
'
NODE2_ID=$(iptb
get id 2
) &&
NODE2_ID=$(iptb
attr get 2 id
) &&
ipfsi 3 cat /ipns/$NODE2_ID > output
'
...
...
test/sharness/t0121-bootstrap-iptb.sh
浏览文件 @
569eeb8f
...
...
@@ -18,11 +18,11 @@ test_expect_success "disable mdns" '
test_launch_ipfs_daemon
test_expect_success
"setup iptb nodes"
'
iptb
init -n 5 -f --bootstrap=none --port=0
iptb
testbed create -type localipfs -count 5 -force -init
'
test_expect_success
"start up iptb nodes"
'
iptb start
iptb start
-wait
'
test_expect_success
"check peers works"
'
...
...
@@ -38,11 +38,11 @@ betterwait() {
}
test_expect_success
"bring down iptb nodes"
'
PID0=$(cat "$IPTB_ROOT/0/daemon.pid") &&
PID1=$(cat "$IPTB_ROOT/1/daemon.pid") &&
PID2=$(cat "$IPTB_ROOT/2/daemon.pid") &&
PID3=$(cat "$IPTB_ROOT/3/daemon.pid") &&
PID4=$(cat "$IPTB_ROOT/4/daemon.pid") &&
PID0=$(cat "$IPTB_ROOT/
benches/default/
0/daemon.pid") &&
PID1=$(cat "$IPTB_ROOT/
benches/default/
1/daemon.pid") &&
PID2=$(cat "$IPTB_ROOT/
benches/default/
2/daemon.pid") &&
PID3=$(cat "$IPTB_ROOT/
benches/default/
3/daemon.pid") &&
PID4=$(cat "$IPTB_ROOT/
benches/default/
4/daemon.pid") &&
iptb stop && # TODO: add --wait flag to iptb stop
betterwait $PID0
betterwait $PID1
...
...
@@ -53,7 +53,7 @@ test_expect_success "bring down iptb nodes" '
test_expect_success
"reset iptb nodes"
'
# the api doesnt seem to get cleaned up in sharness tests for some reason
iptb
init -n 5 -f --bootstrap=none --port=0
iptb
testbed create -type localipfs -count 5 -force -init
'
test_expect_success
"set bootstrap addrs"
'
...
...
@@ -67,7 +67,7 @@ test_expect_success "set bootstrap addrs" '
'
test_expect_success
"start up iptb nodes"
'
iptb start -
-
wait
iptb start -wait
'
test_expect_success
"check peers works"
'
...
...
test/sharness/t0125-twonode.sh
浏览文件 @
569eeb8f
...
...
@@ -86,7 +86,7 @@ run_advanced_test() {
}
test_expect_success
"set up tcp testbed"
'
iptb
init -n 2 -p 0 -f --bootstrap=none
iptb
testbed create -type localipfs -count 2 -force -init
'
# Enable quic but don't use it yet.
...
...
test/sharness/t0130-multinode.sh
浏览文件 @
569eeb8f
...
...
@@ -80,12 +80,12 @@ run_advanced_test() {
test_expect_success
"shut down nodes"
'
iptb stop && iptb_wait_stop ||
test_fsh tail -n +1 .iptb/*/daemon.std*
test_fsh tail -n +1 .iptb/
benches/default/
*/daemon.std*
'
}
test_expect_success
"set up /tcp testbed"
'
iptb
init -n 5 -p 0 -f --bootstrap=none
iptb
testbed create -type localipfs -count 5 -force -init
'
# test multiplex muxer
...
...
@@ -97,7 +97,7 @@ unset LIBP2P_MUX_PREFS
run_advanced_test
test_expect_success
"set up /ws testbed"
'
iptb
init -n 5 -ws -p 0 -f --bootstrap=none
iptb
testbed create -type localipfs -count 5 -attr listentype,ws -force -init
'
# test multiplex muxer
...
...
test/sharness/t0131-multinode-client-routing.sh
浏览文件 @
569eeb8f
...
...
@@ -43,12 +43,12 @@ run_single_file_test() {
NNODES
=
10
test_expect_success
"set up testbed"
'
iptb
init -n $NNODES -p 0 -f --bootstrap=none
iptb
testbed create -type localipfs -count $NNODES -force -init
'
test_expect_success
"start up nodes"
'
iptb start [0-7] &&
iptb start
[8-9] --args="--routing=dhtclient"
iptb start
-wait
[0-7] &&
iptb start
-wait [8-9] -- --routing=dhtclient
'
test_expect_success
"connect up nodes"
'
...
...
test/sharness/t0140-swarm.sh
浏览文件 @
569eeb8f
...
...
@@ -98,28 +98,28 @@ test_expect_success "Addresses.NoAnnounce with /ipcidr affects addresses" '
test_kill_ipfs_daemon
test_expect_success
"set up tcp testbed"
'
iptb
init -n 2 -p 0 -f --bootstrap=none
iptb
testbed create -type localipfs -count 2 -force -init
'
startup_cluster 2
test_expect_success
"disconnect work without specifying a transport address"
'
[ $(ipfsi 0 swarm peers | wc -l) -eq 1 ] &&
ipfsi 0 swarm disconnect "/ipfs/$(iptb
get id 1
)" &&
ipfsi 0 swarm disconnect "/ipfs/$(iptb
attr get 1 id
)" &&
[ $(ipfsi 0 swarm peers | wc -l) -eq 0 ]
'
test_expect_success
"connect work without specifying a transport address"
'
[ $(ipfsi 0 swarm peers | wc -l) -eq 0 ] &&
ipfsi 0 swarm connect "/ipfs/$(iptb
get id 1
)" &&
ipfsi 0 swarm connect "/ipfs/$(iptb
attr get 1 id
)" &&
[ $(ipfsi 0 swarm peers | wc -l) -eq 1 ]
'
test_expect_success
"/p2p addresses work"
'
[ $(ipfsi 0 swarm peers | wc -l) -eq 1 ] &&
ipfsi 0 swarm disconnect "/p2p/$(iptb
get id 1
)" &&
ipfsi 0 swarm disconnect "/p2p/$(iptb
attr get 1 id
)" &&
[ $(ipfsi 0 swarm peers | wc -l) -eq 0 ] &&
ipfsi 0 swarm connect "/p2p/$(iptb
get id 1
)" &&
ipfsi 0 swarm connect "/p2p/$(iptb
attr get 1 id
)" &&
[ $(ipfsi 0 swarm peers | wc -l) -eq 1 ]
'
...
...
test/sharness/t0170-dht.sh
浏览文件 @
569eeb8f
...
...
@@ -12,14 +12,14 @@ test_dht() {
test_expect_success
'init iptb'
'
rm -rf .iptb/ &&
iptb
init -n $NUM_NODES --bootstrap=none --port=0
iptb
testbed create -type localipfs -count $NUM_NODES -init
'
startup_cluster
$NUM_NODES
"
$@
"
startup_cluster
$NUM_NODES
$@
test_expect_success
'peer ids'
'
PEERID_0=$(iptb
get id 0
) &&
PEERID_2=$(iptb
get id 2
)
PEERID_0=$(iptb
attr get 0 id
) &&
PEERID_2=$(iptb
attr get 2 id
)
'
# ipfs dht findpeer <peerID>
...
...
@@ -70,7 +70,7 @@ test_dht() {
# ipfs dht findprovs <key>
test_expect_success
'findprovs'
'
ipfsi 4 dht findprovs $HASH > provs &&
iptb
get id 3
> expected &&
iptb
attr get 3 id
> expected &&
test_cmp provs expected
'
...
...
test/sharness/t0175-reprovider.sh
浏览文件 @
569eeb8f
...
...
@@ -8,12 +8,12 @@ NUM_NODES=6
init_strategy
()
{
test_expect_success
'init iptb'
'
iptb
init -f -n $NUM_NODES --bootstrap=none --port=0
iptb
testbed create -type localipfs -force -count $NUM_NODES -init
'
test_expect_success
'peer ids'
'
PEERID_0=$(iptb
get id 0
) &&
PEERID_1=$(iptb
get id 1
)
PEERID_0=$(iptb
attr get 0 id
) &&
PEERID_1=$(iptb
attr get 1 id
)
'
test_expect_success
'use pinning startegy for reprovider'
'
...
...
@@ -123,12 +123,12 @@ test_expect_success 'stop peer 1' '
# Test reprovider working with ticking disabled
test_expect_success
'init iptb'
'
iptb
init -f -n $NUM_NODES --bootstrap=none --port=0
iptb
testbed create -type localipfs -force -count $NUM_NODES -init
'
test_expect_success
'peer ids'
'
PEERID_0=$(iptb
get id 0
) &&
PEERID_1=$(iptb
get id 1
)
PEERID_0=$(iptb
attr get 0 id
) &&
PEERID_1=$(iptb
attr get 1 id
)
'
test_expect_success
'Disable reprovider ticking'
'
...
...
test/sharness/t0180-p2p.sh
浏览文件 @
569eeb8f
...
...
@@ -6,7 +6,7 @@ test_description="Test experimental p2p commands"
# start iptb + wait for peering
test_expect_success
'init iptb'
'
iptb
init -n 3 --bootstrap=none --port=0
iptb
testbed create -type localipfs --count 3 --init
'
test_expect_success
'generate test data'
'
...
...
@@ -17,8 +17,8 @@ test_expect_success 'generate test data' '
startup_cluster 3
test_expect_success
'peer ids'
'
PEERID_0=$(iptb
get id 0
) &&
PEERID_1=$(iptb
get id 1
)
PEERID_0=$(iptb
attr get 0 id
) &&
PEERID_1=$(iptb
attr get 1 id
)
'
check_test_ports
()
{
test_expect_success
"test ports are closed"
'
...
...
test/sharness/t0180-pubsub-gossipsub.sh
浏览文件 @
569eeb8f
...
...
@@ -7,7 +7,7 @@ test_description="Test pubsub with gossipsub"
# start iptb + wait for peering
NUM_NODES
=
5
test_expect_success
'init iptb'
'
iptb
init -n $NUM_NODES --bootstrap=none --port=0
iptb
testbed create -type localipfs -count $NUM_NODES -init
'
test_expect_success
"enable gossipsub"
'
...
...
@@ -20,8 +20,8 @@ test_expect_success "enable gossipsub" '
startup_cluster
$NUM_NODES
--enable-pubsub-experiment
test_expect_success
'peer ids'
'
PEERID_0=$(iptb
get id 0
) &&
PEERID_2=$(iptb
get id 2
)
PEERID_0=$(iptb
attr get 0 id
) &&
PEERID_2=$(iptb
attr get 2 id
)
'
test_expect_success
'pubsub'
'
...
...
test/sharness/t0180-pubsub.sh
浏览文件 @
569eeb8f
...
...
@@ -7,13 +7,13 @@ test_description="Test dht command"
# start iptb + wait for peering
NUM_NODES
=
5
test_expect_success
'init iptb'
'
iptb
init -n $NUM_NODES --bootstrap=none --port=0
iptb
testbed create -type localipfs -count $NUM_NODES -init
'
run_pubsub_tests
()
{
test_expect_success
'peer ids'
'
PEERID_0=$(iptb
get id 0
) &&
PEERID_2=$(iptb
get id 2
)
PEERID_0=$(iptb
attr get 0 id
) &&
PEERID_2=$(iptb
attr get 2 id
)
'
# ipfs pubsub sub
...
...
test/sharness/t0181-private-network.sh
浏览文件 @
569eeb8f
...
...
@@ -34,15 +34,15 @@ pnet_key > "${IPFS_PATH}/swarm.key"
LIBP2P_FORCE_PNET
=
1 test_launch_ipfs_daemon
test_expect_success
"set up iptb testbed"
'
iptb
init -n 5 -p 0 -f --bootstrap=none
&&
iptb
for-each
ipfs config --json Addresses.Swarm '
"'"
'["/ip4/127.0.0.1/tcp/0"]'
"'"
'
iptb
testbed create -type localipfs -count 5 -force -init
&&
iptb
run --
ipfs config --json Addresses.Swarm '
"'"
'["/ip4/127.0.0.1/tcp/0"]'
"'"
'
'
set_key
()
{
node
=
"
$1
"
keyfile
=
"
$2
"
cp
"
$keyfile
"
"
${
IPTB_ROOT
}
/
${
node
}
/swarm.key"
cp
"
$keyfile
"
"
${
IPTB_ROOT
}
/
testbeds/default/
${
node
}
/swarm.key"
}
pnet_key
>
key1
...
...
@@ -57,7 +57,7 @@ set_key 4 key2
unset
LIBP2P_FORCE_PNET
test_expect_success
"start nodes"
'
iptb start [0-4]
iptb start
-wait
[0-4]
'
test_expect_success
"try connecting node in public network with priv networks"
'
...
...
test/sharness/t0182-circuit-relay.sh
浏览文件 @
569eeb8f
...
...
@@ -7,12 +7,12 @@ test_description="Test circuit relay"
# start iptb + wait for peering
NUM_NODES
=
3
test_expect_success
'init iptb'
'
iptb
init -n $NUM_NODES --bootstrap=none --port=0
iptb
testbed create -type localipfs -count $NUM_NODES -init
'
# Network toplogy: A <-> Relay <-> B
test_expect_success
'start up nodes for configuration'
'
iptb start -
-args
--routing=none
iptb start -
wait --
--routing=none
'
test_expect_success
'configure EnableRelayHop in relay node'
'
...
...
@@ -22,7 +22,7 @@ test_expect_success 'configure EnableRelayHop in relay node' '
test_expect_success
'restart nodes'
'
iptb stop &&
iptb_wait_stop &&
iptb start -
-args
--routing=none
iptb start -
wait --
--routing=none
'
test_expect_success
'connect A <-> Relay'
'
...
...
@@ -38,9 +38,9 @@ test_expect_success 'wait until relay is ready to do work' '
'
test_expect_success
'peer ids'
'
PEERID_0=$(iptb
get id 0
) &&
PEERID_1=$(iptb
get id 1
) &&
PEERID_2=$(iptb
get id 2
)
PEERID_0=$(iptb
attr get 0 id
) &&
PEERID_1=$(iptb
attr get 1 id
) &&
PEERID_2=$(iptb
attr get 2 id
)
'
test_expect_success
'connect A <-Relay-> B'
'
...
...
test/sharness/t0183-namesys-pubsub.sh
浏览文件 @
569eeb8f
...
...
@@ -7,13 +7,13 @@ test_description="Test IPNS pubsub"
# start iptb + wait for peering
NUM_NODES
=
5
test_expect_success
'init iptb'
'
iptb
init -n $NUM_NODES --bootstrap=none --port=0
iptb
testbed create -type localipfs -count $NUM_NODES -init
'
startup_cluster
$NUM_NODES
--enable-namesys-pubsub
test_expect_success
'peer ids'
'
PEERID_0=$(iptb
get id 0
)
PEERID_0=$(iptb
attr get 0 id
)
'
test_expect_success
'check namesys pubsub state'
'
...
...
test/sharness/t0190-quic-ping.sh
浏览文件 @
569eeb8f
...
...
@@ -8,7 +8,7 @@ test_init_ipfs
# start iptb + wait for peering
test_expect_success
'init iptb'
'
iptb
init -n 2 --bootstrap=none --port=0
iptb
testbed create -type localipfs -count 2 -init
'
test_expect_success
"enable QUIC experiment"
'
...
...
@@ -26,8 +26,8 @@ test_expect_success "add QUIC swarm addresses" '
startup_cluster 2
test_expect_success
'peer ids'
'
PEERID_0=$(iptb
get id 0
) &&
PEERID_1=$(iptb
get id 1
)
PEERID_0=$(iptb
attr get 0 id
) &&
PEERID_1=$(iptb
attr get 1 id
)
'
test_expect_success
"test ping other"
'
...
...
test/sharness/t0240-republisher.sh
浏览文件 @
569eeb8f
...
...
@@ -15,7 +15,7 @@ setup_iptb() {
bound
=
$(
expr
"
$num_nodes
"
- 1
)
test_expect_success
"iptb init"
'
iptb
init -n $num_nodes --bootstrap none --port 0
iptb
testbed create -type localipfs -count $num_nodes -init
'
for
i
in
$(
test_seq 0
"
$bound
"
)
...
...
@@ -31,7 +31,7 @@ setup_iptb() {
teardown_iptb
()
{
test_expect_success
"shut down nodes"
'
iptb
kill
iptb
stop
'
}
...
...
test/sharness/t0276-cidv0v1.sh
浏览文件 @
569eeb8f
...
...
@@ -95,30 +95,31 @@ test_expect_success "check that we can access the file when converted to CIDv1"
#
test_expect_success
"set up iptb testbed"
'
iptb
init -n 2 -p 0 -f --bootstrap=none
iptb
testbed create -type localipfs -count 2 -init
'
test_expect_success
"start nodes"
'
iptb start &&
iptb start
-wait
&&
iptb connect 0 1
'
test_expect_success
"add afile using CIDv0 to node 0"
'
iptb run 0 ipfs add -q --cid-version=0 afile
iptb run 0
--
ipfs add -q --cid-version=0 afile
'
test_expect_success
"get afile using CIDv1 via node 1"
'
iptb run
1
ipfs --timeout=2s cat $AHASHv1 > thefile &&
iptb run
-raw 1 --
ipfs --timeout=2s cat $AHASHv1 > thefile &&
test_cmp afile thefile
'
test_expect_success
"add bfile using CIDv1 to node 0"
'
BHASHv1=$(iptb run
0
ipfs add -q --cid-version=1 --raw-leaves=false bfile)
BHASHv1=$(iptb run
-raw 0 --
ipfs add -q --cid-version=1 --raw-leaves=false bfile)
'
test_expect_success
"get bfile using CIDv0 via node 1"
'
BHASHv0=$(cid-fmt -v 0 %s $BHASHv1)
iptb run 1 ipfs --timeout=2s cat $BHASHv0 > thefile &&
echo $BHASHv1 &&
iptb run -raw 1 -- ipfs --timeout=2s cat $BHASHv0 > thefile &&
test_cmp bfile thefile
'
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论