diff --git a/.github/workflows/apt.yml b/.github/workflows/apt.yml index df82ce365..c0d2b94ed 100644 --- a/.github/workflows/apt.yml +++ b/.github/workflows/apt.yml @@ -229,9 +229,8 @@ jobs: - Ubuntu Jammy amd64 - Ubuntu Noble amd64 test: - - "update-from-v4.sh local" - - "update-from-v4.sh v5" - - "update-from-v4.sh lts" + - "update-from-v4.sh" + - "update-from-v4.sh via-v5" - "update-from-v5-lts.sh" - "downgrade-to-v4.sh" - "downgrade-to-v5-lts.sh" @@ -270,22 +269,18 @@ jobs: container-image: images:ubuntu/24.04 exclude: - label: Debian bookworm amd64 - test: update-from-v4.sh local + test: update-from-v4.sh - label: Debian bookworm amd64 - test: update-from-v4.sh v5 - - label: Debian bookworm amd64 - test: update-from-v4.sh lts + test: update-from-v4.sh via-v5 - label: Debian bookworm amd64 test: update-to-next-version-with-backward-compat-for-v4.sh - label: Debian bookworm amd64 test: downgrade-to-v4.sh # Temporary disable test for trixie (not released yet) - label: Debian trixie amd64 - test: update-from-v4.sh local - - label: Debian trixie amd64 - test: update-from-v4.sh v5 + test: update-from-v4.sh - label: Debian trixie amd64 - test: update-from-v4.sh lts + test: update-from-v4.sh via-v5 - label: Debian trixie amd64 test: update-from-v5-lts.sh - label: Debian trixie amd64 @@ -299,11 +294,9 @@ jobs: - label: Debian trixie amd64 test: update-to-next-version-with-backward-compat-for-v4.sh - label: Ubuntu Noble amd64 - test: update-from-v4.sh local - - label: Ubuntu Noble amd64 - test: update-from-v4.sh v5 + test: update-from-v4.sh - label: Ubuntu Noble amd64 - test: update-from-v4.sh lts + test: update-from-v4.sh via-v5 - label: Ubuntu Noble amd64 test: update-to-next-version-with-backward-compat-for-v4.sh - label: Ubuntu Noble amd64 diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 16bcf6829..1e2d7b133 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -62,6 +62,7 @@ jobs: test: - "install-test.ps1" - "update-from-v4-test.ps1" + - "update-from-v4-test.ps1 -ViaV5" - "update-from-v5-test.ps1" - "serverspec-test.ps1" steps: diff --git a/.github/workflows/yum.yml b/.github/workflows/yum.yml index 6ae710b5e..db5e7c9fd 100644 --- a/.github/workflows/yum.yml +++ b/.github/workflows/yum.yml @@ -285,6 +285,7 @@ jobs: - AmazonLinux 2023 x86_64 test: - "update-from-v4.sh" + - "update-from-v4.sh via-v5" - "update-from-v5-lts.sh" - "downgrade-to-v4.sh" - "downgrade-to-v5-lts.sh" @@ -321,6 +322,8 @@ jobs: exclude: - label: AmazonLinux 2023 x86_64 test: update-from-v4.sh + - label: AmazonLinux 2023 x86_64 + test: update-from-v4.sh via-v5 - label: AmazonLinux 2023 x86_64 test: update-to-next-version-with-backward-compat-for-v4.sh - label: AmazonLinux 2023 x86_64 diff --git a/fluent-package/apt/systemd-test/update-from-v4.sh b/fluent-package/apt/systemd-test/update-from-v4.sh index 00b47d47d..03d6d2994 100755 --- a/fluent-package/apt/systemd-test/update-from-v4.sh +++ b/fluent-package/apt/systemd-test/update-from-v4.sh @@ -4,6 +4,8 @@ set -exu . $(dirname $0)/../commonvar.sh +testcase=${1:-directly} + # Install v4 sudo apt install -y curl ca-certificates curl -fsSL https://toolbelt.treasuredata.com/sh/install-${distribution}-${code_name}-td-agent4.sh | sh @@ -25,22 +27,15 @@ done sudo systemctl stop td-agent # Install the current -case $1 in - local) - sudo apt install -V -y \ - /host/${distribution}/pool/${code_name}/${channel}/*/*/fluent-package_*_${architecture}.deb \ - /host/${distribution}/pool/${code_name}/${channel}/*/*/td-agent_*_all.deb 2>&1 | tee upgrade.log - # Test: needrestart was suppressed - test_suppressed_needrestart upgrade.log - ;; - v5) - curl --fail --silent --show-error --location https://toolbelt.treasuredata.com/sh/install-${distribution}-${code_name}-fluent-package5.sh | sh 2>&1 | tee upgrade.log - test_suppressed_needrestart upgrade.log - ;; - lts) +if [ "$testcase" = via-v5 ]; then curl --fail --silent --show-error --location https://toolbelt.treasuredata.com/sh/install-${distribution}-${code_name}-fluent-package5-lts.sh | sh - ;; -esac +fi +sudo apt install -V -y \ + /host/${distribution}/pool/${code_name}/${channel}/*/*/fluent-package_*_${architecture}.deb \ + /host/${distribution}/pool/${code_name}/${channel}/*/*/td-agent_*_all.deb 2>&1 | tee upgrade.log + +# Test: needrestart was suppressed +test_suppressed_needrestart upgrade.log # Test: service status systemctl status --no-pager fluentd diff --git a/fluent-package/msi/update-from-v4-test.ps1 b/fluent-package/msi/update-from-v4-test.ps1 index 1fa41ef4f..7b58cd640 100644 --- a/fluent-package/msi/update-from-v4-test.ps1 +++ b/fluent-package/msi/update-from-v4-test.ps1 @@ -1,3 +1,7 @@ +Param( + [switch] $ViaV5 = $false +) + $ErrorActionPreference = 'Stop' $ProgressPreference = 'SilentlyContinue' Set-PSDebug -Trace 1 @@ -24,7 +28,11 @@ Add-Content -Path "C:\\opt\\td-agent\\etc\\td-agent\\td-agent.conf" -Encoding UT Restart-Service fluentdwinsvc Start-Sleep 30 # Must wait until all processes are surely started. -# Update to v5 +# Update to current +if ($ViaV5) { + Invoke-WebRequest "https://s3.amazonaws.com/packages.treasuredata.com/lts/5/windows/fluent-package-5.0.7-x64.msi" -OutFile "fluent-package-5.0.7-x64.msi" + Start-Process msiexec -ArgumentList "/i", "fluent-package-5.0.7-x64.msi", "/quiet" -Wait -NoNewWindow +} $new_package = ((Get-Item "C:\\fluentd\\fluent-package\\msi\\repositories\\fluent-package-*.msi") | Sort-Object -Descending { $_.LastWriteTime } | Select-Object -First 1).FullName Start-Process msiexec -ArgumentList "/i", $new_package, "/quiet" -Wait -NoNewWindow Start-Service fluentdwinsvc diff --git a/fluent-package/yum/systemd-test/update-from-v4.sh b/fluent-package/yum/systemd-test/update-from-v4.sh index 8b24053bb..c1a710eb7 100755 --- a/fluent-package/yum/systemd-test/update-from-v4.sh +++ b/fluent-package/yum/systemd-test/update-from-v4.sh @@ -4,6 +4,8 @@ set -exu . $(dirname $0)/common.sh +testcase=${1:-directly} + install_v4 sudo systemctl enable --now td-agent systemctl status --no-pager td-agent @@ -17,7 +19,12 @@ for d in $(seq 1 10); do sudo touch /var/log/td-agent/$d.log done +# Install current +if [ "$testcase" = via-v5 ]; then + install_v5_lts +fi install_current +sleep 3 # Test: take over enabled state systemctl is-enabled fluentd