提交 9898ba93 作者: Kejie Zhang

update test and do not overwrite in sharness test

License: MIT
Signed-off-by: 's avatarKejie Zhang <601172892@qq.com>
上级 76e8190a
...@@ -287,9 +287,9 @@ func daemonFunc(req *cmds.Request, re cmds.ResponseEmitter, env cmds.Environment ...@@ -287,9 +287,9 @@ func daemonFunc(req *cmds.Request, re cmds.ResponseEmitter, env cmds.Environment
// Start assembling node config // Start assembling node config
ncfg := &core.BuildCfg{ ncfg := &core.BuildCfg{
Repo: repo, Repo: repo,
Permanent: true, // It is temporary way to signify that node is permanent Permanent: true, // It is temporary way to signify that node is permanent
Online: !offline, Online: !offline,
DisableEncryptedConnections: unencrypted, DisableEncryptedConnections: unencrypted,
ExtraOpts: map[string]bool{ ExtraOpts: map[string]bool{
"pubsub": pubsub, "pubsub": pubsub,
......
...@@ -186,22 +186,22 @@ test_add_cat_file() { ...@@ -186,22 +186,22 @@ test_add_cat_file() {
' '
test_expect_success "ipfs add --name" ' test_expect_success "ipfs add --name" '
HASH="QmdFyxZXsFiP4csgfM5uPu99AvFiKH62CSPDw5TP92nr7w" && NAMEHASH="QmdFyxZXsFiP4csgfM5uPu99AvFiKH62CSPDw5TP92nr7w" &&
echo "IPFS" | ipfs add --name file.txt > actual && echo "IPFS" | ipfs add --name file.txt > actual &&
echo "added $HASH file.txt" > expected && echo "added $NAMEHASH file.txt" > expected &&
test_cmp expected actual test_cmp expected actual
' '
test_expect_success "ipfs add --name -w" ' test_expect_success "ipfs add --name -w" '
HASH1="QmdFyxZXsFiP4csgfM5uPu99AvFiKH62CSPDw5TP92nr7w" && NAMEHASH="QmdFyxZXsFiP4csgfM5uPu99AvFiKH62CSPDw5TP92nr7w" &&
echo "IPFS" | ipfs add -w --name file.txt | head -n1> actual && echo "IPFS" | ipfs add -w --name file.txt | head -n1> actual &&
echo "added $HASH1 file.txt" > expected && echo "added $NAMEHASH file.txt" > expected &&
test_cmp expected actual test_cmp expected actual
' '
test_expect_success "ipfs cat with name" ' test_expect_success "ipfs cat with name" '
HASH=$(echo "IPFS" | ipfs add -w --name file.txt -Q) && NAMEHASH=$(echo "IPFS" | ipfs add -w --name file.txt -Q) &&
ipfs cat /ipfs/$HASH/file.txt > expected && ipfs cat /ipfs/$NAMEHASH/file.txt > expected &&
echo "IPFS" > actual && echo "IPFS" > actual &&
test_cmp expected actual test_cmp expected actual
' '
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论