@@ -16,6 +16,11 @@ NAME="$(basename -s .yaml "$FILE")"
16
16
INFO " Validating \" $FILE \" "
17
17
limactl validate " $FILE "
18
18
19
+ # --cpus=1 is needed for running vz on GHA: https://github.com/lima-vm/lima/pull/1511#issuecomment-1574937888
20
+ LIMACTL_CREATE_SET=' .cpus = 1 | .memory="1GiB"'
21
+ # TODO: add "limactl create" command
22
+ LIMACTL_CREATE_AND_START=(limactl start --tty=false --set=" ${LIMACTL_CREATE_SET} " )
23
+
19
24
declare -A CHECKS=(
20
25
[" systemd" ]=" 1"
21
26
[" systemd-strict" ]=" 1"
@@ -60,6 +65,12 @@ case "$NAME" in
60
65
CHECKS[" snapshot-online" ]=" "
61
66
CHECKS[" user-v2" ]=1
62
67
;;
68
+ " vz" )
69
+ CHECKS[" systemd-strict" ]=
70
+ CHECKS[" port-forwards" ]=" "
71
+ CHECKS[" snapshot-online" ]=" "
72
+ CHECKS[" snapshot-offline" ]=" "
73
+ ;;
63
74
esac
64
75
65
76
if limactl ls -q | grep -q " $NAME " ; then
@@ -83,8 +94,8 @@ function diagnose() {
83
94
NAME=" $1 "
84
95
set -x +e
85
96
tail " $HOME /.lima/${NAME} " /* .log
86
- limactl shell " $NAME " systemctl status
87
- limactl shell " $NAME " systemctl
97
+ limactl shell " $NAME " systemctl --no-pager status
98
+ limactl shell " $NAME " systemctl --no-pager
88
99
limactl shell " $NAME " sudo cat /var/log/cloud-init-output.log
89
100
set +x -e
90
101
}
@@ -102,7 +113,7 @@ if [[ -n ${CHECKS["disk"]} ]]; then
102
113
fi
103
114
104
115
set -x
105
- if ! limactl start --tty=false " $FILE " ; then
116
+ if ! " ${LIMACTL_CREATE_AND_START[@]} " " $FILE " ; then
106
117
ERROR " Failed to start \" $NAME \" "
107
118
diagnose " $NAME "
108
119
exit 1
317
328
if [[ -n ${CHECKS["user-v2"]} ]]; then
318
329
INFO " Testing user-v2 network"
319
330
secondvm=" $NAME -1"
320
- limactl start " $FILE " --name " $secondvm " --tty=false
331
+ " ${LIMACTL_CREATE_AND_START[@]} " " $FILE " --name " $secondvm "
321
332
guestNewip=" $( limactl shell " $secondvm " ip -4 -j addr show dev eth0 | jq -r ' .[0].addr_info[0].local' ) "
322
333
INFO " IP of $secondvm is $guestNewip "
323
334
set -x
0 commit comments