Skip to content

Commit

Permalink
Test tang port before returing it
Browse files Browse the repository at this point in the history
  • Loading branch information
oldium committed May 5, 2024
1 parent 04d5e9f commit 4525b03
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/pins/tang/tests/tang-common-test-functions.in
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,11 @@ tang_create_adv() {
# Get a random port to be used with a test tang server.
tang_new_random_port() {
tang_sanity_check
shuf -i 1024-65535 -n 1
local port=$(shuf -i 1024-65535 -n 1)

Check warning

Code scanning / shellcheck

Declare and assign separately to avoid masking return values. Warning test

Declare and assign separately to avoid masking return values.
while (: >/dev/tcp/127.0.0.1/$port) 2>/dev/null; do
port=$(shuf -i 1024-65535 -n 1)
done
echo $port
}

# Removes tang rotated keys from the test server.
Expand Down

0 comments on commit 4525b03

Please sign in to comment.