Skip to content

Commit d3accff

Browse files
committed
vm-tests.yml: Fix distupgrade tests
Signed-off-by: Tobias Knöppler <[email protected]>
1 parent 325834f commit d3accff

File tree

5 files changed

+46
-8
lines changed

5 files changed

+46
-8
lines changed

.github/actions/create-test-instance-bullseye/action.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ inputs:
1313
server_type:
1414
description: Server type to use for hetzner servers
1515
required: true
16-
default: "cx11"
16+
default: "cx22"
1717

1818
outputs:
1919
server_address:

.github/actions/create-test-instance/action.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ inputs:
1313
server_type:
1414
description: Server type to use for hetzner servers
1515
required: true
16-
default: "cx11"
16+
default: "cx22"
1717

1818
outputs:
1919
server_address:

.github/workflows/build-lxd.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -545,7 +545,7 @@ jobs:
545545
then
546546
break
547547
fi
548-
if [[ "$current_nc_version" == "$current_nc_version_new" ]]
548+
if [[ "$current_nc_version_new" == "$current_nc_version_new" ]]
549549
then
550550
echo "failed to update to $latest_nc_version"
551551
exit 1

.github/workflows/vm-tests.yml

+43-4
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ jobs:
6464
version: ${{ env.VERSION }}
6565
uid: "${{ env.UID }}"
6666
hcloud_token: ${{ secrets.TEST_AUTOMATION_HCLOUD_API_TOKEN }}
67-
server_type: "cx11"
67+
server_type: "cx22"
6868
- name: set instance variables
6969
run: |
7070
echo "SERVER_ADDRESS=${{ steps.create-test-instance.outputs.server_address }}" >> "$GITHUB_ENV"
@@ -314,7 +314,7 @@ jobs:
314314
version: "${{ env.PREVIOUS_VERSION }}"
315315
uid: "${{ env.UID }}"
316316
hcloud_token: ${{ secrets.TEST_AUTOMATION_HCLOUD_API_TOKEN }}
317-
server_type: "cx11"
317+
server_type: "cx22"
318318
- name: Set instance variables
319319
run: |
320320
echo "SERVER_ADDRESS=${{ steps.create-test-instance.outputs.server_address }}" >> "$GITHUB_ENV"
@@ -341,7 +341,7 @@ jobs:
341341
342342
echo "Run integration tests"
343343
ssh -o "StrictHostKeyChecking=no" -o "UserKnownHostsFile=/dev/null" "root@${SERVER_ADDRESS}" cat /usr/local/etc/instance.cfg
344-
test-ncp-instance -a -f "$SNAPSHOT_ID" -b "${VERSION}" --systemtest-args "--skip-update-test" --nc-test-args "--skip-release-check" "root@${SERVER_ADDRESS}" "localhost" "8443" "9443" || {
344+
test-ncp-instance -a -f "$SNAPSHOT_ID" -b "v1.54.3" --systemtest-args "--skip-update-test" --nc-test-args "--skip-release-check" "root@${SERVER_ADDRESS}" "localhost" "8443" "9443" || {
345345
346346
echo "Integration tests failed"
347347
echo "Here are the last lines of ncp-install.log:"
@@ -387,7 +387,7 @@ jobs:
387387
NC_TEST_ARGS=()
388388
ssh "${SSH_OPTIONS[@]}" "root@${SERVER_ADDRESS}" cat /etc/os-release | grep VERSION_ID=12 || NC_TEST_ARGS+=("--skip-release-check")
389389
set -x
390-
test-ncp-instance -f "$SNAPSHOT_ID" -b "${VERSION}" --nc-test-args "$NC_TEST_ARGS" --systemtest-args "--skip-update-test" "root@${SERVER_ADDRESS}" "localhost" "8443" "9443" || {
390+
test-ncp-instance -f "$SNAPSHOT_ID" -b "v1.54.3" --nc-test-args "$NC_TEST_ARGS" --systemtest-args "--skip-update-test" "root@${SERVER_ADDRESS}" "localhost" "8443" "9443" || {
391391
392392
echo "Integration tests failed"
393393
echo "Here are the last lines of ncp-install.log:"
@@ -420,6 +420,45 @@ jobs:
420420
}
421421
ssh "${SSH_OPTIONS[@]}" "root@${SERVER_ADDRESS}" DEBIAN_FRONTEND=noninteractive ncp-dist-upgrade
422422
echo "skipped=no" | tee -a $GITHUB_OUTPUT
423+
- name: Update Nextcloud
424+
working-directory: /__w/nextcloudpi/nextcloudpi/ncp-test-automation/bin
425+
run: |
426+
set -ex
427+
apk add jq
428+
429+
echo "Setup ssh"
430+
eval "$(ssh-agent)"
431+
ssh-add /__w/nextcloudpi/nextcloudpi/.ssh/automation_ssh_key
432+
433+
source ./library.sh
434+
435+
current_nc_version="$(ssh "${SSH_OPTIONS[@]}" "root@${SERVER_ADDRESS}" "ncc status" | grep "version:" | awk '{ print $3 }')"
436+
latest_nc_version="$(cat ../../etc/ncp.cfg | jq -r '.nextcloud_version')"
437+
438+
if [[ "$current_nc_version" =~ "$latest_nc_version".* ]]
439+
then
440+
echo "Nextcloud is up to date - skipping NC update test."
441+
else
442+
for i in {1..10};
443+
do
444+
echo "running nc update ($i/10)..."
445+
ssh "${SSH_OPTIONS[@]}" "root@${SERVER_ADDRESS}" bash -c "DBG=x ncp-update-nc ${latest_nc_version?}"
446+
447+
ssh "${SSH_OPTIONS[@]}" "root@${SERVER_ADDRESS}" /usr/local/bin/ncc status
448+
449+
current_nc_version_new="$(ssh "${SSH_OPTIONS[@]}" "root@${SERVER_ADDRESS}" "ncc status" | grep "version:" | awk '{ print $3 }')"
450+
if [[ "$current_nc_version_new" =~ "$latest_nc_version".* ]]
451+
then
452+
break
453+
fi
454+
if [[ "$current_nc_version" == "$current_nc_version_new" ]]
455+
then
456+
echo "failed to update to $latest_nc_version"
457+
exit 1
458+
fi
459+
current_nc_version="$current_nc_version_new"
460+
done
461+
fi
423462
424463
- name: Run integration tests after dist-upgrade
425464
id: final_test

ncp-app/lib/Service/SettingsService.php

-1
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,6 @@ private function runCommand(string $cmd): array {
139139
$stderr = stream_get_contents($pipes[2]);
140140
fclose($pipes[2]);
141141

142-
$this->logger->error("STDERR: $stderr");
143142
return [proc_close($proc), $stdout, $stderr];
144143
}
145144
}

0 commit comments

Comments
 (0)