-
Notifications
You must be signed in to change notification settings - Fork 495
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: disallow produce mirror topic from home (#4029)
* fix: disallow produce mirror topic from home * test: add is_home_mirror partition test
- Loading branch information
Showing
8 changed files
with
71 additions
and
4 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
[package] | ||
name = "fluvio-protocol" | ||
edition = "2021" | ||
version = "0.10.13" | ||
version = "0.10.14" | ||
authors = ["Fluvio Contributors <[email protected]>"] | ||
description = "Fluvio streaming protocol" | ||
repository = "https://github.com/infinyon/fluvio" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
#!/usr/bin/env bats | ||
|
||
TEST_HELPER_DIR="$BATS_TEST_DIRNAME/../test_helper" | ||
export TEST_HELPER_DIR | ||
|
||
load "$TEST_HELPER_DIR"/tools_check.bash | ||
load "$TEST_HELPER_DIR"/fluvio_dev.bash | ||
load "$TEST_HELPER_DIR"/bats-support/load.bash | ||
load "$TEST_HELPER_DIR"/bats-assert/load.bash | ||
|
||
setup_file() { | ||
CURRENT_DATE=$(date +%Y-%m) | ||
export CURRENT_DATE | ||
|
||
REMOTE_NAME="$(random_string 7)" | ||
export REMOTE_NAME | ||
debug_msg "Remote name: $REMOTE_NAME" | ||
|
||
MESSAGE="$(random_string 7)" | ||
export MESSAGE | ||
debug_msg "$MESSAGE" | ||
|
||
TOPIC_NAME="$(random_string 7)" | ||
export TOPIC_NAME | ||
debug_msg "Topic name: $TOPIC_NAME" | ||
} | ||
|
||
@test "Can register an remote cluster" { | ||
run timeout 15s "$FLUVIO_BIN" remote register "$REMOTE_NAME" | ||
|
||
assert_output "remote cluster \"$REMOTE_NAME\" was registered" | ||
assert_success | ||
} | ||
|
||
@test "Can create a mirror topic" { | ||
echo "[\"$REMOTE_NAME\"]" > remotes.json | ||
run timeout 15s "$FLUVIO_BIN" topic create "$TOPIC_NAME" --mirror-apply remotes.json | ||
|
||
assert_output "topic \"$TOPIC_NAME\" created" | ||
assert_success | ||
} | ||
|
||
@test "Can't produce to a mirror topic from home" { | ||
MESSAGE="$(random_string 7)" | ||
run bash -c 'echo "$MESSAGE" | timeout 15s "$FLUVIO_BIN" produce "$TOPIC_NAME"' | ||
|
||
assert_output "Producer error: Producer received an error code: produce from home is not allowed" | ||
assert_failure | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters