-
Notifications
You must be signed in to change notification settings - Fork 156
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix frontend uniqueness check, where IP=* is a NULL pointer
Fixes #317
- Loading branch information
1 parent
95161db
commit 9c13b2b
Showing
2 changed files
with
104 additions
and
6 deletions.
There are no files selected for viewing
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,84 @@ | ||
#!/bin/sh | ||
# Test check_frontend_uniqueness | ||
. hitch_test.sh | ||
|
||
GRP=$(id -gn nobody) || | ||
skip 'no usable group found for user nobody' | ||
|
||
test_cfg() { | ||
cfg=$1.cfg | ||
shift | ||
cat >"$cfg" | ||
run_cmd "$@" hitch \ | ||
--test \ | ||
--config="$cfg" \ | ||
"${CERTSDIR}/default.example.com" | ||
} | ||
|
||
test_bad_cfg() { | ||
test_cfg "$1" -s 1 | ||
} | ||
test_good_cfg() { | ||
test_cfg "$1" -s 0 | ||
} | ||
|
||
test_bad_cfg bad1 <<EOF | ||
frontend = { | ||
host = "*" | ||
port = "443" | ||
} | ||
frontend = { | ||
host = "*" | ||
port = "443" | ||
} | ||
EOF | ||
|
||
test_good_cfg good1 <<EOF | ||
frontend = { | ||
host = "*" | ||
port = "443" | ||
} | ||
frontend = { | ||
host = "*" | ||
port = "444" | ||
} | ||
EOF | ||
|
||
test_good_cfg good2 <<EOF | ||
frontend = { | ||
host = "*" | ||
port = "443" | ||
} | ||
frontend = { | ||
host = "fd22:5979:45f3:9471::1" | ||
port = "443" | ||
} | ||
EOF | ||
|
||
test_bad_cfg bad2 <<EOF | ||
frontend = { | ||
host = "fd22:5979:45f3:9471::1" | ||
port = "443" | ||
} | ||
frontend = { | ||
host = "fd22:5979:45f3:9471::1" | ||
port = "443" | ||
} | ||
EOF | ||
|
||
test_good_cfg good3 <<EOF | ||
frontend = { | ||
host = "fd22:5979:45f3:9471::1" | ||
port = "443" | ||
} | ||
frontend = { | ||
host = "fd22:5979:45f3:9471::1" | ||
port = "444" | ||
} | ||
EOF | ||
|