Skip to content

Commit

Permalink
test: confirm -w and --to-files are exclusive
Browse files Browse the repository at this point in the history
  • Loading branch information
lidel committed Dec 3, 2024
1 parent b320438 commit e035bd5
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
9 changes: 7 additions & 2 deletions docs/changelogs/v0.33.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@

- [Overview](#overview)
- [πŸ”¦ Highlights](#-highlights)
- [Bitswap improvements from Boxo](#bitswap-improvements-from-boxo)
- [Using default `libp2p_rcmgr` metrics](#using-default-libp2p_rcmgr--metrics)
- [`ipfs add --to-files` no longer works with `--wrap`](#ipfs-add---to-files-no-longer-works-with---wrap)
- [πŸ“¦οΈ Dependency updates](#-dependency-updates)
- [πŸ“ Changelog](#-changelog)
- [πŸ‘¨β€πŸ‘©β€πŸ‘§β€πŸ‘¦ Contributors](#-contributors)
Expand All @@ -24,6 +27,10 @@ Bespoke rcmgr metrics [were removed](https://github.com/ipfs/kubo/pull/9947), Ku
This makes it easier to compare Kubo with custom implementations based on go-libp2p.
If you depended on removed ones, please fill an issue to add them to the upstream [go-libp2p](https://github.com/libp2p/go-libp2p).

#### `ipfs add --to-files` no longer works with `--wrap`

Onboarding files and directories with `ipfs add --to-files` now requires non-empty names. due to this, The `--to-files` and `--wrap` options are now mutually exclusive ([#10612](https://github.com/ipfs/kubo/issues/10612)).

#### πŸ“¦οΈ Dependency updates

- update `boxo` to [v0.24.TODO](https://github.com/ipfs/boxo/releases/tag/v0.24.TODO)
Expand All @@ -32,6 +39,4 @@ If you depended on removed ones, please fill an issue to add them to the upstrea

### πŸ“ Changelog

- Fix: unnamed files in MFS. Disallow `--wrap` + `--to-files` when adding ([#10611](https://github.com/ipfs/kubo/issues/10611), [#10612](https://github.com/ipfs/kubo/issues/10612))

### πŸ‘¨β€πŸ‘©β€πŸ‘§β€πŸ‘¦ Contributors
13 changes: 11 additions & 2 deletions test/sharness/t0040-add-and-cat.sh
Original file line number Diff line number Diff line change
Expand Up @@ -355,10 +355,10 @@ test_add_cat_file() {
test_cmp expected actual
'

test_must_fail "ipfs add with multiple files of same name but different dirs fails" '
test_expect_success "ipfs add with multiple files of same name but different dirs fails" '
mkdir -p mountdir/same-file/ &&
cp mountdir/hello.txt mountdir/same-file/hello.txt &&
ipfs add mountdir/hello.txt mountdir/same-file/hello.txt >actual &&
test_expect_code 1 ipfs add mountdir/hello.txt mountdir/same-file/hello.txt >actual &&
rm mountdir/same-file/hello.txt &&
rmdir mountdir/same-file
'
Expand Down Expand Up @@ -469,6 +469,15 @@ test_add_cat_file() {
ipfs files rm -r --force /mfs
'

# confirm -w and --to-files are exclusive
# context: https://github.com/ipfs/kubo/issues/10611
test_expect_success "ipfs add -r -w dir --to-files /mfs/subdir5/ errors (-w and --to-files are exclusive)" '
ipfs files mkdir -p /mfs/subdir5 &&
test_expect_code 1 ipfs add -r -w test --to-files /mfs/subdir5/ >actual 2>&1 &&
test_should_contain "Error" actual &&
ipfs files rm -r --force /mfs
'

}

test_add_cat_5MB() {
Expand Down

0 comments on commit e035bd5

Please sign in to comment.