blob: 8d553162b625988fadc5a5dce9b150e828e158af [file] [log] [blame]
Vasyl Saienko775c1da2023-07-13 11:34:25 +00001EXAMPLES_DIR=$(cd $(dirname "$0")/.. && pwd)
2WORKDIR=$(cd $(dirname "$0") && pwd)
3source ${EXAMPLES_DIR}/lib.sh
4
5command=$1
6
7function run {
8 echo "Creating network attachments"
9 kubectl apply -f network-attachment.yaml
10
11 echo "Creating VMs"
12 for vm in cirros-net1 cirros-net2; do
13 kubectl apply -f $vm.yaml
14
15 echo "Starting VM $vm"
16 virtctl start $vm
17 done
18 echo "Waiting VM is Running."
19 wait_vm_state cirros-net1 Running
20 wait_vm_state cirros-net2 Running
21}
22
23function cleanup {
24 for f in $(ls *.yaml); do
25 kubectl delete -f $f
26 done
27}
28
29pushd $WORKDIR
30$command
31popd