Skip to content

Commit

Permalink
Add tests for directory contents
Browse files Browse the repository at this point in the history
  • Loading branch information
gammazero committed Aug 16, 2024
1 parent 6d2ecbe commit 8efb70b
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 11 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ go 1.22
require (
github.com/cheggaaa/pb/v3 v3.1.4
github.com/ipfs/boxo v0.22.1-0.20240814075207-b27ba953ad58
github.com/ipfs/kubo v0.29.1-0.20240814195154-0312a99bcfb6
github.com/ipfs/kubo v0.29.1-0.20240816001438-d6c6999c6631
github.com/libp2p/go-libp2p v0.36.1
github.com/multiformats/go-multiaddr v0.13.0
github.com/urfave/cli/v2 v2.25.7
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -368,8 +368,8 @@ github.com/ipfs/go-unixfsnode v1.9.0 h1:ubEhQhr22sPAKO2DNsyVBW7YB/zA8Zkif25aBvz8
github.com/ipfs/go-unixfsnode v1.9.0/go.mod h1:HxRu9HYHOjK6HUqFBAi++7DVoWAHn0o4v/nZ/VA+0g8=
github.com/ipfs/go-verifcid v0.0.3 h1:gmRKccqhWDocCRkC+a59g5QW7uJw5bpX9HWBevXa0zs=
github.com/ipfs/go-verifcid v0.0.3/go.mod h1:gcCtGniVzelKrbk9ooUSX/pM3xlH73fZZJDzQJRvOUw=
github.com/ipfs/kubo v0.29.1-0.20240814195154-0312a99bcfb6 h1:eBpHvmO3JsVnnp6xk2/TCxUwO6l3sGwov7S2vBo4CS4=
github.com/ipfs/kubo v0.29.1-0.20240814195154-0312a99bcfb6/go.mod h1:QuWIeYvLkstvAslRHIt8UVCroP+ckMLVysh9gyH2kOg=
github.com/ipfs/kubo v0.29.1-0.20240816001438-d6c6999c6631 h1:AWUl8/A7Oc4nMGHyQ8R9xvkzX36tQSIur1pcJ/+UAo8=
github.com/ipfs/kubo v0.29.1-0.20240816001438-d6c6999c6631/go.mod h1:QuWIeYvLkstvAslRHIt8UVCroP+ckMLVysh9gyH2kOg=
github.com/ipld/go-car v0.6.2 h1:Hlnl3Awgnq8icK+ze3iRghk805lu8YNq3wlREDTF2qc=
github.com/ipld/go-car v0.6.2/go.mod h1:oEGXdwp6bmxJCZ+rARSkDliTeYnVzv3++eXajZ+Bmr8=
github.com/ipld/go-car/v2 v2.13.1 h1:KnlrKvEPEzr5IZHKTXLAEub+tPrzeAFQVRlSQvuxBO4=
Expand Down
2 changes: 1 addition & 1 deletion sharness/dependencies/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ go 1.22
require (
github.com/chriscool/go-sleep v0.0.0-20150606204034-743ab5f1bb48
github.com/ipfs/ipget v0.9.2
github.com/ipfs/kubo v0.29.1-0.20240814195154-0312a99bcfb6
github.com/ipfs/kubo v0.29.1-0.20240816001438-d6c6999c6631
github.com/whyrusleeping/pollEndpoint v0.0.0-20211207235059-e4819e26509a
)

Expand Down
4 changes: 2 additions & 2 deletions sharness/dependencies/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -437,8 +437,8 @@ github.com/ipfs/go-unixfsnode v1.9.0 h1:ubEhQhr22sPAKO2DNsyVBW7YB/zA8Zkif25aBvz8
github.com/ipfs/go-unixfsnode v1.9.0/go.mod h1:HxRu9HYHOjK6HUqFBAi++7DVoWAHn0o4v/nZ/VA+0g8=
github.com/ipfs/go-verifcid v0.0.3 h1:gmRKccqhWDocCRkC+a59g5QW7uJw5bpX9HWBevXa0zs=
github.com/ipfs/go-verifcid v0.0.3/go.mod h1:gcCtGniVzelKrbk9ooUSX/pM3xlH73fZZJDzQJRvOUw=
github.com/ipfs/kubo v0.29.1-0.20240814195154-0312a99bcfb6 h1:eBpHvmO3JsVnnp6xk2/TCxUwO6l3sGwov7S2vBo4CS4=
github.com/ipfs/kubo v0.29.1-0.20240814195154-0312a99bcfb6/go.mod h1:QuWIeYvLkstvAslRHIt8UVCroP+ckMLVysh9gyH2kOg=
github.com/ipfs/kubo v0.29.1-0.20240816001438-d6c6999c6631 h1:AWUl8/A7Oc4nMGHyQ8R9xvkzX36tQSIur1pcJ/+UAo8=
github.com/ipfs/kubo v0.29.1-0.20240816001438-d6c6999c6631/go.mod h1:QuWIeYvLkstvAslRHIt8UVCroP+ckMLVysh9gyH2kOg=
github.com/ipld/go-car v0.6.2 h1:Hlnl3Awgnq8icK+ze3iRghk805lu8YNq3wlREDTF2qc=
github.com/ipld/go-car v0.6.2/go.mod h1:oEGXdwp6bmxJCZ+rARSkDliTeYnVzv3++eXajZ+Bmr8=
github.com/ipld/go-car/v2 v2.13.1 h1:KnlrKvEPEzr5IZHKTXLAEub+tPrzeAFQVRlSQvuxBO4=
Expand Down
16 changes: 11 additions & 5 deletions sharness/t0040-unixfs-mode-modtime.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,18 @@ test_expect_success "retrieve a directory with mode and mtime" '
Linux|FreeBSD)
stat --format="%Y %a" got_dir > out2 &&
echo "660000000 777" > expect2 &&
test_cmp expect2 out2
test_cmp expect2 out2 &&
stat --format="%Y %a" got_dir/data.txt > out3 &&
echo "660000000 100777" > expect3 &&
test_cmp expect3 out3
;;
Darwin)
stat -f "%m %p" got_dir > out2 &&
echo "660000000 40777" > expect2 &&
test_cmp expect2 out2
test_cmp expect2 out2 &&
stat -f "%m %p" got_dir/data.txt > out3 &&
echo "660000000 100777" > expect3 &&
test_cmp expect3 out3
;;
*)
echo "unsupported system: $(uname)"
Expand Down Expand Up @@ -78,9 +84,9 @@ test_expect_success "retrieve a directory with symlink with mode and mtime" '
readlink got_dir2/test_file_link > link_target &&
echo "test_file" > expect_target &&
test_cmp expect_target link_target &&
stat --format="%Y" got_dir2/test_file_link > out3 &&
echo "660000000" > expect3 &&
test_cmp expect3 out3
stat --format="%Y" got_dir2/test_file_link > out4 &&
echo "660000000" > expect4 &&
test_cmp expect4 out4
;;
Darwin)
ipget --node=local -o got_dir2 "/ipfs/$(<dir2_hash)" &&
Expand Down

0 comments on commit 8efb70b

Please sign in to comment.