Skip to content

Commit 56ab642

Browse files
committed
ci: add tests for update via v5
Signed-off-by: Daijiro Fukuda <fukuda@clear-code.com>
1 parent 90ab323 commit 56ab642

File tree

6 files changed

+38
-31
lines changed

6 files changed

+38
-31
lines changed

.github/workflows/apt.yml

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -229,9 +229,8 @@ jobs:
229229
- Ubuntu Jammy amd64
230230
- Ubuntu Noble amd64
231231
test:
232-
- "update-from-v4.sh local"
233-
- "update-from-v4.sh v5"
234-
- "update-from-v4.sh lts"
232+
- "update-from-v4.sh"
233+
- "update-from-v4.sh via-v5"
235234
- "update-from-v5-lts.sh"
236235
- "downgrade-to-v4.sh"
237236
- "downgrade-to-v5-lts.sh"
@@ -270,22 +269,18 @@ jobs:
270269
container-image: images:ubuntu/24.04
271270
exclude:
272271
- label: Debian bookworm amd64
273-
test: update-from-v4.sh local
272+
test: update-from-v4.sh
274273
- label: Debian bookworm amd64
275-
test: update-from-v4.sh v5
276-
- label: Debian bookworm amd64
277-
test: update-from-v4.sh lts
274+
test: update-from-v4.sh via-v5
278275
- label: Debian bookworm amd64
279276
test: update-to-next-version-with-backward-compat-for-v4.sh
280277
- label: Debian bookworm amd64
281278
test: downgrade-to-v4.sh
282279
# Temporary disable test for trixie (not released yet)
283280
- label: Debian trixie amd64
284-
test: update-from-v4.sh local
285-
- label: Debian trixie amd64
286-
test: update-from-v4.sh v5
281+
test: update-from-v4.sh
287282
- label: Debian trixie amd64
288-
test: update-from-v4.sh lts
283+
test: update-from-v4.sh via-v5
289284
- label: Debian trixie amd64
290285
test: update-from-v5-lts.sh
291286
- label: Debian trixie amd64
@@ -299,11 +294,9 @@ jobs:
299294
- label: Debian trixie amd64
300295
test: update-to-next-version-with-backward-compat-for-v4.sh
301296
- label: Ubuntu Noble amd64
302-
test: update-from-v4.sh local
303-
- label: Ubuntu Noble amd64
304-
test: update-from-v4.sh v5
297+
test: update-from-v4.sh
305298
- label: Ubuntu Noble amd64
306-
test: update-from-v4.sh lts
299+
test: update-from-v4.sh via-v5
307300
- label: Ubuntu Noble amd64
308301
test: update-to-next-version-with-backward-compat-for-v4.sh
309302
- label: Ubuntu Noble amd64

.github/workflows/windows.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ jobs:
6262
test:
6363
- "install-test.ps1"
6464
- "update-from-v4-test.ps1"
65+
- "update-from-v4-test.ps1 -ViaV5"
6566
- "update-from-v5-test.ps1"
6667
- "serverspec-test.ps1"
6768
steps:

.github/workflows/yum.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,7 @@ jobs:
285285
- AmazonLinux 2023 x86_64
286286
test:
287287
- "update-from-v4.sh"
288+
- "update-from-v4.sh via-v5"
288289
- "update-from-v5-lts.sh"
289290
- "downgrade-to-v4.sh"
290291
- "downgrade-to-v5-lts.sh"
@@ -321,6 +322,8 @@ jobs:
321322
exclude:
322323
- label: AmazonLinux 2023 x86_64
323324
test: update-from-v4.sh
325+
- label: AmazonLinux 2023 x86_64
326+
test: update-from-v4.sh via-v5
324327
- label: AmazonLinux 2023 x86_64
325328
test: update-to-next-version-with-backward-compat-for-v4.sh
326329
- label: AmazonLinux 2023 x86_64

fluent-package/apt/systemd-test/update-from-v4.sh

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ set -exu
44

