Path: blob/master/hack/test-nonplain-static-port-forward.sh
1637 views
#!/usr/bin/env bash12# SPDX-FileCopyrightText: Copyright The Lima Authors3# SPDX-License-Identifier: Apache-2.045set -euxo pipefail67INSTANCE=nonplain-static-port-forward8TEMPLATE=hack/test-templates/static-port-forward.yaml910limactl delete -f $INSTANCE || true1112limactl start --name=$INSTANCE --tty=false $TEMPLATE1314limactl shell $INSTANCE -- bash -c 'until [ -e /run/nginx.pid ]; do sleep 1; done'15limactl shell $INSTANCE -- bash -c 'until systemctl is-active --quiet test-server-9080; do sleep 1; done'16limactl shell $INSTANCE -- bash -c 'until systemctl is-active --quiet test-server-9070; do sleep 1; done'1718curl -sSf http://127.0.0.1:9090 | grep -i 'nginx' && echo 'Static port forwarding (9090) works in normal mode!'19curl -sSf http://127.0.0.1:9080 | grep -i 'Dynamic port 9080' && echo 'Dynamic port forwarding (9080) works in normal mode!'20curl -sSf http://127.0.0.1:9070 | grep -i 'Dynamic port 9070' && echo 'Dynamic port forwarding (9070) works in normal mode!'2122limactl delete -f $INSTANCE23echo "All tests passed for normal mode - both static and dynamic ports work!"24# EOF252627