diff --git a/.github/workflows/build-lxd.yml b/.github/workflows/build-lxd.yml index fe4bc0dbc..ffb1bda34 100644 --- a/.github/workflows/build-lxd.yml +++ b/.github/workflows/build-lxd.yml @@ -36,6 +36,7 @@ jobs: runner_label: ${{ steps.script.outputs.runner_label }} lxc_cmd: ${{ steps.script.outputs.lxc_cmd }} lxd_extra_profile: ${{ steps.script.outputs.lxd_extra_profile }} + ff_binary: ${{ steps.script.outputs.ff_binary }} steps: - name: script id: script @@ -45,9 +46,11 @@ jobs: LXC_CMD="incus" RUNNER_LABEL="ubuntu-26.04-arm64" echo "lxd_extra_profile=network" | tee -a "$GITHUB_OUTPUT" + echo "ff_binary=/usr/bin/firefox-esr" | tee -a "$GITHUB_OUTPUT" else LXC_CMD="incus" RUNNER_LABEL="ubuntu-latest" + echo "ff_binary=$(which firefox)" | tee -a "$GITHUB_OUTPUT" fi echo "runner_label=$RUNNER_LABEL" | tee -a $GITHUB_OUTPUT @@ -151,7 +154,8 @@ jobs: if: ${{ needs.determine-runner.outputs.runner_label != 'ubuntu-26.04-arm64' }} run: | sudo apt-get update - sudo apt-get install -y incus qemu-system incus-tools + sudo apt-get install -y incus qemu-system + sudo apt-get install -y incus-tools || sudo apt-get install -y incus-extra sudo iptables -I DOCKER-USER -i incusbr0 -j ACCEPT sudo iptables -I DOCKER-USER -o incusbr0 -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT sudo incus admin init --auto @@ -203,7 +207,8 @@ jobs: if: ${{ needs.determine-runner.outputs.runner_label != 'ubuntu-26.04-arm64' }} run: | sudo apt-get update - sudo apt-get install -y incus qemu-system incus-tools + sudo apt-get install -y incus qemu-system + sudo apt-get install -y incus-tools || sudo apt-get install -y incus-extra sudo iptables -I DOCKER-USER -i incusbr0 -j ACCEPT sudo iptables -I DOCKER-USER -o incusbr0 -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT sudo incus admin init --auto @@ -232,6 +237,7 @@ jobs: sudo mv geckodriver /usr/local/bin/ sudo chmod +x /usr/local/bin/geckodriver echo "GECKODRIVER_PATH=/usr/local/bin/geckodriver" >> "$GITHUB_ENV" + echo "FF_BINARY_PATH=${{ needs.determine-runner.outputs.ff_binary }}" >> "$GITHUB_ENV" geckodriver -V - name: Setup Selenium run: | @@ -269,8 +275,6 @@ jobs: working-directory: ./tests run: | set -x - export GECKODRIVER_PATH="$GECKODRIVER_PATH" - export FF_BINARY_PATH="$(which firefox)" python="$(dirname "$PWD")/.venv/bin/python" sudo "$LXC" exec ncp -- /usr/local/bin/ncc config:system:set overwrite.cli.url --value "https://nextcloudpi.local" sudo "$LXC" exec ncp -- bash -c 'tail -f /var/log/ncp.log' |& awk '{ print "NCP::" $0 }' & @@ -379,8 +383,6 @@ jobs: run: | set -x sudo "$LXC" exec ncp -- bash -c 'tail -f /var/log/ncp.log' |& awk '{ print "NCP::" $0 }' & - export GECKODRIVER_PATH="$GECKODRIVER_PATH" - export FF_BINARY_PATH="$(which firefox)" python="$(dirname "$PWD")/.venv/bin/python" USE_INCUS="$USE_INCUS" "$python" system_tests.py --skip-update-test --non-interactive || { @@ -424,7 +426,8 @@ jobs: if: ${{ needs.determine-runner.outputs.runner_label != 'ubuntu-26.04-arm64' }} run: | sudo apt-get update - sudo apt-get install -y incus qemu-system incus-tools + sudo apt-get install -y incus qemu-system + sudo apt-get install -y incus-tools || sudo apt-get install -y incus-extra sudo iptables -I DOCKER-USER -i incusbr0 -j ACCEPT sudo iptables -I DOCKER-USER -o incusbr0 -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT sudo incus admin init --auto @@ -457,6 +460,7 @@ jobs: sudo mv geckodriver /usr/local/bin/ sudo chmod +x /usr/local/bin/geckodriver echo "GECKODRIVER_PATH=/usr/local/bin/geckodriver" >> "$GITHUB_ENV" + echo "FF_BINARY_PATH=${{ needs.determine-runner.outputs.ff_binary }}" >> "$GITHUB_ENV" geckodriver -V - name: Setup Selenium run: | @@ -492,8 +496,6 @@ jobs: working-directory: ./tests run: | set -x - export GECKODRIVER_PATH="$GECKODRIVER_PATH" - export FF_BINARY_PATH="$(which firefox)" sudo "$LXC" exec ncp -- /usr/local/bin/ncc config:system:set overwrite.cli.url --value "https://nextcloudpi.local" sudo "$LXC" exec ncp -- bash -c 'tail -f /var/log/ncp.log' |& awk '{ print "NCP::" $0 }' & python="$(dirname "$PWD")/.venv/bin/python" @@ -601,8 +603,6 @@ jobs: run: | set -x sudo "$LXC" exec ncp -- bash -c 'tail -f /var/log/ncp.log' |& awk '{ print "NCP::" $0 }' & - export GECKODRIVER_PATH="$GECKODRIVER_PATH" - export FF_BINARY_PATH="$(which firefox)" python="$(dirname "$PWD")/.venv/bin/python" USE_INCUS="$USE_INCUS" "$python" system_tests.py --skip-update-test --non-interactive || { @@ -698,8 +698,6 @@ jobs: run: | set -x sudo "$LXC" exec ncp -- bash -c 'tail -f /var/log/ncp.log' |& awk '{ print "NCP::" $0 }' & - export GECKODRIVER_PATH="$GECKODRIVER_PATH" - export FF_BINARY_PATH="$(which firefox)" python="$(dirname "$PWD")/.venv/bin/python" USE_INCUS="$USE_INCUS" "$python" system_tests.py --skip-update-test --non-interactive || { @@ -748,7 +746,8 @@ jobs: if: ${{ needs.determine-runner.outputs.runner_label != 'ubuntu-26.04-arm64' }} run: | sudo apt-get update - sudo apt-get install -y incus qemu-system incus-tools + sudo apt-get install -y incus qemu-system + sudo apt-get install -y incus-tools || sudo apt-get install -y incus-extra sudo iptables -I DOCKER-USER -i incusbr0 -j ACCEPT sudo iptables -I DOCKER-USER -o incusbr0 -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT sudo incus admin init --auto @@ -777,6 +776,7 @@ jobs: sudo mv geckodriver /usr/local/bin/ sudo chmod +x /usr/local/bin/geckodriver echo "GECKODRIVER_PATH=/usr/local/bin/geckodriver" >> "$GITHUB_ENV" + echo "FF_BINARY_PATH=${{ needs.determine-runner.outputs.ff_binary }}" >> "$GITHUB_ENV" geckodriver -V - name: Setup Selenium run: | @@ -814,8 +814,6 @@ jobs: working-directory: ./tests run: | set -x - export GECKODRIVER_PATH="$GECKODRIVER_PATH" - export FF_BINARY_PATH="$(which firefox)" sudo "$LXC" exec ncp -- bash -c 'tail -f /var/log/ncp.log' |& awk '{ print "NCP::" $0 }' & sudo "$LXC" exec ncp -- bash -c 'ncc config:system:get overwrite.cli.url' python="$(dirname "$PWD")/.venv/bin/python" diff --git a/bin/ncp-dist-upgrade.d/debian-12.sh b/bin/ncp-dist-upgrade.d/debian-12.sh index 142674b24..ba42ab00e 100644 --- a/bin/ncp-dist-upgrade.d/debian-12.sh +++ b/bin/ncp-dist-upgrade.d/debian-12.sh @@ -22,15 +22,18 @@ echo "deb [signed-by=/usr/share/keyrings/debsuryorg-archive-keyring.gpg] https:/ apt-get update apt-get upgrade -y -for aptlist in /etc/apt/sources.list /etc/apt/sources.list.d/{php.list,armbian.list,raspi.list} +for aptlist in /etc/apt/sources.list /etc/apt/sources.list.d/{php.list,armbian.list,raspi.list,armbian-config.sources,armbian.sources,debian.sources} do [ -f "$aptlist" ] && sed -i -e "s/bookworm/trixie/g" "$aptlist" done -for aptlist in /etc/apt/sources.list.d/*.list +for aptlist in /etc/apt/sources.list.d/*.list /etc/apt/sources.list.d/*.sources do - [[ "$aptlist" =~ "/etc/apt/sources.list.d/"(php|armbian|raspi)".list" ]] || { + [[ "$aptlist" =~ "/etc/apt/sources.list.d/"(php|armbian|raspi)".list" ]] \ + || [[ "$aptlist" =~ "/etc/apt/sources.list.d/"(armbian-config|armbian|debian)".sources" ]] \ + || [[ "$aptlist" =~ "/etc/apt/sources.list.d/"("*.list"|"*.sources") ]] \ + || { echo "Disabling repositories from \"$aptlist\"" - sed -i -e "s/deb/#deb/g" "$aptlist" + sed -i -e "s/deb/#deb/g" "$aptlist" || continue; } done apt-get update diff --git a/tests/activation_tests.py b/tests/activation_tests.py index dde06f2d2..0f69bc78a 100755 --- a/tests/activation_tests.py +++ b/tests/activation_tests.py @@ -13,7 +13,6 @@ """ import sys -import time import traceback import urllib import os @@ -21,15 +20,15 @@ import configparser import signal from selenium import webdriver -from selenium.webdriver.common.keys import Keys from selenium.webdriver.common.by import By from selenium.webdriver.firefox.service import Service from selenium.webdriver.support import expected_conditions as EC from selenium.webdriver.support.ui import WebDriverWait -from selenium.webdriver.firefox.options import Options from selenium.common.exceptions import UnexpectedAlertPresentException from selenium.common.exceptions import NoSuchElementException from selenium.common.exceptions import TimeoutException +from tempfile import TemporaryDirectory, mkdtemp +from pathlib import Path suite_name = "activation tests" test_cfg = 'test_cfg.txt' @@ -175,7 +174,7 @@ def test_activation(IP, nc_port, admin_port, options, webdriver_exec_path=None, print(f"Setting geckodriver from env ({os.environ['GECKODRIVER_PATH']})") webdriver_exec_path = os.environ['GECKODRIVER_PATH'] if 'FF_BINARY_PATH' in os.environ: - print(f"Setting firefox binary from env ({os.environ['FF_BINARY_PATH']}") + print(f"Setting firefox binary from env ({os.environ['FF_BINARY_PATH']})") options.binary_location = os.environ['FF_BINARY_PATH'] for opt, arg in opts: if opt in ('-h', '--help'): diff --git a/updates/1.58.0.sh b/updates/1.58.0.sh index 43d3341a1..664943e33 100644 --- a/updates/1.58.0.sh +++ b/updates/1.58.0.sh @@ -2,6 +2,7 @@ set -euo pipefail +[[ -f /usr/local/etc/ncp.cfg ]] && export NCPCFG=/usr/local/etc/ncp.cfg source /usr/local/etc/library.sh # PHP-FPM systemd drop-in: allow write access to NCP paths blocked by ProtectSystem=full