etcd: Connection options (socket file, ipv6)
- Allow unix domain socket to be used as client url - Using ::1 as clienturl should not create default local ipv4 listener - Add shell tests
This commit is contained in:
29
test/shell/ipv6-localhost.sh
Executable file
29
test/shell/ipv6-localhost.sh
Executable file
@@ -0,0 +1,29 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -o errexit
|
||||
set -o pipefail
|
||||
|
||||
if ! ifconfig lo | grep 'inet6 ::1' >/dev/null; then
|
||||
echo "No IPv6, skipping test"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
. "$(dirname "$0")/../util.sh"
|
||||
|
||||
tmpdir="$($mktemp --tmpdir -d tmp.XXX)"
|
||||
|
||||
# run empty graph listing only to IPv6 addresses
|
||||
"$MGMT" run --client-urls "http://[::1]:2379" --server-urls "http://[::1]:2380" --tmp-prefix empty &
|
||||
pid=$!
|
||||
|
||||
# kill server on error/exit
|
||||
trap 'pkill -9 mgmt' EXIT
|
||||
|
||||
# give mgmt a little time to startup
|
||||
sleep 10
|
||||
|
||||
# mgmt configured for ipv6 only should not listen on any IPv4 ports
|
||||
lsof -Pn -p "$pid" -a -i | grep '127.0.0.1' && false
|
||||
|
||||
# instead it should listen on IPv6
|
||||
lsof -Pn -p "$pid" -a -i | grep '::1' || false
|
||||
Reference in New Issue
Block a user