55
. $(dirname $0)/../commonvar.sh
66

7+
testcase=${1:-directly}
8+
79
# Install v4
810
sudo apt install -y curl ca-certificates
911
curl -fsSL https://toolbelt.treasuredata.com/sh/install-${distribution}-${code_name}-td-agent4.sh | sh
@@ -25,22 +27,15 @@ done
2527
sudo systemctl stop td-agent
2628

2729
# Install the current
28-
case $1 in
29-
local)
30-
sudo apt install -V -y \
31-
/host/${distribution}/pool/${code_name}/${channel}/*/*/fluent-package_*_${architecture}.deb \
32-
/host/${distribution}/pool/${code_name}/${channel}/*/*/td-agent_*_all.deb 2>&1 | tee upgrade.log
33-
# Test: needrestart was suppressed
34-
test_suppressed_needrestart upgrade.log
35-
;;
36-
v5)
37-
curl --fail --silent --show-error --location https://toolbelt.treasuredata.com/sh/install-${distribution}-${code_name}-fluent-package5.sh | sh 2>&1 | tee upgrade.log
38-
test_suppressed_needrestart upgrade.log
39-
;;
40-
lts)
30+
if [ "$testcase" = via-v5 ]; then
4131
curl --fail --silent --show-error --location https://toolbelt.treasuredata.com/sh/install-${distribution}-${code_name}-fluent-package5-lts.sh | sh
42-
;;
43-
esac
32+
fi
33+
sudo apt install -V -y \
34+
/host/${distribution}/pool/${code_name}/${channel}/*/*/fluent-package_*_${architecture}.deb \
35+
/host/${distribution}/pool/${code_name}/${channel}/*/*/td-agent_*_all.deb 2>&1 | tee upgrade.log
36+
37+
# Test: needrestart was suppressed
38+
test_suppressed_needrestart upgrade.log
4439

4540
# Test: service status
4641
systemctl status --no-pager fluentd

fluent-package/msi/update-from-v4-test.ps1

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
Param(
2+
[switch] $ViaV5 = $false
3+
)
4+
15
$ErrorActionPreference = 'Stop'
26
$ProgressPreference = 'SilentlyContinue'
37
Set-PSDebug -Trace 1
@@ -24,7 +28,11 @@ Add-Content -Path "C:\\opt\\td-agent\\etc\\td-agent\\td-agent.conf" -Encoding UT
2428
Restart-Service fluentdwinsvc
2529
Start-Sleep 30 # Must wait until all processes are surely started.
2630

27-
# Update to v5
31+
# Update to current
32+
if ($ViaV5) {
33+
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"
34+
Start-Process msiexec -ArgumentList "/i", "fluent-package-5.0.7-x64.msi", "/quiet" -Wait -NoNewWindow
35+
}
2836
$new_package = ((Get-Item "C:\\fluentd\\fluent-package\\msi\\repositories\\fluent-package-*.msi") | Sort-Object -Descending { $_.LastWriteTime } | Select-Object -First 1).FullName
2937
Start-Process msiexec -ArgumentList "/i", $new_package, "/quiet" -Wait -NoNewWindow
3038
Start-Service fluentdwinsvc

fluent-package/yum/systemd-test/update-from-v4.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ set -exu
44

55
. $(dirname $0)/common.sh
66

7+
testcase=${1:-directly}
8+
79
install_v4
810
sudo systemctl enable --now td-agent
911
systemctl status --no-pager td-agent
@@ -17,7 +19,12 @@ for d in $(seq 1 10); do
1719
sudo touch /var/log/td-agent/$d.log
1820
done
1921

22+
# Install current
23+
if [ "$testcase" = via-v5 ]; then
24+
install_v5_lts
25+
fi
2026
install_current
27+
sleep 3
2128

2229
# Test: take over enabled state
2330
systemctl is-enabled fluentd

0 commit comments

Comments
 (0)