Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
G
go-ipfs
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
jihao
go-ipfs
Commits
620b52b2
提交
620b52b2
authored
2月 13, 2017
作者:
Kevin Atkinson
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
filestore util: refactor and clean up tests
License: MIT Signed-off-by:
Kevin Atkinson
<
k@kevina.org
>
上级
96269e02
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
39 行增加
和
28 行删除
+39
-28
t0271-filestore-utils.sh
test/sharness/t0271-filestore-utils.sh
+39
-28
没有找到文件。
test/sharness/t0271-filestore-utils.sh
浏览文件 @
620b52b2
...
...
@@ -8,6 +8,17 @@ test_description="Test out the filestore nocopy functionality"
.
lib/test-lib.sh
test_init_filestore
()
{
test_expect_success
"clean up old node"
'
rm -rf "$IPFS_PATH" mountdir ipfs ipns
'
test_init_ipfs
test_expect_success
"enable filestore config setting"
'
ipfs config --json Experimental.FilestoreEnabled true
'
}
test_init_dataset
()
{
test_expect_success
"create a dataset"
'
...
...
@@ -19,6 +30,11 @@ test_init_dataset() {
'
}
test_init
()
{
test_init_filestore
test_init_dataset
}
EXPHASH
=
"QmRueCuPMYYvdxWz1vWncF7wzCScEx4qasZXo5aVBb1R4V"
cat
<<
EOF
> ls_expect
...
...
@@ -68,11 +84,16 @@ test_filestore_adds() {
'
}
test_filestore_verify
()
{
# check that the filestore is in a clean state
test_filestore_state
()
{
test_expect_success
"ipfs filestore verify' output looks good'"
'
ipfs filestore verify | LC_ALL=C sort > verify_actual
test_cmp verify_expect verify_actual
'
}
test_filestore_verify
()
{
test_filestore_state
test_expect_success
"'ipfs filestore verify HASH' works"
'
ipfs filestore verify $FILE1_HASH > verify_actual &&
...
...
@@ -113,35 +134,28 @@ test_filestore_verify() {
ipfs filestore verify > verify_actual &&
grep changed verify_actual | grep -q somedir/file3
'
}
cat
<<
EOF
> dups_expec
t
$FILE1_HASH
EOF
# reset the state for the next tes
t
test_init_dataset
}
test_filestore_dups
()
{
# make sure the filestore is in a clean state
test_filestore_state
test_expect_success
"'ipfs filestore dups'"
'
ipfs add --raw-leaves somedir/file1 &&
ipfs filestore dups > dups_actual &&
echo "$FILE1_HASH" > dups_expect
test_cmp dups_expect dups_actual
'
}
init_ipfs_filestore
()
{
test_expect_success
"clean up old node"
'
rm -rf "$IPFS_PATH" mountdir ipfs ipns
'
test_init_ipfs
test_expect_success
"enable filestore config setting"
'
ipfs config --json Experimental.FilestoreEnabled true
'
}
test_init_dataset
#
# No daemon
#
init_ipfs_filestore
test_init
test_filestore_adds
...
...
@@ -149,17 +163,14 @@ test_filestore_verify
test_filestore_dups
echo
"WORKING DIR"
echo
"IPFS PATH = "
$IPFS_PATH
pwd
test_init_dataset
#
# With daemon
#
init_ipfs_filestore
test_init
# must be in offline mode so tests
of retrieving non-exis
t blocks
# don't hang
# must be in offline mode so tests
that retrieve non-existen
t blocks
# do
es
n't hang
test_launch_ipfs_daemon
--offline
test_filestore_adds
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论