Skip to content

Commit eb1c31c

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

File tree

8 files changed

+49
-31
lines changed

8 files changed

+49
-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
@@ -280,8 +280,10 @@ jobs:
280280
- AmazonLinux 2023 x86_64
281281
test:
282282
- "update-from-v4.sh"
283+
- "update-from-v4.sh via-v5"
283284
- "update-from-v5-lts.sh"
284285
- "downgrade-to-v4.sh"
286+
- "downgrade-to-v4.sh from-current-updated-via-v5"
285287
- "downgrade-to-v5-lts.sh"
286288
- "install-newly.sh local"
287289
- "install-newly.sh v5"
@@ -316,10 +318,14 @@ jobs:
316318
exclude:
317319
- label: AmazonLinux 2023 x86_64
318320
test: update-from-v4.sh
321+
- label: AmazonLinux 2023 x86_64
322+
test: update-from-v4.sh via-v5
319323
- label: AmazonLinux 2023 x86_64
320324
test: update-to-next-version-with-backward-compat-for-v4.sh
321325
- label: AmazonLinux 2023 x86_64
322326
test: downgrade-to-v4.sh
327+
- label: AmazonLinux 2023 x86_64
328+
test: downgrade-to-v4.sh from-current-updated-via-v5
323329
steps:
324330
- uses: actions/checkout@v4
325331
- uses: actions/download-artifact@v4

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ systemctl status --no-pager td-agent
1616
#sudo apt purge -y fluent-lts-apt-source
1717

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

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

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -25,22 +25,15 @@ done
2525
sudo systemctl stop td-agent
2626

2727
# 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)
28+
if [ "$1" = via-v5 ]; then
4129
curl --fail --silent --show-error --location https://toolbelt.treasuredata.com/sh/install-${distribution}-${code_name}-fluent-package5-lts.sh | sh
42-
;;
43-
esac
30+
fi
31+
sudo apt install -V -y \
32+
/host/${distribution}/pool/${code_name}/${channel}/*/*/fluent-package_*_${architecture}.deb \
33+
/host/${distribution}/pool/${code_name}/${channel}/*/*/td-agent_*_all.deb 2>&1 | tee upgrade.log
34+
35+
# Test: needrestart was suppressed
36+
test_suppressed_needrestart upgrade.log
4437

4538
# Test: service status
4639
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: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ sudo systemctl enable --now td-agent
1414
sudo systemctl stop td-agent
1515

1616
# Install the current
17+
if [ "$1" = from-current-updated-via-v5 ]; then
18+
install_v5_lts
19+
fi
1720
install_current
1821
sudo systemctl daemon-reload
1922
sudo systemctl enable --now fluentd

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ for d in $(seq 1 10); do
1717
sudo touch /var/log/td-agent/$d.log
1818
done
1919

20+
# Install current
21+
if [ "$1" = via-v5 ]; then
22+
install_v5_lts
23+
fi
2024
install_current
2125

2226
# Test: take over enabled state

0 commit comments

Comments
 (0)