Add test script to spin up many clients
parent
6179110889
commit
eae45236b4
|
@ -0,0 +1,46 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
find_minetest() {
|
||||||
|
MT_DIR=$(pwd)
|
||||||
|
while [[ $(basename "$MT_DIR") != "minetest" ]]
|
||||||
|
do
|
||||||
|
MT_DIR=$(dirname "$MT_DIR")
|
||||||
|
done
|
||||||
|
MT=${MT_DIR}/bin/minetest
|
||||||
|
echo "Found minetest at: $MT_DIR"
|
||||||
|
}
|
||||||
|
|
||||||
|
start_server() {
|
||||||
|
echo "Starting server"
|
||||||
|
$MT --server --port 30000 --world "${MT_DIR}/worlds/edu" --name "teacher1" &
|
||||||
|
}
|
||||||
|
|
||||||
|
start_client() {
|
||||||
|
echo "Starting client $1"
|
||||||
|
$MT --address "127.0.0.1" --port 30000 --name "$1" --password "pass" --go &
|
||||||
|
}
|
||||||
|
|
||||||
|
start_headless_client() {
|
||||||
|
echo "Starting headless client $1"
|
||||||
|
xvfb-run $MT --address "127.0.0.1" --name $1 --password "pass" --go &
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
find_minetest
|
||||||
|
build_conf
|
||||||
|
|
||||||
|
start_server
|
||||||
|
|
||||||
|
start_headless_client student1
|
||||||
|
start_headless_client student2
|
||||||
|
start_headless_client student3
|
||||||
|
start_headless_client student4
|
||||||
|
start_headless_client student5
|
||||||
|
start_headless_client student6
|
||||||
|
|
||||||
|
start_client teacher1
|
||||||
|
|
||||||
|
|
||||||
|
read -n 1 -s -r -p "Press any key to continue"
|
||||||
|
|
||||||
|
killall minetest
|
Loading…
Reference in New Issue