Skip to content

Commit

Permalink
Merge pull request #4 from MO-RISE/fix/bind-to-mcast-group-address
Browse files Browse the repository at this point in the history
We need to bind to the mcast group address in the call to socat to on…
  • Loading branch information
freol35241 authored Jun 23, 2023
2 parents 3cb8729 + 5a23b82 commit 65bd4a4
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion bash-init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ function to_bus () {
export to_bus

function from_bus () {
socat "UDP4-RECV:12737,reuseaddr,ip-add-membership=239.111.42.$1:0.0.0.0" STDOUT
socat "UDP4-RECV:12737,bind=239.111.42.$1,reuseaddr,ip-add-membership=239.111.42.$1:0.0.0.0" STDOUT
}
export from_bus

Expand Down
15 changes: 15 additions & 0 deletions tests/test_porla.bats
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,18 @@ teardown() {
assert cmp --silent "$TMP_DIR"/test.txt "$TMP_DIR"/out.txt

}

@test "Single writer/listener|writer/listener chain on bus" {
bats_require_minimum_version 1.5.0

docker run -d -v "$TMP_DIR":/recordings --network=host porla "from_bus 37 | record /recordings/out.txt"

docker run -d -v "$TMP_DIR":/recordings --network=host porla "from_bus 36 | to_bus 37"

docker run -v "$TMP_DIR":/recordings --network=host porla "cat /recordings/test.txt | to_bus 36"

assert_exists "$TMP_DIR"/out.txt

assert cmp --silent "$TMP_DIR"/test.txt "$TMP_DIR"/out.txt

}

0 comments on commit 65bd4a4

Please sign in to comment.