You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
isle/tests/utils/with-single-node-cluster.sh

48 lines
1.1 KiB

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