This repository has been archived by the owner on Apr 16, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
t0040-add-and-cat.sh
executable file
·597 lines (468 loc) · 17.6 KB
/
t0040-add-and-cat.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
#!/bin/sh
#
# Copyright (c) 2014 Christian Couder
# MIT Licensed; see the LICENSE file in this repository.
#
test_description="Test add and cat commands"
. lib/test-lib.sh
test_add_cat_file() {
test_expect_success "ipfs add --help works" '
ipfs add --help 2> add_help_err > /dev/null
'
test_expect_success "stdin reading message doesnt show up" '
test_expect_code 1 grep "ipfs: Reading from" add_help_err &&
test_expect_code 1 grep "send Ctrl-d to stop." add_help_err
'
test_expect_success "ipfs add succeeds" '
echo "Hello Worlds!" >mountdir/hello.txt &&
ipfs add mountdir/hello.txt >actual
'
test_expect_success "ipfs add output looks good" '
HASH="QmVr26fY1tKyspEJBniVhqxQeEjhF78XerGiqWAwraVLQH" &&
echo "added $HASH hello.txt" >expected &&
test_cmp expected actual
'
test_expect_success "ipfs add --only-hash succeeds" '
ipfs add --only-hash mountdir/hello.txt > oh_actual
'
test_expect_success "ipfs add --only-hash output looks good" '
test_cmp expected oh_actual
'
test_expect_success "ipfs cat succeeds" '
ipfs cat "$HASH" >actual
'
test_expect_success "ipfs cat output looks good" '
echo "Hello Worlds!" >expected &&
test_cmp expected actual
'
test_expect_success "ipfs cat with offset succeeds" '
ipfs cat --offset 10 "$HASH" >actual
'
test_expect_success "ipfs cat from offset output looks good" '
echo "ds!" >expected &&
test_cmp expected actual
'
test_expect_success "ipfs cat multiple hashes with offset succeeds" '
ipfs cat --offset 10 "$HASH" "$HASH" >actual
'
test_expect_success "ipfs cat from offset output looks good" '
echo "ds!" >expected &&
echo "Hello Worlds!" >>expected &&
test_cmp expected actual
'
test_expect_success "ipfs cat multiple hashes with offset succeeds" '
ipfs cat --offset 16 "$HASH" "$HASH" >actual
'
test_expect_success "ipfs cat from offset output looks good" '
echo "llo Worlds!" >expected &&
test_cmp expected actual
'
test_expect_success "ipfs cat from negitive offset should fail" '
test_expect_code 1 ipfs cat --offset -102 "$HASH" > actual
'
test_expect_success "ipfs cat with length succeeds" '
ipfs cat --length 8 "$HASH" >actual
'
test_expect_success "ipfs cat with length output looks good" '
printf "Hello Wo" >expected &&
test_cmp expected actual
'
test_expect_success "ipfs cat multiple hashes with offset and length succeeds" '
ipfs cat --offset 5 --length 15 "$HASH" "$HASH" "$HASH" >actual
'
test_expect_success "ipfs cat multiple hashes with offset and length looks good" '
printf " Worlds!\nHello " >expected &&
test_cmp expected actual
'
test_expect_success "ipfs cat with exact length succeeds" '
ipfs cat --length $(ipfs cat "$HASH" | wc -c) "$HASH" >actual
'
test_expect_success "ipfs cat with exact length looks good" '
echo "Hello Worlds!" >expected &&
test_cmp expected actual
'
test_expect_success "ipfs cat with 0 length succeeds" '
ipfs cat --length 0 "$HASH" >actual
'
test_expect_success "ipfs cat with 0 length looks good" '
: >expected &&
test_cmp expected actual
'
test_expect_success "ipfs cat with oversized length succeeds" '
ipfs cat --length 100 "$HASH" >actual
'
test_expect_success "ipfs cat with oversized length looks good" '
echo "Hello Worlds!" >expected &&
test_cmp expected actual
'
test_expect_success "ipfs cat with negitive length should fail" '
test_expect_code 1 ipfs cat --length -102 "$HASH" > actual
'
test_expect_success "ipfs cat /ipfs/file succeeds" '
ipfs cat /ipfs/$HASH >actual
'
test_expect_success "output looks good" '
echo "Hello Worlds!" >expected &&
test_cmp expected actual
'
test_expect_success "ipfs add -t succeeds" '
ipfs add -t mountdir/hello.txt >actual
'
test_expect_success "ipfs add -t output looks good" '
HASH="QmUkUQgxXeggyaD5Ckv8ZqfW8wHBX6cYyeiyqvVZYzq5Bi" &&
echo "added $HASH hello.txt" >expected &&
test_cmp expected actual
'
test_expect_success "ipfs add --chunker size-32 succeeds" '
ipfs add --chunker rabin mountdir/hello.txt >actual
'
test_expect_success "ipfs add --chunker size-32 output looks good" '
HASH="QmVr26fY1tKyspEJBniVhqxQeEjhF78XerGiqWAwraVLQH" &&
echo "added $HASH hello.txt" >expected &&
test_cmp expected actual
'
test_expect_success "ipfs add on hidden file succeeds" '
echo "Hello Worlds!" >mountdir/.hello.txt &&
ipfs add mountdir/.hello.txt >actual
'
test_expect_success "ipfs add on hidden file output looks good" '
HASH="QmVr26fY1tKyspEJBniVhqxQeEjhF78XerGiqWAwraVLQH" &&
echo "added $HASH .hello.txt" >expected &&
test_cmp expected actual
'
}
test_add_cat_5MB() {
ADD_FLAGS="$1"
EXP_HASH="$2"
test_expect_success "generate 5MB file using go-random" '
random 5242880 41 >mountdir/bigfile
'
test_expect_success "sha1 of the file looks ok" '
echo "11145620fb92eb5a49c9986b5c6844efda37e471660e" >sha1_expected &&
multihash -a=sha1 -e=hex mountdir/bigfile >sha1_actual &&
test_cmp sha1_expected sha1_actual
'
test_expect_success "'ipfs add $ADD_FLAGS bigfile' succeeds" '
ipfs add $ADD_FLAGS mountdir/bigfile >actual ||
test_fsh cat daemon_err
'
test_expect_success "'ipfs add bigfile' output looks good" '
echo "added $EXP_HASH bigfile" >expected &&
test_cmp expected actual
'
test_expect_success "'ipfs cat' succeeds" '
ipfs cat "$EXP_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/$EXP_HASH" >actual
'
test_expect_success FUSE "cat ipfs/bigfile looks good" '
test_cmp mountdir/bigfile actual
'
}
test_add_cat_raw() {
test_expect_success "add a small file with raw-leaves" '
echo "foobar" > afile &&
HASH=$(ipfs add -q --raw-leaves afile)
'
test_expect_success "cat that small file" '
ipfs cat $HASH > afile_out
'
test_expect_success "make sure it looks good" '
test_cmp afile afile_out
'
}
test_add_cat_expensive() {
ADD_FLAGS="$1"
HASH="$2"
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 "1114885b197b01e0f7ff584458dc236cb9477d2e736d" >sha1_expected &&
multihash -a=sha1 -e=hex mountdir/bigfile >sha1_actual &&
test_cmp sha1_expected sha1_actual
'
test_expect_success EXPENSIVE "ipfs add $ADD_FLAGS bigfile succeeds" '
ipfs add $ADD_FLAGS mountdir/bigfile >actual
'
test_expect_success EXPENSIVE "ipfs add bigfile output looks good" '
echo "added $HASH bigfile" >expected &&
test_cmp expected actual
'
test_expect_success EXPENSIVE "ipfs cat succeeds" '
ipfs cat "$HASH" | multihash -a=sha1 -e=hex >sha1_actual
'
test_expect_success EXPENSIVE "ipfs cat output looks good" '
ipfs cat "$HASH" >actual &&
test_cmp mountdir/bigfile actual
'
test_expect_success EXPENSIVE "ipfs cat output hashed looks good" '
echo "1114885b197b01e0f7ff584458dc236cb9477d2e736d" >sha1_expected &&
test_cmp sha1_expected sha1_actual
'
test_expect_success FUSE,EXPENSIVE "cat ipfs/bigfile succeeds" '
cat "ipfs/$HASH" | multihash -a=sha1 -e=hex >sha1_actual
'
test_expect_success FUSE,EXPENSIVE "cat ipfs/bigfile looks good" '
test_cmp sha1_expected sha1_actual
'
}
test_add_named_pipe() {
err_prefix=$1
test_expect_success "useful error message when adding a named pipe" '
mkfifo named-pipe &&
test_expect_code 1 ipfs add named-pipe 2>actual &&
STAT=$(generic_stat named-pipe) &&
rm named-pipe &&
grep "Error: Unrecognized file type for named-pipe: $STAT" actual &&
grep USAGE actual &&
grep "ipfs add" actual
'
test_expect_success "useful error message when recursively adding a named pipe" '
mkdir -p named-pipe-dir &&
mkfifo named-pipe-dir/named-pipe &&
STAT=$(generic_stat named-pipe-dir/named-pipe) &&
test_expect_code 1 ipfs add -r named-pipe-dir 2>actual &&
printf "Error:$err_prefix Unrecognized file type for named-pipe-dir/named-pipe: $STAT\n" >expected &&
rm named-pipe-dir/named-pipe &&
rmdir named-pipe-dir &&
test_cmp expected actual
'
}
test_add_pwd_is_symlink() {
test_expect_success "ipfs add -r adds directory content when ./ is symlink" '
mkdir hellodir &&
echo "World" > hellodir/world &&
ln -s hellodir hellolink &&
( cd hellolink &&
ipfs add -r . > ../actual ) &&
grep "added Qma9CyFdG5ffrZCcYSin2uAETygB25cswVwEYYzwfQuhTe" actual &&
rm -r hellodir
'
}
test_launch_ipfs_daemon_and_mount
test_expect_success "'ipfs add --help' succeeds" '
ipfs add --help >actual
'
test_expect_success "'ipfs add --help' output looks good" '
egrep "ipfs add.*<path>" actual >/dev/null ||
test_fsh cat actual
'
test_expect_success "'ipfs cat --help' succeeds" '
ipfs cat --help >actual
'
test_expect_success "'ipfs cat --help' output looks good" '
egrep "ipfs cat.*<ipfs-path>" actual >/dev/null ||
test_fsh cat actual
'
test_add_cat_file
test_expect_success "ipfs cat succeeds with stdin opened (issue #1141)" '
cat mountdir/hello.txt | while read line; do ipfs cat "$HASH" >actual || exit; done
'
test_expect_success "ipfs cat output looks good" '
cat mountdir/hello.txt >expected &&
test_cmp expected actual
'
test_expect_success "ipfs cat accept hash from built input" '
echo "$HASH" | ipfs cat >actual
'
test_expect_success "ipfs cat output looks good" '
test_cmp expected actual
'
test_expect_success FUSE "cat ipfs/stuff succeeds" '
cat "ipfs/$HASH" >actual
'
test_expect_success FUSE "cat ipfs/stuff looks good" '
test_cmp expected actual
'
test_expect_success "'ipfs add -q' succeeds" '
echo "Hello Venus!" >mountdir/venus.txt &&
ipfs add -q mountdir/venus.txt >actual
'
test_expect_success "'ipfs add -q' output looks good" '
HASH="QmU5kp3BH3B8tnWUU2Pikdb2maksBNkb92FHRr56hyghh4" &&
echo "$HASH" >expected &&
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 $HASH" >expected &&
test_cmp expected actual
'
test_expect_success "'ipfs cat' with built input succeeds" '
echo "$HASH" | ipfs cat >actual
'
test_expect_success "ipfs cat with built input output looks good" '
printf "Hello Neptune!\nHello Pluton!" >expected &&
test_cmp expected actual
'
add_directory() {
EXTRA_ARGS=$1
test_expect_success "'ipfs add -r $EXTRA_ARGS' succeeds" '
mkdir mountdir/planets &&
echo "Hello Mars!" >mountdir/planets/mars.txt &&
echo "Hello Venus!" >mountdir/planets/venus.txt &&
ipfs add -r $EXTRA_ARGS mountdir/planets >actual
'
test_expect_success "'ipfs add -r $EXTRA_ARGS' output looks good" '
echo "added $MARS planets/mars.txt" >expected &&
echo "added $VENUS planets/venus.txt" >>expected &&
echo "added $PLANETS planets" >>expected &&
test_cmp expected actual
'
test_expect_success "ipfs cat accept many hashes from built input" '
{ echo "$MARS"; echo "$VENUS"; } | ipfs cat >actual
'
test_expect_success "ipfs cat output looks good" '
cat mountdir/planets/mars.txt mountdir/planets/venus.txt >expected &&
test_cmp expected actual
'
test_expect_success "ipfs cat accept many hashes as args" '
ipfs cat "$MARS" "$VENUS" >actual
'
test_expect_success "ipfs cat output looks good" '
test_cmp expected actual
'
test_expect_success "ipfs cat with both arg and stdin" '
echo "$MARS" | ipfs cat "$VENUS" >actual
'
test_expect_success "ipfs cat output looks good" '
cat mountdir/planets/venus.txt >expected &&
test_cmp expected actual
'
test_expect_success "ipfs cat with two args and stdin" '
echo "$MARS" | ipfs cat "$VENUS" "$VENUS" >actual
'
test_expect_success "ipfs cat output looks good" '
cat mountdir/planets/venus.txt mountdir/planets/venus.txt >expected &&
test_cmp expected actual
'
test_expect_success "ipfs add --quieter succeeds" '
ipfs add -r -Q $EXTRA_ARGS mountdir/planets >actual
'
test_expect_success "ipfs add --quieter returns only one correct hash" '
echo "$PLANETS" > expected &&
test_cmp expected actual
'
test_expect_success "cleanup" '
rm -r mountdir/planets
'
}
PLANETS="QmWSgS32xQEcXMeqd3YPJLrNBLSdsfYCep2U7CFkyrjXwY"
MARS="QmPrrHqJzto9m7SyiRzarwkqPcCSsKR2EB1AyqJfe8L8tN"
VENUS="QmU5kp3BH3B8tnWUU2Pikdb2maksBNkb92FHRr56hyghh4"
add_directory
PLANETS="QmfWfQfKCY5Ukv9peBbxM5vqWM9BzmqUSXvdCgjT2wsiBT"
MARS="zb2rhZdTkQNawVajsTNiYc9cTPHqgLdJVvBRkZok9RjkgQYRU"
VENUS="zb2rhn6TGvnUaMAg4VV4y9HVx5W42HihcH4jsyrDv8mkepFqq"
add_directory '--raw-leaves'
PLANETS="zdj7Wnbun6P41Z5ddTkNvZaDTmQ8ZLdiKFcJrL9sV87rPScMP"
MARS="zb2rhZdTkQNawVajsTNiYc9cTPHqgLdJVvBRkZok9RjkgQYRU"
VENUS="zb2rhn6TGvnUaMAg4VV4y9HVx5W42HihcH4jsyrDv8mkepFqq"
add_directory '--cid-version=1'
PLANETS="zdj7WiC51v78BjBcmZR7uuBvmDWxSn5EDr5MiyTwE18e8qvb7"
MARS="zdj7WWx6fGNrNGkdpkuTAxCjKbQ1pPtarqA6VQhedhLTZu34J"
VENUS="zdj7WbB1BUF8WejmVpQCmMLd1RbPnxJtvAj1Lep6eTmXRFbrz"
add_directory '--cid-version=1 --raw-leaves=false'
PLANETS="zDMZof1kqxDAx9myQbXsyWwyWP9qRPsXsWH7XuTz6isT7Rh1S6nM"
MARS="zCT5htkdz1ZBHYVQXFQn51ngPXLVqaHSWoae87V1d6e9qWpSAjXw"
VENUS="zCT5htke5JcdoMM4WhmUKXWf2QC3TnQToqGZHH1WsZERv6kPhFPg"
add_directory '--hash=blake2b-256'
test_expect_success "'ipfs add -rn' succeeds" '
mkdir -p mountdir/moons/jupiter &&
mkdir -p mountdir/moons/saturn &&
echo "Hello Europa!" >mountdir/moons/jupiter/europa.txt &&
echo "Hello Titan!" >mountdir/moons/saturn/titan.txt &&
echo "hey youre no moon!" >mountdir/moons/mercury.txt &&
ipfs add -rn mountdir/moons >actual
'
test_expect_success "'ipfs add -rn' output looks good" '
MOONS="QmVKvomp91nMih5j6hYBA8KjbiaYvEetU2Q7KvtZkLe9nQ" &&
EUROPA="Qmbjg7zWdqdMaK2BucPncJQDxiALExph5k3NkQv5RHpccu" &&
JUPITER="QmS5mZddhFPLWFX3w6FzAy9QxyYkaxvUpsWCtZ3r7jub9J" &&
SATURN="QmaMagZT4rTE7Nonw8KGSK4oe1bh533yhZrCo1HihSG8FK" &&
TITAN="QmZzppb9WHn552rmRqpPfgU5FEiHH6gDwi3MrB9cTdPwdb" &&
MERCURY="QmUJjVtnN8YEeYcS8VmUeWffTWhnMQAkk5DzZdKnPhqUdK" &&
echo "added $EUROPA moons/jupiter/europa.txt" >expected &&
echo "added $MERCURY moons/mercury.txt" >>expected &&
echo "added $TITAN moons/saturn/titan.txt" >>expected &&
echo "added $JUPITER moons/jupiter" >>expected &&
echo "added $SATURN moons/saturn" >>expected &&
echo "added $MOONS moons" >>expected &&
test_cmp expected actual
'
test_expect_success "go-random is installed" '
type random
'
test_add_cat_5MB "" "QmSr7FqYkxYWGoSfy8ZiaMWQ5vosb18DQGCzjwEQnVHkTb"
test_add_cat_5MB --raw-leaves "QmbdLHCmdi48eM8T7D67oXjA1S2Puo8eMfngdHhdPukFd6"
# note: the specified hash implies that internal nodes are stored
# using CidV1 and leaves are stored using raw blocks
test_add_cat_5MB --cid-version=1 "zdj7WiiaedqVBXjX4SNqx3jfuZideDqdLYnDzCDJ66JDMK9o2"
# note: the specified hash implies that internal nodes are stored
# using CidV1 and leaves are stored using CidV1 but using the legacy
# format (i.e. not raw)
test_add_cat_5MB '--cid-version=1 --raw-leaves=false' "zdj7WfgEsj897BBZj2mcfsRLhaPZcCixPV2G7DkWgF1Wdr64P"
# note: --hash=blake2b-256 implies --cid-version=1 which implies --raw-leaves=true
# the specified hash represents the leaf nodes stored as raw leaves and
# encoded with the blake2b-256 hash funtion
test_add_cat_5MB '--hash=blake2b-256' "zDMZof1kuxn7ebvKyvmkYLPvocSvFYxxAWT1yQBN1wWiXXr7w5mY"
# the specified hash represents the leaf nodes stored as protoful nodes and
# encoded with the blake2b-256 hash funtion
test_add_cat_5MB '--hash=blake2b-256 --raw-leaves=false' "zDMZof1krz3SFTyhboRyWZyUP2qNgVdn9wjtaX211aHJ8WgeyT9v"
test_add_cat_expensive "" "QmU9SWAPPmNEKZB8umYMmjYvN7VyHqABNvdA6GUi4MMEz3"
# note: the specified hash implies that internal nodes are stored
# using CidV1 and leaves are stored using raw blocks
test_add_cat_expensive "--cid-version=1" "zdj7WcatQrtuE4WMkS4XsfsMixuQN2po4irkYhqxeJyW1wgCq"
# note: --hash=blake2b-256 implies --cid-version=1 which implies --raw-leaves=true
# the specified hash represents the leaf nodes stored as raw leaves and
# encoded with the blake2b-256 hash funtion
test_add_cat_expensive '--hash=blake2b-256' "zDMZof1kwndounDzQCANUHjiE3zt1mPEgx7RE3JTHoZrRRa79xcv"
test_add_named_pipe " Post http://$API_ADDR/api/v0/add?chunker=size-262144&encoding=json&hash=sha2-256&pin=true&progress=true&recursive=true&stream-channels=true:"
test_add_pwd_is_symlink
test_add_cat_raw
test_expect_success "ipfs add --cid-version=9 fails" '
echo "context" > afile.txt &&
test_must_fail ipfs add --cid-version=9 afile.txt 2>&1 | tee add_out &&
grep -q "unknown CID version" add_out
'
test_kill_ipfs_daemon
# should work offline
test_add_cat_file
test_add_cat_raw
test_expect_success "ipfs add --only-hash succeeds" '
echo "unknown content for only-hash" | ipfs add --only-hash -q > oh_hash
'
#TODO: this doesn't work when online hence separated out from test_add_cat_file
test_expect_success "ipfs cat file fails" '
test_must_fail ipfs cat $(cat oh_hash)
'
test_add_named_pipe ""
test_add_pwd_is_symlink
# Test daemon in offline mode
test_launch_ipfs_daemon --offline
test_add_cat_file
test_kill_ipfs_daemon
test_done