Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
G
go-ipfs
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
jihao
go-ipfs
Commits
6adfa35c
提交
6adfa35c
authored
11月 20, 2014
作者:
Juan Batiz-Benet
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #371 from chriscool/test_add_expensive_prereq
Add EXPENSIVE prereq to sharness tests
上级
e1be9613
196651d5
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
56 行增加
和
21 行删除
+56
-21
test-lib.sh
test/lib/test-lib.sh
+3
-2
t0030-mount.sh
test/t0030-mount.sh
+3
-3
t0040-add-and-cat.sh
test/t0040-add-and-cat.sh
+50
-16
没有找到文件。
test/lib/test-lib.sh
浏览文件 @
6adfa35c
...
@@ -29,6 +29,7 @@ SHARNESS_LIB="lib/sharness/sharness.sh"
...
@@ -29,6 +29,7 @@ SHARNESS_LIB="lib/sharness/sharness.sh"
# Please put go-ipfs specific shell functions below
# Please put go-ipfs specific shell functions below
test
"
$TEST_NO_FUSE
"
!=
1
&&
test_set_prereq FUSE
test
"
$TEST_NO_FUSE
"
!=
1
&&
test_set_prereq FUSE
test
"
$TEST_EXPENSIVE
"
=
1
&&
test_set_prereq EXPENSIVE
test_cmp_repeat_10_sec
()
{
test_cmp_repeat_10_sec
()
{
for
i
in
1 2 3 4 5 6 7 8 9 10
for
i
in
1 2 3 4 5 6 7 8 9 10
...
@@ -64,7 +65,7 @@ test_launch_ipfs_daemon() {
...
@@ -64,7 +65,7 @@ test_launch_ipfs_daemon() {
'
'
}
}
test_launch_ipfs_mount
()
{
test_launch_ipfs_
daemon_and_
mount
()
{
test_expect_success
"ipfs init succeeds"
'
test_expect_success
"ipfs init succeeds"
'
export IPFS_DIR="$(pwd)/.go-ipfs" &&
export IPFS_DIR="$(pwd)/.go-ipfs" &&
...
@@ -100,7 +101,7 @@ test_kill_repeat_10_sec() {
...
@@ -100,7 +101,7 @@ test_kill_repeat_10_sec() {
!
kill
-0
$1
2>/dev/null
!
kill
-0
$1
2>/dev/null
}
}
test_kill_ipfs_
mount
()
{
test_kill_ipfs_
daemon
()
{
test_expect_success FUSE
"'ipfs daemon' is still running"
'
test_expect_success FUSE
"'ipfs daemon' is still running"
'
kill -0 $IPFS_PID
kill -0 $IPFS_PID
...
...
test/t0030-mount.sh
浏览文件 @
6adfa35c
...
@@ -15,9 +15,9 @@ if ! test_have_prereq FUSE; then
...
@@ -15,9 +15,9 @@ if ! test_have_prereq FUSE; then
test_done
test_done
fi
fi
test_launch_ipfs_mount
test_launch_ipfs_
daemon_and_
mount
test_kill_ipfs_
mount
test_kill_ipfs_
daemon
test_expect_success
"mount directories can be removed"
'
test_expect_success
"mount directories can be removed"
'
rmdir ipfs ipns
rmdir ipfs ipns
...
@@ -34,6 +34,6 @@ test_expect_failure "'ipfs mount' looks good when it fails (issue #341)" '
...
@@ -34,6 +34,6 @@ test_expect_failure "'ipfs mount' looks good when it fails (issue #341)" '
! grep "IPNS mounted at" actual
! grep "IPNS mounted at" actual
'
'
test_kill_ipfs_
mount
test_kill_ipfs_
daemon
test_done
test_done
test/t0040-add-and-cat.sh
浏览文件 @
6adfa35c
...
@@ -8,7 +8,7 @@ test_description="Test add and cat commands"
...
@@ -8,7 +8,7 @@ test_description="Test add and cat commands"
.
lib/test-lib.sh
.
lib/test-lib.sh
test_launch_ipfs_mount
test_launch_ipfs_
daemon_and_
mount
test_expect_success
"ipfs add succeeds"
'
test_expect_success
"ipfs add succeeds"
'
echo "Hello Worlds!" >mountdir/hello.txt &&
echo "Hello Worlds!" >mountdir/hello.txt &&
...
@@ -42,50 +42,84 @@ test_expect_success "go-random is installed" '
...
@@ -42,50 +42,84 @@ test_expect_success "go-random is installed" '
type random
type random
'
'
test_expect_success
"generate
100
MB file using go-random"
'
test_expect_success
"generate
5
MB file using go-random"
'
random
104857600 42
>mountdir/bigfile
random
5242880 41
>mountdir/bigfile
'
'
test_expect_success
"sha1 of the file looks ok"
'
test_expect_success
"sha1 of the file looks ok"
'
echo "5620fb92eb5a49c9986b5c6844efda37e471660e mountdir/bigfile" >sha1_expected &&
shasum mountdir/bigfile >sha1_actual &&
test_cmp sha1_expected sha1_actual
'
test_expect_success
"'ipfs add bigfile' succeeds"
'
ipfs add mountdir/bigfile >actual
'
test_expect_success
"'ipfs add bigfile' output looks good"
'
HASH="Qmf2EnuvFQtpFnMJb5aoVPnMx9naECPSm8AGyktmEB5rrR" &&
echo "added $HASH mountdir/bigfile" >expected &&
test_cmp expected actual
'
test_expect_success
"'ipfs cat' succeeds"
'
ipfs cat $HASH >actual
'
test_expect_success
"'ipfs cat' output looks good"
'
test_cmp mountdir/bigfile actual
'
test_expect_success FUSE
"cat ipfs/bigfile succeeds"
'
cat ipfs/$HASH >actual
'
test_expect_success FUSE
"cat ipfs/bigfile looks good"
'
test_cmp mountdir/bigfile actual
'
test_expect_success EXPENSIVE
"generate 100MB file using go-random"
'
random 104857600 42 >mountdir/bigfile
'
test_expect_success EXPENSIVE
"sha1 of the file looks ok"
'
echo "885b197b01e0f7ff584458dc236cb9477d2e736d mountdir/bigfile" >sha1_expected &&
echo "885b197b01e0f7ff584458dc236cb9477d2e736d mountdir/bigfile" >sha1_expected &&
shasum mountdir/bigfile >sha1_actual &&
shasum mountdir/bigfile >sha1_actual &&
test_cmp sha1_expected sha1_actual
test_cmp sha1_expected sha1_actual
'
'
test_expect_success
"ipfs add bigfile succeeds"
'
test_expect_success
EXPENSIVE
"ipfs add bigfile succeeds"
'
ipfs add mountdir/bigfile >actual
ipfs add mountdir/bigfile >actual
'
'
test_expect_success
"ipfs add bigfile output looks good"
'
test_expect_success
EXPENSIVE
"ipfs add bigfile output looks good"
'
HASH="QmWXysX1oysyjTqd5xGM2T1maBaVXnk5svQv4GKo5PsGPo" &&
HASH="QmWXysX1oysyjTqd5xGM2T1maBaVXnk5svQv4GKo5PsGPo" &&
echo "added $HASH mountdir/bigfile" >expected &&
echo "added $HASH mountdir/bigfile" >expected &&
test_cmp expected actual
test_cmp expected actual
'
'
test_expect_success
"ipfs cat succeeds"
'
test_expect_success
EXPENSIVE
"ipfs cat succeeds"
'
ipfs cat $HASH | shasum >sha1_actual
ipfs cat $HASH | shasum >sha1_actual
'
'
# this test commented out to run faster.
test_expect_success EXPENSIVE
"ipfs cat output looks good"
'
# uncomment to produce and examine output
ipfs cat $HASH >actual &&
# test_expect_success "ipfs cat output looks good" '
test_cmp mountdir/bigfile actual
# ipfs cat $HASH >actual &&
'
# test_cmp mountdir/bigfile actual
# '
test_expect_success
"ipfs cat output shasum looks good"
'
test_expect_success
EXPENSIVE
"ipfs cat output shasum looks good"
'
echo "885b197b01e0f7ff584458dc236cb9477d2e736d -" >sha1_expected &&
echo "885b197b01e0f7ff584458dc236cb9477d2e736d -" >sha1_expected &&
test_cmp sha1_expected sha1_actual
test_cmp sha1_expected sha1_actual
'
'
test_expect_success FUSE
"cat ipfs/bigfile succeeds"
'
test_expect_success FUSE
,EXPENSIVE
"cat ipfs/bigfile succeeds"
'
cat ipfs/$HASH | shasum >sha1_actual
cat ipfs/$HASH | shasum >sha1_actual
'
'
test_expect_success FUSE
"cat ipfs/bigfile looks good"
'
test_expect_success FUSE
,EXPENSIVE
"cat ipfs/bigfile looks good"
'
test_cmp sha1_expected sha1_actual
test_cmp sha1_expected sha1_actual
'
'
test_kill_ipfs_
mount
test_kill_ipfs_
daemon
test_done
test_done
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论