Add tests for DNS
This commit is contained in:
parent
96a3ecfe14
commit
5ee80b1b7d
@ -170,6 +170,7 @@ in rec {
|
|||||||
pkgs.busybox
|
pkgs.busybox
|
||||||
pkgs.yq-go
|
pkgs.yq-go
|
||||||
pkgs.jq
|
pkgs.jq
|
||||||
|
pkgs.dig
|
||||||
]}
|
]}
|
||||||
export SHELL=${pkgs.bash}/bin/bash
|
export SHELL=${pkgs.bash}/bin/bash
|
||||||
exec ${pkgs.bash}/bin/bash ${./tests}/entrypoint.sh "$@"
|
exec ${pkgs.bash}/bin/bash ${./tests}/entrypoint.sh "$@"
|
||||||
|
3
tests.sh
3
tests.sh
@ -8,8 +8,9 @@ this_user="$(whoami)"
|
|||||||
echo "Requesting sudo in order to set thread capabilities, will drop back down to user '$this_user' immediately"
|
echo "Requesting sudo in order to set thread capabilities, will drop back down to user '$this_user' immediately"
|
||||||
|
|
||||||
sudo -E capsh \
|
sudo -E capsh \
|
||||||
--caps="cap_net_admin+eip cap_setpcap,cap_setuid,cap_setgid+ep" \
|
--caps="cap_net_admin,cap_net_bind_service+eip cap_setpcap,cap_setuid,cap_setgid+ep" \
|
||||||
--keep=1 \
|
--keep=1 \
|
||||||
--user="$this_user" \
|
--user="$this_user" \
|
||||||
--addamb=cap_net_admin \
|
--addamb=cap_net_admin \
|
||||||
|
--addamb=cap_net_bind_service \
|
||||||
-- "$entrypoint" "$@"
|
-- "$entrypoint" "$@"
|
||||||
|
3
tests/NOTES.txt
Normal file
3
tests/NOTES.txt
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
Ctrl+A X -> exits
|
||||||
|
|
||||||
|
qemu-system-aarch64 -M virt -nographic -cdrom tests/alpine-virt-3.17.3-aarch64.iso
|
20
tests/cases/dnsmasq/00-hosts.sh
Normal file
20
tests/cases/dnsmasq/00-hosts.sh
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
# shellcheck source=../../utils/with-1-data-1-empty-node-cluster.sh
|
||||||
|
source "$UTILS"/with-1-data-1-empty-node-cluster.sh
|
||||||
|
|
||||||
|
function assert_a {
|
||||||
|
want_ip="$1"
|
||||||
|
hostname="$2"
|
||||||
|
r="$(dig @"$current_ip" +noall +answer "$hostname")"
|
||||||
|
echo "$r" | grep -q "$want_ip"
|
||||||
|
}
|
||||||
|
|
||||||
|
as_primus
|
||||||
|
assert_a "$primus_ip" primus.hosts.shared.test
|
||||||
|
|
||||||
|
# TODO This doesn't work at present, there would need to be some mechanism to
|
||||||
|
# block the test until secondus' bootstrap info can propagate to primus.
|
||||||
|
#assert_a "$secondus_ip" secondus.hosts.shared.test
|
||||||
|
|
||||||
|
as_secondus
|
||||||
|
assert_a "$primus_ip" primus.hosts.shared.test
|
||||||
|
assert_a "$secondus_ip" secondus.hosts.shared.test
|
@ -1,14 +1,20 @@
|
|||||||
set -e
|
set -e
|
||||||
|
|
||||||
base="shared/1-data-1-empty"
|
base="shared/1-data-1-empty"
|
||||||
|
|
||||||
primus_base="$base/primus"
|
primus_base="$base/primus"
|
||||||
|
primus_ip="10.6.9.1"
|
||||||
|
|
||||||
secondus_base="$base/secondus"
|
secondus_base="$base/secondus"
|
||||||
|
secondus_ip="10.6.9.2"
|
||||||
|
|
||||||
function as_primus {
|
function as_primus {
|
||||||
|
current_ip="$primus_ip"
|
||||||
eval "$($SHELL "$UTILS/shared-daemon-env.sh" "$primus_base")"
|
eval "$($SHELL "$UTILS/shared-daemon-env.sh" "$primus_base")"
|
||||||
}
|
}
|
||||||
|
|
||||||
function as_secondus {
|
function as_secondus {
|
||||||
|
current_ip="$secondus_ip"
|
||||||
eval "$($SHELL "$UTILS/shared-daemon-env.sh" "$secondus_base")"
|
eval "$($SHELL "$UTILS/shared-daemon-env.sh" "$secondus_base")"
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -48,7 +54,7 @@ EOF
|
|||||||
--config-path daemon.yml \
|
--config-path daemon.yml \
|
||||||
--domain shared.test \
|
--domain shared.test \
|
||||||
--hostname primus \
|
--hostname primus \
|
||||||
--ip-net "10.6.9.1/24" \
|
--ip-net "$current_ip/24" \
|
||||||
--name "testing" \
|
--name "testing" \
|
||||||
> admin.yml
|
> admin.yml
|
||||||
|
|
||||||
@ -64,7 +70,7 @@ EOF
|
|||||||
isle admin create-bootstrap \
|
isle admin create-bootstrap \
|
||||||
--admin-path admin.yml \
|
--admin-path admin.yml \
|
||||||
--hostname secondus \
|
--hostname secondus \
|
||||||
--ip 10.6.9.2 \
|
--ip "$secondus_ip" \
|
||||||
> "$secondus_bootstrap"
|
> "$secondus_bootstrap"
|
||||||
|
|
||||||
(
|
(
|
||||||
|
Loading…
Reference in New Issue
Block a user