Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
40 additions
and
0 deletions.
There are no files selected for viewing
1 change: 1 addition & 0 deletions
1
tenzir/integration/data/reference/udp/test_loader_-2d_listen/step_00.ref
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 @@ | ||
{"foo": 42} |
10 changes: 10 additions & 0 deletions
10
tenzir/integration/data/reference/udp/test_saver/step_00.ref
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,10 @@ | ||
{"foo": 42} | ||
{"foo": 42} | ||
{"foo": 42} | ||
{"foo": 42} | ||
{"foo": 42} | ||
{"foo": 42} | ||
{"foo": 42} | ||
{"foo": 42} | ||
{"foo": 42} | ||
{"foo": 42} |
2 changes: 2 additions & 0 deletions
2
tenzir/integration/data/reference/udp/test_saver_-2d_message_too_long/step_00.ref
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,2 @@ | ||
error: failed to send data over UDP socket | ||
= note: Message too long |
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,27 @@ | ||
: "${BATS_TEST_TIMEOUT:=10}" | ||
|
||
setup() { | ||
bats_load_library bats-support | ||
bats_load_library bats-assert | ||
bats_load_library bats-tenzir | ||
} | ||
|
||
@test "loader - listen" { | ||
check --bg listen \ | ||
tenzir 'from udp://127.0.0.1:56789 | head 1' | ||
timeout 10 bash -c 'until lsof -i :56789; do sleep 0.2; done' | ||
jq -n '{foo: 42}' | socat - udp-send:127.0.0.1:56789 | ||
wait_all "${listen[@]}" | ||
} | ||
|
||
@test "saver" { | ||
check --bg listen \ | ||
tenzir 'from udp://127.0.0.1:55555 | head 10' | ||
timeout 10 bash -c 'until lsof -i :55555; do sleep 0.2; done' | ||
tenzir 'version | put foo=42 | repeat 10 | to udp://127.0.0.1:55555' | ||
wait_all "${listen[@]}" | ||
} | ||
|
||
@test "saver - message too long" { | ||
printf "%65535s" | check tenzir 'save udp 127.0.0.1:54321' || true | ||
} |