vm flag and wip vsh rework

Signed-off-by: Ava Hahn <a.hahn@f5.com>
This commit is contained in:
Ava Hahn 2025-01-21 14:25:05 -08:00
parent 8c91778fe1
commit b47476bd69
5 changed files with 266 additions and 195 deletions

36
util.sh Normal file
View file

@ -0,0 +1,36 @@
#!/bin/bash
dirn=$(dirname "$0")
source $dirn/common.sh
source $dirn/virt.sh
source $dirn/nginx.sh
# this file exists to provide logic that requires functionality from one or
# more modules in the rest of the code. It can be sourced directly.
function vsh() {
if ! turn_on_vm_and_wait $1; then
exit 1
fi
sshpass -p $PASSP \
ssh -o PreferredAuthentications=password \
-o StrictHostKeyChecking=no \
$USERN@$(get_vm_ip $1) \
"cat > /tmp/u.sh <<EOF
$(typeset WHT)
$(typeset END)
$(typeset -f log)
$(typeset -f num_jobs)
$(typeset -f build_nginx)
$(typeset -f build_otel)
$(typeset -f test_nginx)
$(typeset -f test_otel)
$(typeset -f clean_nginx)
$(typeset -f clean_otel)
EOF
bash"
turn_off_vm $1
}