Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
G
go-ipfs
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
jihao
go-ipfs
Commits
3f4d38fe
提交
3f4d38fe
authored
1月 30, 2015
作者:
Juan Batiz-Benet
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
sharness: correctness. must have &&
cc @whyrusleeping
上级
73234479
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
53 行增加
和
53 行删除
+53
-53
t0080-repo.sh
test/sharness/t0080-repo.sh
+53
-53
没有找到文件。
test/sharness/t0080-repo.sh
浏览文件 @
3f4d38fe
...
...
@@ -12,8 +12,8 @@ test_init_ipfs
test_launch_ipfs_daemon
test_expect_success
"'ipfs add afile' succeeds"
'
echo "some text" >afile
HASH=`ipfs add -q afile`
echo "some text" >afile
&&
HASH=`ipfs add -q afile`
&&
printf "$HASH" >hashfile
'
...
...
@@ -26,27 +26,27 @@ test_expect_success "'ipfs repo gc' succeeds" '
'
test_expect_success
"'ipfs repo gc' looks good (empty)"
'
printf "" >empty
printf "" >empty
&&
test_cmp empty gc_out_actual
'
test_expect_success
"'ipfs repo gc' doesnt remove file"
'
ipfs cat "$HASH" >out
ipfs cat "$HASH" >out
&&
test_cmp out afile
'
test_expect_success
"'ipfs pin rm' succeeds"
'
echo "unpinned $HASH" >expected1
ipfs pin rm -r "$HASH" >actual1
echo "unpinned $HASH" >expected1
&&
ipfs pin rm -r "$HASH" >actual1
&&
test_cmp expected1 actual1
'
test_expect_success
"file no longer pinned"
'
# we expect the welcome files to show up here
echo QmPXME1oRtoT627YKaDPDQ3PwA8tdP9rWuAAweLzqSwAWT >expected2
ipfs refs -r QmPXME1oRtoT627YKaDPDQ3PwA8tdP9rWuAAweLzqSwAWT >>expected2
cat expected2 | sort >expected_sorted2
ipfs pin ls -type=recursive | sort >actual2
echo QmPXME1oRtoT627YKaDPDQ3PwA8tdP9rWuAAweLzqSwAWT >expected2
&&
ipfs refs -r QmPXME1oRtoT627YKaDPDQ3PwA8tdP9rWuAAweLzqSwAWT >>expected2
&&
cat expected2 | sort >expected_sorted2
&&
ipfs pin ls -type=recursive | sort >actual2
&&
test_cmp expected_sorted2 actual2
'
...
...
@@ -55,93 +55,93 @@ test_expect_success "recursively pin afile" '
'
test_expect_success
"pinning directly should fail now"
'
echo "Error: pin: $HASH already pinned recursively" >expected3
ipfs pin add "$HASH" 2>actual3
echo "Error: pin: $HASH already pinned recursively" >expected3
&&
!(ipfs pin add "$HASH" 2>actual3) &&
test_cmp expected3 actual3
'
test_expect_success
"'ipfs pin rm <hash>' should fail"
'
echo "Error: $HASH is pinned recursively" >expected4
ipfs pin rm "$HASH" 2>actual4
echo "Error: $HASH is pinned recursively" >expected4
&&
!(ipfs pin rm "$HASH" 2>actual4) &&
test_cmp expected4 actual4
'
test_expect_success
"remove recursive pin, add direct"
'
echo "unpinned $HASH" >expected5
ipfs pin rm -r "$HASH" >actual5
test_cmp expected5 actual5
echo "unpinned $HASH" >expected5
&&
ipfs pin rm -r "$HASH" >actual5
&&
test_cmp expected5 actual5
&&
ipfs pin add "$HASH"
'
test_expect_success
"remove direct pin"
'
echo "unpinned $HASH" >expected6
ipfs pin rm "$HASH" >actual6
echo "unpinned $HASH" >expected6
&&
ipfs pin rm "$HASH" >actual6
&&
test_cmp expected6 actual6
'
test_expect_success
"'ipfs repo gc' removes file"
'
echo "removed $HASH" >expected7
ipfs repo gc >actual7
echo "removed $HASH" >expected7
&&
ipfs repo gc >actual7
&&
test_cmp expected7 actual7
'
test_expect_success
"'ipfs refs local' no longer shows file"
'
echo QmUNLLsPACCz1vLxQVkXqqLX5R1X345qqfHbsf67hvA3Nn >expected8
echo QmPXME1oRtoT627YKaDPDQ3PwA8tdP9rWuAAweLzqSwAWT >>expected8
ipfs refs -r QmPXME1oRtoT627YKaDPDQ3PwA8tdP9rWuAAweLzqSwAWT >>expected8
cat expected8 | sort >expected_sorted8
ipfs refs local | sort >actual8
echo QmUNLLsPACCz1vLxQVkXqqLX5R1X345qqfHbsf67hvA3Nn >expected8
&&
echo QmPXME1oRtoT627YKaDPDQ3PwA8tdP9rWuAAweLzqSwAWT >>expected8
&&
ipfs refs -r QmPXME1oRtoT627YKaDPDQ3PwA8tdP9rWuAAweLzqSwAWT >>expected8
&&
cat expected8 | sort >expected_sorted8
&&
ipfs refs local | sort >actual8
&&
test_cmp expected_sorted8 actual8
'
test_expect_success
"adding multiblock random file succeeds"
'
random 1000000 >multiblock
random 1000000 >multiblock
&&
MBLOCKHASH=`ipfs add -q multiblock`
'
test_expect_success
"'ipfs pin ls -type=indirect' is correct"
'
ipfs refs "$MBLOCKHASH" >refsout
ipfs refs -r "QmPXME1oRtoT627YKaDPDQ3PwA8tdP9rWuAAweLzqSwAWT" >>refsout
cat refsout | sort >refsout_sorted
ipfs pin ls -type=indirect | sort >indirectpins
ipfs refs "$MBLOCKHASH" >refsout
&&
ipfs refs -r "QmPXME1oRtoT627YKaDPDQ3PwA8tdP9rWuAAweLzqSwAWT" >>refsout
&&
cat refsout | sort >refsout_sorted
&&
ipfs pin ls -type=indirect | sort >indirectpins
&&
test_cmp refsout_sorted indirectpins
'
test_expect_success
"pin something directly"
'
echo "ipfs is so awesome" >awesome
DIRECTPIN=`ipfs add -q awesome`
echo "unpinned $DIRECTPIN" >expected9
ipfs pin rm -r "$DIRECTPIN" >actual9
test_cmp expected9 actual9
echo "pinned $DIRECTPIN directly" >expected10
ipfs pin add "$DIRECTPIN" >actual10
echo "ipfs is so awesome" >awesome
&&
DIRECTPIN=`ipfs add -q awesome`
&&
echo "unpinned $DIRECTPIN" >expected9
&&
ipfs pin rm -r "$DIRECTPIN" >actual9
&&
test_cmp expected9 actual9
&&
echo "pinned $DIRECTPIN directly" >expected10
&&
ipfs pin add "$DIRECTPIN" >actual10
&&
test_cmp expected10 actual10
'
test_expect_success
"'ipfs pin ls -type=direct' is correct"
'
echo "$DIRECTPIN" >directpinexpected
echo QmUNLLsPACCz1vLxQVkXqqLX5R1X345qqfHbsf67hvA3Nn >>directpinexpected
cat directpinexpected | sort >dp_exp_sorted
ipfs pin ls -type=direct | sort >directpinout
echo "$DIRECTPIN" >directpinexpected
&&
echo QmUNLLsPACCz1vLxQVkXqqLX5R1X345qqfHbsf67hvA3Nn >>directpinexpected
&&
cat directpinexpected | sort >dp_exp_sorted
&&
ipfs pin ls -type=direct | sort >directpinout
&&
test_cmp dp_exp_sorted directpinout
'
test_expect_success
"'ipfs pin ls -type=recursive' is correct"
'
echo "$MBLOCKHASH" >rp_expected
echo QmPXME1oRtoT627YKaDPDQ3PwA8tdP9rWuAAweLzqSwAWT >>rp_expected
ipfs refs -r "QmPXME1oRtoT627YKaDPDQ3PwA8tdP9rWuAAweLzqSwAWT" >>rp_expected
cat rp_expected | sort >rp_exp_sorted
ipfs pin ls -type=recursive | sort >rp_actual
echo "$MBLOCKHASH" >rp_expected
&&
echo QmPXME1oRtoT627YKaDPDQ3PwA8tdP9rWuAAweLzqSwAWT >>rp_expected
&&
ipfs refs -r "QmPXME1oRtoT627YKaDPDQ3PwA8tdP9rWuAAweLzqSwAWT" >>rp_expected
&&
cat rp_expected | sort >rp_exp_sorted
&&
ipfs pin ls -type=recursive | sort >rp_actual
&&
test_cmp rp_exp_sorted rp_actual
'
test_expect_success
"'ipfs pin ls -type=all' is correct"
'
cat directpinout >allpins
cat rp_actual >>allpins
cat indirectpins >>allpins
cat allpins | sort >allpins_sorted
ipfs pin ls -type=all | sort >actual_allpins
cat directpinout >allpins
&&
cat rp_actual >>allpins
&&
cat indirectpins >>allpins
&&
cat allpins | sort >allpins_sorted
&&
ipfs pin ls -type=all | sort >actual_allpins
&&
test_cmp allpins_sorted actual_allpins
'
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论