@@ -211,6 +211,32 @@ jobs:
211211 ip="$(lxc list -c n4 -f csv | grep '^ncp' | cut -d ',' -f2)"
212212 ip="${ip/% *}"
213213 echo "${ip} nextcloudpi.local" | sudo tee /etc/hosts
214+ - name : Activate and Test LXD Image
215+ working-directory : ./tests
216+ run : |
217+ lxc exec ncp -- bash -c 'tail -f /var/log/ncp.log' |& awk '{ print "NCP::" $0 }' &
218+ python activation_tests.py --no-gui "nextcloudpi.local" 443 4443 || {
219+ echo "Activation test failed!"
220+ echo "Geckodriver logs:"
221+ tail -n 20 geckodriver.log >&2 || true
222+ echo "================"
223+ echo "ncp.log: "
224+ lxc exec ncp -- "tail -n20 /var/log/ncp.log"
225+ exit 1
226+ }
227+ python system_tests.py --non-interactive || {
228+ echo "System test failed!"
229+ exit 1
230+ }
231+ python nextcloud_tests.py --no-gui "nextcloudpi.local" 443 4443 || {
232+ echo "Nextcloud test failed!"
233+ echo "Geckodriver logs:"
234+ tail -n 20 geckodriver.log >&2 || true
235+ echo "================"
236+ echo "ncp.log: "
237+ lxc exec ncp -- "tail -n20 /var/log/ncp.log"
238+ exit 1
239+ }
214240
215241 - name : Update ncp
216242 run : |
@@ -230,6 +256,7 @@ jobs:
230256 latest_nc_version="$(cat etc/ncp.cfg | jq -r '.nextcloud_version')"
231257
232258 lxc exec ncp -- bash -c "DBG=x ncp-update ${UPDATE_ARGS[*]}"
259+ sleep 30
233260 lxc exec ncp -- /usr/local/bin/ncc status
234261
235262 if [[ "$current_nc_version" =~ "$latest_nc_version".* ]]
@@ -240,14 +267,12 @@ jobs:
240267 fi
241268
242269 lxc stop ncp
243- lxc publish -q ncp -f --alias "ncp/updated"
244270 - name : Relaunch container
245271 run : |
246272 set -x
247- lxc delete -q -f ncp || true
248- systemd-run --user --scope -p "Delegate=yes" lxc launch -q "ncp/updated" ncp
273+ systemd-run --user --scope -p "Delegate=yes" lxc start ncp
249274 lxc exec ncp -- bash -c 'while [ "$(systemctl is-system-running 2>/dev/null)" != "running" ] && [ "$(systemctl is-system-running 2>/dev/null)" != "degraded" ]; do :; done'
250- sleep 30
275+ sleep 60
251276 ip="$(lxc list -c n4 -f csv | grep '^ncp' | cut -d ',' -f2)"
252277 ip="${ip/% *}"
253278 echo "${ip} nextcloudpi.local" | sudo tee /etc/hosts
@@ -257,6 +282,8 @@ jobs:
257282 lxc exec ncp -- bash -c 'tail -f /var/log/ncp.log' |& awk '{ print "NCP::" $0 }' &
258283 python system_tests.py --non-interactive || {
259284 echo "System test failed!"
285+ lxc exec ncp -- ncc status
286+ lxc exec ncp -- ncc notify_push:self-test
260287 exit 1
261288 }
262289 python nextcloud_tests.py --no-gui "nextcloudpi.local" 443 4443 || {
0 commit comments