@@ -106,12 +106,21 @@ test_sharding() {
106
106
'
107
107
}
108
108
109
+ # Some loose notes:
110
+ # Using `/cats` as the root directory where tests work.
109
111
test_files_api () {
110
112
local EXTRA ARGS RAW_LEAVES
113
+ # Textual information used in output log.
111
114
EXTRA=$1
115
+ # Used in `ipfs files write` and `ipfs files mkdir`:
116
+ # * `--cid-version=1`
112
117
ARGS=$2
118
+ # `--raw-leaves` option for `ipfs files write`.
113
119
RAW_LEAVES=$3
114
120
121
+ # Create and verify the directory `/cats` where the tests will be
122
+ # working on.
123
+
115
124
test_expect_success " can mkdir in root $EXTRA " '
116
125
ipfs files mkdir $ARGS /cats
117
126
'
@@ -181,6 +190,8 @@ test_files_api() {
181
190
ipfs files stat --hash / > roothashafter &&
182
191
test_cmp roothash roothashafter
183
192
'
193
+ # Create files ($FILE1/2/3) inside the `/cats` directory and
194
+ # also inside subdirectories.
184
195
185
196
test_expect_success " can put files into directory $EXTRA " '
186
197
ipfs files cp /ipfs/$FILE1 /cats/file1
@@ -498,12 +509,19 @@ test_files_api() {
498
509
echo "testing" | ipfs files write $ARGS $RAW_LEAVES -f=false -e /cats/walrus
499
510
'
500
511
512
+ # Offending test: https://github.com/ipfs/go-ipfs/issues/8131
501
513
test_expect_success " root hash not bubbled up yet $EXTRA " '
502
514
test -z "$ONLINE" ||
503
515
(ipfs refs local > refsout &&
504
516
test_expect_code 1 grep $ROOT_HASH refsout)
505
517
'
506
518
519
+ # FIXME: Does this mean the stat is supposed to flush this?
520
+ # The stat code seems to be an ad-hoc tool that works on the UnixFS
521
+ # layer and not on the MFS one that handles flushing.
522
+ # Maybe the MFS lookup function that ends up calling
523
+ # `(*mfs.Directory).GetNode()` and then `(*Directory).sync()`.
524
+ # This is not exactly the same as `(*Directory).Flush()`.
507
525
test_expect_success " changes bubbled up to root on inspection $EXTRA " '
508
526
ipfs files stat --hash / > root_hash
509
527
'
0 commit comments