Skip to content

Commit ebce248

Browse files
committed
ci: add tests for update/downgrade via v5
Signed-off-by: Daijiro Fukuda <[email protected]>
1 parent 90ab323 commit ebce248

File tree

8 files changed

+57
-31
lines changed

8 files changed

+57
-31
lines changed

.github/workflows/apt.yml

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -229,11 +229,11 @@ 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"
236+
- "downgrade-to-v4.sh from-current-updated-via-v5"
237237
- "downgrade-to-v5-lts.sh"
238238
- "install-newly.sh local"
239239
- "install-newly.sh v5"
@@ -270,26 +270,26 @@ jobs:
270270
container-image: images:ubuntu/24.04
271271
exclude:
272272
- label: Debian bookworm amd64
273-
test: update-from-v4.sh local
273+
test: update-from-v4.sh
274274
- label: Debian bookworm amd64
275-
test: update-from-v4.sh v5
276-
- label: Debian bookworm amd64
277-
test: update-from-v4.sh lts
275+
test: update-from-v4.sh via-v5
278276
- label: Debian bookworm amd64
279277
test: update-to-next-version-with-backward-compat-for-v4.sh
280278
- label: Debian bookworm amd64
281279
test: downgrade-to-v4.sh
280+
- label: Debian bookworm amd64
281+
test: downgrade-to-v4.sh from-current-updated-via-v5
282282
# Temporary disable test for trixie (not released yet)
283283
- label: Debian trixie amd64
284-
test: update-from-v4.sh local
285-
- label: Debian trixie amd64
286-
test: update-from-v4.sh v5
284+
test: update-from-v4.sh
287285
- label: Debian trixie amd64
288-
test: update-from-v4.sh lts
286+
test: update-from-v4.sh via-v5
289287
- label: Debian trixie amd64
290288
test: update-from-v5-lts.sh
291289
- label: Debian trixie amd64
292290
test: downgrade-to-v4.sh
291+
- label: Debian trixie amd64
292+
test: downgrade-to-v4.sh from-current-updated-via-v5
293293
- label: Debian trixie amd64
294294
test: downgrade-to-v5-lts.sh
295295
- label: Debian trixie amd64
@@ -299,15 +299,15 @@ jobs:
299299
- label: Debian trixie amd64
300300
test: update-to-next-version-with-backward-compat-for-v4.sh
301301
- label: Ubuntu Noble amd64
302-
test: update-from-v4.sh local
303-
- label: Ubuntu Noble amd64
304-
test: update-from-v4.sh v5
302+
test: update-from-v4.sh
305303
- label: Ubuntu Noble amd64
306-
test: update-from-v4.sh lts
304+
test: update-from-v4.sh via-v5
307305
- label: Ubuntu Noble amd64
308306
test: update-to-next-version-with-backward-compat-for-v4.sh
309307
- label: Ubuntu Noble amd64
310308
test: downgrade-to-v4.sh
309+
- label: Ubuntu Noble amd64
310+
test: downgrade-to-v4.sh from-current-updated-via-v5
311311
steps:
312312
- uses: actions/checkout@v4
313313
- uses: actions/download-artifact@v4

.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: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,8 +285,10 @@ 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"
291+
- "downgrade-to-v4.sh from-current-updated-via-v5"
290292
- "downgrade-to-v5-lts.sh"
291293
- "install-newly.sh local"
292294
- "install-newly.sh v5"
@@ -321,10 +323,14 @@ jobs:
321323
exclude:
322324
- label: AmazonLinux 2023 x86_64
323325
test: update-from-v4.sh
326+
- label: AmazonLinux 2023 x86_64
327+
test: update-from-v4.sh via-v5
324328
- label: AmazonLinux 2023 x86_64
325329
test: update-to-next-version-with-backward-compat-for-v4.sh
326330
- label: AmazonLinux 2023 x86_64
327331
test: downgrade-to-v4.sh
332+
- label: AmazonLinux 2023 x86_64
333+
test: downgrade-to-v4.sh from-current-updated-via-v5
328334
steps:
329335
- uses: actions/checkout@v4
330336
- uses: actions/download-artifact@v4

fluent-package/apt/systemd-test/downgrade-to-v4.sh

Lines changed: 5 additions & 0 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:-from-current-updated-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
@@ -16,6 +18,9 @@ systemctl status --no-pager td-agent
1618
#sudo apt purge -y fluent-lts-apt-source
1719

1820
# Ensure to install the current
21+
if [ "$testcase" = from-current-updated-via-v5 ]; then
22+
curl --fail --silent --show-error --location https://toolbelt.treasuredata.com/sh/install-${distribution}-${code_name}-fluent-package5-lts.sh | sh
23+
fi
1924
sudo apt install -V -y \
2025
/host/${distribution}/pool/${code_name}/${channel}/*/*/fluent-package_*_${architecture}.deb \
2126
/host/${distribution}/pool/${code_name}/${channel}/*/*/td-agent_*_all.deb

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/downgrade-to-v4.sh

Lines changed: 5 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:-from-current-updated-directly}
8+
79
install_v4
810

911
# Not auto started
@@ -14,6 +16,9 @@ sudo systemctl enable --now td-agent
1416
sudo systemctl stop td-agent
1517

1618
# Install the current
19+
if [ "$testcase" = from-current-updated-via-v5 ]; then
20+
install_v5_lts
21+
fi
1722
install_current
1823
sudo systemctl daemon-reload
1924
sudo systemctl enable --now fluentd

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

Lines changed: 6 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,6 +19,10 @@ 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
2127

2228
# Test: take over enabled state

0 commit comments

Comments
 (0)