File tree Expand file tree Collapse file tree 1 file changed +24
-2
lines changed Expand file tree Collapse file tree 1 file changed +24
-2
lines changed Original file line number Diff line number Diff line change @@ -29,7 +29,13 @@ NAME="$(basename -s .yaml "$FILE")"
29
29
INFO " Validating \" $FILE \" "
30
30
limactl validate " $FILE "
31
31
32
- declare -A CHECKS=([" systemd" ]=" 1" [" systemd-strict" ]=" 1" [" mount-home" ]=" 1" [" containerd-user" ]=" 1" )
32
+ declare -A CHECKS=(
33
+ [" systemd" ]=" 1"
34
+ [" systemd-strict" ]=" 1"
35
+ [" mount-home" ]=" 1"
36
+ [" containerd-user" ]=" 1"
37
+ [" restart" ]=" 1"
38
+ )
33
39
34
40
case " $NAME " in
35
41
" alpine" )
@@ -93,7 +99,7 @@ if [[ -n "${CHECKS["mount-home"]}" ]]; then
93
99
got=" $( limactl shell " $NAME " cat " $hometmp /random" ) "
94
100
INFO " $hometmp /random: expected=${expected} , got=${got} "
95
101
if [ " $got " != " $expected " ]; then
96
- ERROR" Home directory is not shared?"
102
+ ERROR " Home directory is not shared?"
97
103
exit 1
98
104
fi
99
105
fi
@@ -113,6 +119,22 @@ if [[ -n "${CHECKS["containerd-user"]}" ]]; then
113
119
set +x
114
120
fi
115
121
122
+ if [[ -n " ${CHECKS["restart"]} " ]]; then
123
+ INFO " Create file in the guest home directory and verify that it still exists after a restart"
124
+ limactl shell " $NAME " sh -c ' touch $HOME/sweet-home'
125
+
126
+ INFO " Stopping \" $NAME \" "
127
+ limactl stop " $NAME "
128
+
129
+ INFO " Restarting \" $NAME \" "
130
+ limactl start " $NAME "
131
+
132
+ if ! limactl shell " $NAME " sh -c ' test -f $HOME/sweet-home' ; then
133
+ ERROR " Guest home directory does not persist across restarts"
134
+ exit 1
135
+ fi
136
+ fi
137
+
116
138
INFO " Stopping \" $NAME \" "
117
139
limactl stop " $NAME "
118
140
You can’t perform that action at this time.
0 commit comments