Compare commits
No commits in common. "5ee80b1b7d47e6f3b138b05cc1d9c0bcf37484d2" and "8dcc436aaa373b4e502a34ffd981522972cd89ac" have entirely different histories.
5ee80b1b7d
...
8dcc436aaa
@ -170,7 +170,6 @@ in rec {
|
||||
pkgs.busybox
|
||||
pkgs.yq-go
|
||||
pkgs.jq
|
||||
pkgs.dig
|
||||
]}
|
||||
export SHELL=${pkgs.bash}/bin/bash
|
||||
exec ${pkgs.bash}/bin/bash ${./tests}/entrypoint.sh "$@"
|
||||
|
3
tests.sh
3
tests.sh
@ -8,9 +8,8 @@ this_user="$(whoami)"
|
||||
echo "Requesting sudo in order to set thread capabilities, will drop back down to user '$this_user' immediately"
|
||||
|
||||
sudo -E capsh \
|
||||
--caps="cap_net_admin,cap_net_bind_service+eip cap_setpcap,cap_setuid,cap_setgid+ep" \
|
||||
--caps="cap_net_admin+eip cap_setpcap,cap_setuid,cap_setgid+ep" \
|
||||
--keep=1 \
|
||||
--user="$this_user" \
|
||||
--addamb=cap_net_admin \
|
||||
--addamb=cap_net_bind_service \
|
||||
-- "$entrypoint" "$@"
|
||||
|
@ -1,3 +0,0 @@
|
||||
Ctrl+A X -> exits
|
||||
|
||||
qemu-system-aarch64 -M virt -nographic -cdrom tests/alpine-virt-3.17.3-aarch64.iso
|
@ -1,20 +0,0 @@
|
||||
# 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,7 +1,6 @@
|
||||
# shellcheck source=../../utils/with-1-data-1-empty-node-cluster.sh
|
||||
source "$UTILS"/with-1-data-1-empty-node-cluster.sh
|
||||
|
||||
function do_tests {
|
||||
status="$(isle garage cli status | tail -n+3)"
|
||||
|
||||
[ "$(echo "$status" | wc -l)" = "3" ]
|
||||
@ -12,10 +11,3 @@ function do_tests {
|
||||
buckets="$(isle garage cli bucket list | tail -n+2)"
|
||||
[ "$(echo "$buckets" | wc -l)" = 1 ]
|
||||
echo "$buckets" | grep -q 'global-shared'
|
||||
}
|
||||
|
||||
as_primus
|
||||
do_tests
|
||||
|
||||
as_secondus
|
||||
do_tests
|
||||
|
@ -1,16 +1,8 @@
|
||||
# shellcheck source=../../utils/with-1-data-1-empty-node-cluster.sh
|
||||
source "$UTILS"/with-1-data-1-empty-node-cluster.sh
|
||||
|
||||
function do_tests {
|
||||
files="$(isle garage mc -- tree --json garage)"
|
||||
[ "$(echo "$files" | jq -s '.|length')" -ge "1" ]
|
||||
|
||||
file="$(echo "$files" | jq -sr '.[0].key')"
|
||||
[ "$(isle garage mc -- cat "garage/$file" | wc -c)" -gt "0" ]
|
||||
}
|
||||
|
||||
as_primus
|
||||
do_tests
|
||||
|
||||
as_secondus
|
||||
do_tests
|
||||
|
@ -8,9 +8,4 @@ XDG_DATA_HOME="$TMPDIR/.data"
|
||||
|
||||
mkdir -p "$TMPDIR" "$XDG_RUNTIME_DIR" "$XDG_DATA_HOME"
|
||||
|
||||
cat <<EOF
|
||||
export TMPDIR="$TMPDIR"
|
||||
export XDG_RUNTIME_DIR="$XDG_RUNTIME_DIR"
|
||||
export XDG_DATA_HOME="$XDG_DATA_HOME"
|
||||
cd "$TMPDIR"
|
||||
EOF
|
||||
echo "export TMPDIR='$TMPDIR' XDG_RUNTIME_DIR='$XDG_RUNTIME_DIR' XDG_DATA_HOME='$XDG_DATA_HOME'"
|
||||
|
@ -1,26 +1,13 @@
|
||||
set -e
|
||||
|
||||
base="shared/1-data-1-empty"
|
||||
|
||||
primus_base="$base/primus"
|
||||
primus_ip="10.6.9.1"
|
||||
|
||||
secondus_base="$base/secondus"
|
||||
secondus_ip="10.6.9.2"
|
||||
|
||||
function as_primus {
|
||||
current_ip="$primus_ip"
|
||||
eval "$($SHELL "$UTILS/shared-daemon-env.sh" "$primus_base")"
|
||||
}
|
||||
|
||||
function as_secondus {
|
||||
current_ip="$secondus_ip"
|
||||
eval "$($SHELL "$UTILS/shared-daemon-env.sh" "$secondus_base")"
|
||||
}
|
||||
|
||||
# Even if it's already intialized, we want to put the caller in primus'
|
||||
# environment
|
||||
as_primus
|
||||
eval "$($SHELL "$UTILS/shared-daemon-env.sh" "$primus_base")"
|
||||
cd "$TMPDIR"
|
||||
|
||||
secondus_bootstrap="$(pwd)/secondus-bootstrap.yml"
|
||||
|
||||
@ -54,7 +41,7 @@ EOF
|
||||
--config-path daemon.yml \
|
||||
--domain shared.test \
|
||||
--hostname primus \
|
||||
--ip-net "$current_ip/24" \
|
||||
--ip-net "10.6.9.1/24" \
|
||||
--name "testing" \
|
||||
> admin.yml
|
||||
|
||||
@ -70,11 +57,12 @@ EOF
|
||||
isle admin create-bootstrap \
|
||||
--admin-path admin.yml \
|
||||
--hostname secondus \
|
||||
--ip "$secondus_ip" \
|
||||
--ip 10.6.9.2 \
|
||||
> "$secondus_bootstrap"
|
||||
|
||||
(
|
||||
as_secondus
|
||||
eval "$($SHELL "$UTILS/shared-daemon-env.sh" "$secondus_base")"
|
||||
cd "$TMPDIR"
|
||||
|
||||
cat >daemon.yml <<EOF
|
||||
vpn:
|
||||
|
Loading…
Reference in New Issue
Block a user