Compare commits
3 Commits
73db21f841
...
3c3bd8649a
Author | SHA1 | Date |
---|---|---|
Brian Picciano | 3c3bd8649a | 9 months ago |
Brian Picciano | 98e5f4c98c | 9 months ago |
Brian Picciano | 0a482607d5 | 9 months ago |
@ -0,0 +1,20 @@ |
||||
# shellcheck source=../utils/with-single-node-cluster.sh |
||||
source "$UTILS"/with-single-node-cluster.sh |
||||
|
||||
adminBS="$XDG_DATA_HOME"/isle/bootstrap.yml |
||||
bs=create-bootstrap-out.yml |
||||
|
||||
isle admin create-bootstrap \ |
||||
--admin-path admin.yml \ |
||||
--hostname secondus \ |
||||
--ip 10.6.9.2 \ |
||||
> "$bs" |
||||
|
||||
[ "$(yq <"$bs" '.admin_creation_params')" = "$(yq <admin.yml '.creation_params')" ] |
||||
[ "$(yq <"$bs" '.hostname')" = "secondus" ] |
||||
|
||||
[ "$(yq <"$bs" '.hosts.primus.nebula.signed_public_credentials')" \ |
||||
= "$(yq <"$adminBS" '.nebula.signed_public_credentials')" ] |
||||
|
||||
[ "$(yq <"$bs" '.hosts.primus.garage.instances|length')" = "3" ] |
||||
|
@ -0,0 +1,13 @@ |
||||
# shellcheck source=../../utils/with-single-node-cluster.sh |
||||
source "$UTILS"/with-single-node-cluster.sh |
||||
|
||||
status="$(isle garage cli status | tail -n+3)" |
||||
|
||||
[ "$(echo "$status" | wc -l)" = "3" ] |
||||
echo "$status" | grep -q '10.6.9.1:3900' |
||||
echo "$status" | grep -q '10.6.9.1:3910' |
||||
echo "$status" | grep -q '10.6.9.1:3920' |
||||
|
||||
buckets="$(isle garage cli bucket list | tail -n+2)" |
||||
[ "$(echo "$buckets" | wc -l)" = 1 ] |
||||
echo "$buckets" | grep -q 'global-shared' |
@ -0,0 +1,8 @@ |
||||
# shellcheck source=../../utils/with-single-node-cluster.sh |
||||
source "$UTILS"/with-single-node-cluster.sh |
||||
|
||||
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" ] |
@ -0,0 +1,14 @@ |
||||
( |
||||
set -e |
||||
|
||||
TMPDIR="$TMPDIR/shared/single-node.tmp" |
||||
if [ ! -d "$TMPDIR" ]; then exit 0; fi |
||||
|
||||
lock_file="$TMPDIR/.run/isle/lock" |
||||
if [ ! -e "$lock_file" ]; then exit 0; fi |
||||
|
||||
pid="$(cat "$lock_file")" |
||||
echo "killing shared single node cluster (process: $pid)" |
||||
kill "$pid" |
||||
while [ -e "$TMPDIR/.run/isle" ]; do sleep 1; done |
||||
) |
@ -0,0 +1,48 @@ |
||||
set -e |
||||
|
||||
TMPDIR="$TMPDIR/shared/single-node.tmp" |
||||
XDG_RUNTIME_DIR="$TMPDIR/.run" |
||||
XDG_DATA_HOME="$TMPDIR/.data" |
||||
|
||||
mkdir -p "$TMPDIR" "$XDG_RUNTIME_DIR" "$XDG_DATA_HOME" |
||||
|
||||
cd "$TMPDIR" |
||||
|
||||
if [ ! -d "$XDG_RUNTIME_DIR/isle" ]; then |
||||
echo "Initializing shared single node cluster" |
||||
|
||||
mkdir a |
||||
mkdir b |
||||
mkdir c |
||||
|
||||
cat >daemon.yml <<EOF |
||||
vpn: |
||||
public_addr: 127.0.0.1:60000 |
||||
tun: |
||||
device: isle-test-shared |
||||
storage: |
||||
allocations: |
||||
- data_path: a/data |
||||
meta_path: a/meta |
||||
capacity: 100 |
||||
- data_path: b/data |
||||
meta_path: b/meta |
||||
capacity: 100 |
||||
- data_path: c/data |
||||
meta_path: c/meta |
||||
capacity: 100 |
||||
EOF |
||||
|
||||
isle admin create-network \ |
||||
--config-path daemon.yml \ |
||||
--domain shared.test \ |
||||
--hostname primus \ |
||||
--ip-net "10.6.9.1/24" \ |
||||
--name "testing" \ |
||||
> admin.yml |
||||
|
||||
isle daemon --config-path daemon.yml >daemon.log 2>&1 & |
||||
echo "Waiting for daemon (process $!) to initialize" |
||||
|
||||
while ! isle hosts list >/dev/null; do sleep 1; done |
||||
fi |
@ -0,0 +1,9 @@ |
||||
set -e |
||||
|
||||
TMPDIR="$TMPDIR/$TEST_CASE_FILE.tmp" |
||||
XDG_RUNTIME_DIR="$TMPDIR/.run" |
||||
XDG_DATA_HOME="$TMPDIR/.data" |
||||
|
||||
mkdir -p "$TMPDIR" "$XDG_RUNTIME_DIR" "$XDG_DATA_HOME" |
||||
|
||||
cd "$TMPDIR" |
Loading…
Reference in new issue