fix: preflight Linux service manager
Signed Release / release (push) Failing after 23s

This commit is contained in:
Qiufeng
2026-08-04 08:28:15 +08:00
parent 1affcd9a5e
commit 6e22b24996
2 changed files with 25 additions and 1 deletions
+14
View File
@@ -456,6 +456,19 @@ test_installer_requires_explicit_gitea_url() (
[[ "$status" -ne 0 && "$output" == *'Gitea URL is required'* ]]
)
test_linux_service_preflight_requires_systemd() (
local tmp output status=0
tmp="$(mktemp -d "${TMPDIR:-/tmp}/erp-systemd-test.XXXXXX")" || return 1
trap 'rm -rf "$tmp"' EXIT
mkdir -p "$tmp/bin"
source "$PROJECT_ROOT/install.sh"
PLATFORM=linux
NO_SERVICE=0
output="$(PATH="$tmp/bin" validate_service_manager 2>&1)" || status=$?
[[ "$status" -ne 0 && "$output" == *'systemd'* ]] || return 1
NO_SERVICE=1 PATH="$tmp/bin" validate_service_manager
)
test_no_service_install_disables_online_update() (
local tmp
tmp="$(mktemp -d "${TMPDIR:-/tmp}/erp-no-service-test.XXXXXX")" || return 1
@@ -506,6 +519,7 @@ run_test 'update helper rolls back an unhealthy release end to end' test_update_
run_test 'update helper rejects a concurrent process' test_update_lock_rejects_concurrent_process
run_test 'installer moves database setup to the web wizard' test_installer_moves_database_setup_to_web_wizard
run_test 'installer requires an explicit Gitea URL' test_installer_requires_explicit_gitea_url
run_test 'Linux production install requires systemd' test_linux_service_preflight_requires_systemd
run_test 'no-service install disables online update' test_no_service_install_disables_online_update
run_test 'release workflow uses the scoped Gitea job token' test_release_workflow_uses_scoped_job_token
run_test 'installer starts correctly when piped to bash' test_installer_runs_when_piped_to_bash