Skip to content

Commit 112d5c5

Browse files
Watson1978kenhys
authored andcommitted
ci: add downgrade test for no data lost
Signed-off-by: Shizuo Fujita <fujita@clear-code.com> Signed-off-by: Kentaro Hayashi <hayashi@clear-code.com>
1 parent bcddff9 commit 112d5c5

File tree

4 files changed

+71
-12
lines changed

4 files changed

+71
-12
lines changed

.github/workflows/apt.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,8 @@ jobs:
177177
- "update-to-next-version-service-status.sh disabled inactive"
178178
- "update-to-next-version-with-auto-and-manual.sh"
179179
- "update-to-next-major-version.sh"
180-
- "update-without-data-lost.sh"
180+
- "update-without-data-lost.sh v5 v6"
181+
- "update-without-data-lost.sh v6 v5"
181182
include:
182183
- label: Debian bullseye amd64
183184
rake-job: debian-bullseye

.github/workflows/yum.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,8 @@ jobs:
152152
- "update-to-next-version-service-status.sh disabled inactive"
153153
- "update-to-next-version-with-auto-and-manual.sh"
154154
- "update-to-next-major-version.sh"
155-
- "update-without-data-lost.sh"
155+
- "update-without-data-lost.sh v5 v6"
156+
- "update-without-data-lost.sh v6 v5"
156157
include:
157158
- label: AmazonLinux 2 x86_64
158159
rake-job: amazonlinux-2
@@ -223,7 +224,8 @@ jobs:
223224
- "update-to-next-version-service-status.sh disabled inactive"
224225
- "update-to-next-version-with-auto-and-manual.sh"
225226
- "update-to-next-major-version.sh"
226-
- "update-without-data-lost.sh"
227+
- "update-without-data-lost.sh v5 v6"
228+
- "update-without-data-lost.sh v6 v5"
227229
include:
228230
- label: RockyLinux 8 x86_64
229231
rake-job: rockylinux-8

fluent-package/apt/systemd-test/update-without-data-lost.sh

Lines changed: 32 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,39 @@ set -exu
44

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

7+
v5_package="/host/${distribution}/pool/${code_name}/${channel}/*/*/fluent-package_*_${architecture}.deb"
8+
v6_package="/host/v6-test/${distribution}/pool/${code_name}/${channel}/*/*/fluent-package_*_${architecture}.deb"
9+
10+
case "$1" in
11+
v5)
12+
package=$v5_package
13+
;;
14+
v6)
15+
package=$v6_package
16+
;;
17+
*)
18+
echo "Invalid argument: $1"
19+
exit 1
20+
;;
21+
esac
22+
23+
case "$2" in
24+
v5)
25+
next_package=$v5_package
26+
;;
27+
v6)
28+
next_package=$v6_package
29+
;;
30+
*)
31+
echo "Invalid argument: $2"
32+
exit 1
33+
;;
34+
esac
35+
736
sudo apt install -V -y rsyslog
837

938
# Install the current
10-
sudo apt install -V -y \
11-
/host/${distribution}/pool/${code_name}/${channel}/*/*/fluent-package_*_${architecture}.deb
39+
sudo apt install -V -y $package
1240

1341
# Set up configuration
1442
cat < $(dirname $0)/../../test-tools/rsyslog.conf >> /etc/rsyslog.conf
@@ -30,9 +58,8 @@ sleep 1
3058

3159
sleep 1
3260

33-
# Update to the next major version
34-
sudo apt install -V -y \
35-
/host/v6-test/${distribution}/pool/${code_name}/${channel}/*/*/fluent-package_*_${architecture}.deb
61+
# Update to the next version
62+
sudo apt install -V -y --allow-downgrades $next_package
3663
test $main_pid -eq $(systemctl show --value --property=MainPID fluentd)
3764

3865
# Main process should be replaced by USR2 signal

fluent-package/yum/systemd-test/update-without-data-lost.sh

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

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

7+
v5_package="/host/${distribution}/${DISTRIBUTION_VERSION}/x86_64/Packages/fluent-package-*.rpm"
8+
v6_package="/host/v6-test/${distribution}/${DISTRIBUTION_VERSION}/x86_64/Packages/fluent-package-*.rpm"
9+
10+
case "$1" in
11+
v5)
12+
package=$v5_package
13+
;;
14+
v6)
15+
package=$v6_package
16+
;;
17+
*)
18+
echo "Invalid argument: $1"
19+
exit 1
20+
;;
21+
esac
22+
23+
command="install"
24+
case "$2" in
25+
v5)
26+
next_package=$v5_package
27+
command="downgrade" # Avoid error in AmazonLinux2
28+
;;
29+
v6)
30+
next_package=$v6_package
31+
;;
32+
*)
33+
echo "Invalid argument: $2"
34+
exit 1
35+
;;
36+
esac
37+
738
sudo $DNF install -y rsyslog
839

940
# Install the current
10-
package="/host/${distribution}/${DISTRIBUTION_VERSION}/x86_64/Packages/fluent-package-[0-9]*.rpm"
1141
sudo $DNF install -y $package
1242

1343
# Set up configuration
@@ -30,9 +60,8 @@ sleep 1
3060

3161
sleep 1
3262

33-
# Update to the next major version
34-
next_package="/host/v6-test/${distribution}/${DISTRIBUTION_VERSION}/x86_64/Packages/fluent-package-*.rpm"
35-
sudo $DNF install -y $next_package
63+
# Update to the next version
64+
sudo $DNF $command -y $next_package
3665
test $main_pid -eq $(eval $(systemctl show fluentd --property=MainPID) && echo $MainPID)
3766

3867
# Main process should be replaced by USR2 signal

0 commit comments

Comments
 (0)