mirror of
https://github.com/ipfs/kubo.git
synced 2025-06-30 01:52:26 +08:00
Merge pull request #1285 from ipfs/t0040-stdin-add-tests
t0040: test ipfs add with stdin
This commit is contained in:
@ -83,6 +83,44 @@ test_expect_success "'ipfs add -q' output looks good" '
|
|||||||
test_cmp expected actual
|
test_cmp expected actual
|
||||||
'
|
'
|
||||||
|
|
||||||
|
test_expect_success "'ipfs add -q' with stdin input succeeds" '
|
||||||
|
echo "Hello Jupiter!" | ipfs add -q >actual
|
||||||
|
'
|
||||||
|
|
||||||
|
test_expect_success "'ipfs add -q' output looks good" '
|
||||||
|
HASH="QmUnvPcBctVTAcJpigv6KMqDvmDewksPWrNVoy1E1WP5fh" &&
|
||||||
|
echo "$HASH" >expected &&
|
||||||
|
test_cmp expected actual
|
||||||
|
'
|
||||||
|
|
||||||
|
test_expect_success "'ipfs cat' succeeds" '
|
||||||
|
ipfs cat "$HASH" >actual
|
||||||
|
'
|
||||||
|
|
||||||
|
test_expect_success "ipfs cat output looks good" '
|
||||||
|
echo "Hello Jupiter!" >expected &&
|
||||||
|
test_cmp expected actual
|
||||||
|
'
|
||||||
|
|
||||||
|
test_expect_success "'ipfs add' with stdin input succeeds" '
|
||||||
|
printf "Hello Neptune!\nHello Pluton!" | ipfs add >actual
|
||||||
|
'
|
||||||
|
|
||||||
|
test_expect_success "'ipfs add' output looks good" '
|
||||||
|
HASH="QmZDhWpi8NvKrekaYYhxKCdNVGWsFFe1CREnAjP1QbPaB3" &&
|
||||||
|
echo "added $HASH " >expected &&
|
||||||
|
test_cmp expected actual
|
||||||
|
'
|
||||||
|
|
||||||
|
test_expect_success "'ipfs cat' with stdin input succeeds" '
|
||||||
|
echo "$HASH" | ipfs cat >actual
|
||||||
|
'
|
||||||
|
|
||||||
|
test_expect_success "ipfs cat with stdin input output looks good" '
|
||||||
|
printf "Hello Neptune!\nHello Pluton!" >expected &&
|
||||||
|
test_cmp expected actual
|
||||||
|
'
|
||||||
|
|
||||||
test_expect_success "'ipfs add -r' succeeds" '
|
test_expect_success "'ipfs add -r' succeeds" '
|
||||||
mkdir mountdir/planets &&
|
mkdir mountdir/planets &&
|
||||||
echo "Hello Mars!" >mountdir/planets/mars.txt &&
|
echo "Hello Mars!" >mountdir/planets/mars.txt &&
|
||||||
|
Reference in New Issue
Block a user