master
sh 42 lines 1.13 KB
Raw
1 #!/usr/bin/env bash
2
3 test_description="Tests for various fixed issues and regressions."
4
5 . lib/test-lib.sh
6
7 # Tests go here
8
9 test_expect_success "ipfs init with occupied input works - #2748" '
10 export IPFS_PATH="ipfs_path"
11 echo "" | go-timeout 10 ipfs init &&
12 rm -rf ipfs_path
13 '
14 test_init_ipfs
15
16 test_expect_success "ipfs cat --help succeeds when input remains open" '
17 yes | go-timeout 1 ipfs cat --help
18 '
19
20 test_expect_success "ipfs pin ls --help succeeds when input remains open" '
21 yes | go-timeout 1 ipfs pin ls --help
22 '
23
24 test_expect_success "ipfs add on 1MB from stdin woks" '
25 random-data -size=1048576 -seed=42 | ipfs add -q > 1MB.hash
26 '
27
28 test_expect_success "'ipfs refs -r -e \$(cat 1MB.hash)' succeeds" '
29 ipfs refs -r -e $(cat 1MB.hash) > refs-e.out
30 '
31
32 test_expect_success "output of 'ipfs refs -e' links to separate blocks" '
33 grep "$(cat 1MB.hash) ->" refs-e.out
34 '
35
36 test_expect_success "output of 'ipfs refs -e' contains all first level links" '
37 grep "$(cat 1MB.hash) ->" refs-e.out | sed -e '\''s/.* -> //'\'' | sort > refs-s.out &&
38 ipfs refs "$(cat 1MB.hash)" | sort > refs-one.out &&
39 test_cmp refs-s.out refs-one.out
40 '
41
42 test_done