Add sharness mount tests with a 5 MB file
These new tests are not marked EXPENSIVE as they should be fast enough even on Travis CI. License: MIT Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Christian Couder committed
Nov 20, 2014 at 20:46 UTC
196651d5f5841300259320ae3a2bea67602106a5
1 file changed
+36
test/t0040-add-and-cat.sh
+36
@@ -42,6 +42,42 @@ test_expect_success "go-random is installed" '
42
type random
43
'
44
45
+test_expect_success "generate 5MB file using go-random" '
46
+ random 5242880 41 >mountdir/bigfile
47
+'
48
+
49
+test_expect_success "sha1 of the file looks ok" '
50
+ echo "5620fb92eb5a49c9986b5c6844efda37e471660e mountdir/bigfile" >sha1_expected &&
51
+ shasum mountdir/bigfile >sha1_actual &&
52
+ test_cmp sha1_expected sha1_actual
53
+'
54
+
55
+test_expect_success "'ipfs add bigfile' succeeds" '
56
+ ipfs add mountdir/bigfile >actual
57
+'
58
+
59
+test_expect_success "'ipfs add bigfile' output looks good" '
60
+ HASH="Qmf2EnuvFQtpFnMJb5aoVPnMx9naECPSm8AGyktmEB5rrR" &&
61
+ echo "added $HASH mountdir/bigfile" >expected &&
62
+ test_cmp expected actual
63
+'
64
+
65
+test_expect_success "'ipfs cat' succeeds" '
66
+ ipfs cat $HASH >actual
67
+'
68
+
69
+test_expect_success "'ipfs cat' output looks good" '
70
+ test_cmp mountdir/bigfile actual
71
+'
72
+
73
+test_expect_success FUSE "cat ipfs/bigfile succeeds" '
74
+ cat ipfs/$HASH >actual
75
+'
76
+
77
+test_expect_success FUSE "cat ipfs/bigfile looks good" '
78
+ test_cmp mountdir/bigfile actual
79
+'
80
+
81
test_expect_success EXPENSIVE "generate 100MB file using go-random" '
82
random 104857600 42 >mountdir/bigfile
83
'