From c730917d07b89c401b5cd58fd2fed545195ae7e6 Mon Sep 17 00:00:00 2001 From: Kentaro Hayashi Date: Wed, 6 Dec 2023 17:55:51 +0900 Subject: [PATCH 1/7] github: switch to use lxc vagrant on macos is fragile recently, try to use lxc. Signed-off-by: Kentaro Hayashi --- .github/workflows/apt.yml | 34 +++++++++---- .github/workflows/yum.yml | 28 +++++++---- .../apt/systemd-test/install-newly.sh | 2 +- fluent-package/apt/systemd-test/test.sh | 49 +++++++++---------- .../apt/systemd-test/update-from-v4.sh | 4 +- ...ext-version-with-backward-compat-for-v4.sh | 6 +-- .../systemd-test/update-to-next-version.sh | 4 +- .../yum/systemd-test/install-newly.sh | 2 +- fluent-package/yum/systemd-test/test.sh | 42 +++++++--------- .../yum/systemd-test/update-from-v4.sh | 2 +- ...ext-version-with-backward-compat-for-v4.sh | 2 +- .../systemd-test/update-to-next-version.sh | 2 +- 12 files changed, 96 insertions(+), 81 deletions(-) diff --git a/.github/workflows/apt.yml b/.github/workflows/apt.yml index a9ac5aad8..a07f6c0ff 100644 --- a/.github/workflows/apt.yml +++ b/.github/workflows/apt.yml @@ -95,22 +95,36 @@ jobs: test: name: Test needs: build - runs-on: macos-latest + runs-on: ubuntu-latest strategy: fail-fast: false matrix: - distribution: - - debian-bullseye - - debian-bookworm - - ubuntu-focal - - ubuntu-jammy + label: + - Debian GNU/Linux bullseye amd64 + - Debian GNU/Linux bookworm amd64 + - Ubuntu Focal amd64 + - Ubuntu Jammy amd64 + include: + - label: Debian GNU/Linux bullseye amd64 + rake-job: debian-bullseye + test-lxc-image: images:debian/11 + - label: Debian GNU/Linux bookworm amd64 + rake-job: debian-bookworm + test-lxc-image: images:debian/12 + - label: Ubuntu Focal amd64 + rake-job: ubuntu-focal + test-lxc-image: ubuntu:20.04 + - label: Ubuntu Jammy amd64 + rake-job: ubuntu-jammy + test-lxc-image: ubuntu:22.04 steps: - uses: actions/checkout@master - uses: actions/download-artifact@master with: - name: packages-${{ matrix.distribution }} + name: packages-${{ matrix.rake-job }} - uses: actions/download-artifact@master with: - name: packages-apt-source-${{ matrix.distribution }} - - name: Run Test - run: fluent-package/apt/systemd-test/test.sh ${{ matrix.distribution }} + name: packages-apt-source-${{ matrix.rake-job }} + - uses: canonical/setup-lxd@v0.1.1 + - name: Run Test + run: fluent-package/apt/systemd-test/test.sh ${{ matrix.test-lxc-image }} diff --git a/.github/workflows/yum.yml b/.github/workflows/yum.yml index a459e91a4..fa620a87c 100644 --- a/.github/workflows/yum.yml +++ b/.github/workflows/yum.yml @@ -92,20 +92,30 @@ jobs: test: name: Test needs: build - runs-on: macos-latest + runs-on: ubuntu-latest strategy: fail-fast: false matrix: - distribution: - - centos-7 - - rockylinux-8 - - almalinux-9 - - amazonlinux-2 - # - amazonlinux-2023 + label: + # CGroup V1 is not supported + # - CentOS 7 x86_64 + - RockyLinux 8 x86_64 + - AlmaLinux 9 x86_64 + include: + # - label: CentOS 7 x86_64 + # rake-job: centos-7 + # test-lxc-image: images:centos/7 + - label: RockyLinux 8 x86_64 + rake-job: rockylinux-8 + test-lxc-image: images:rockylinux/8 + - label: AlmaLinux 9 x86_64 + rake-job: almalinux-9 + test-lxc-image: images:almalinux/9 steps: - uses: actions/checkout@master - uses: actions/download-artifact@master with: - name: packages-${{ matrix.distribution }} + name: packages-${{ matrix.rake-job }} + - uses: canonical/setup-lxd@v0.1.1 - name: Run Test - run: fluent-package/yum/systemd-test/test.sh ${{ matrix.distribution }} + run: fluent-package/yum/systemd-test/test.sh ${{ matrix.test-lxc-image }} diff --git a/fluent-package/apt/systemd-test/install-newly.sh b/fluent-package/apt/systemd-test/install-newly.sh index 6ab851470..02be94047 100755 --- a/fluent-package/apt/systemd-test/install-newly.sh +++ b/fluent-package/apt/systemd-test/install-newly.sh @@ -7,7 +7,7 @@ set -exu case $1 in local) sudo apt install -V -y \ - /vagrant/${distribution}/pool/${code_name}/${channel}/*/*/fluent-package_*_${architecture}.deb + /host/${distribution}/pool/${code_name}/${channel}/*/*/fluent-package_*_${architecture}.deb ;; v5) curl --fail --silent --show-error --location https://toolbelt.treasuredata.com/sh/install-${distribution}-${code_name}-fluent-package5.sh | sh diff --git a/fluent-package/apt/systemd-test/test.sh b/fluent-package/apt/systemd-test/test.sh index 4b06b6c97..67c98b115 100755 --- a/fluent-package/apt/systemd-test/test.sh +++ b/fluent-package/apt/systemd-test/test.sh @@ -1,28 +1,21 @@ #!/bin/bash if [ -z $1 ]; then - echo "Error: Need to specify VM name in the Vagrantfile." - echo "Ex.) $ ./test.sh ubuntu-focal" + echo "Error: Need to specify lxc image name." + echo "Ex.) $ ./test.sh ubuntu:20.04" exit 1 fi -vm=$1 -dir="/vagrant/fluent-package/apt/systemd-test" +image=$1 +dir="/host/fluent-package/apt/systemd-test" -vagrant status $vm | grep -E "^${vm}\s+not created (.*)$" -if [ $? -ne 0 ]; then - echo "Error: The VM already exists. Need to destroy it in advance with the following command." - echo "$ vagrant destroy $vm" - exit 1 -fi - -set -eu +set -eux test_filenames=( update-to-next-version.sh ) -if [ ! $vm = "debian-bookworm" ]; then +if [ ! $image = "images:debian/12" ]; then # As no bookworm package for v4, so execute upgrade test for other code name. test_filenames+=( update-from-v4.sh @@ -32,24 +25,26 @@ fi for apt_repo_type in local v5 lts; do echo -e "\nRun test: $apt_repo_type\n" - vagrant up $vm - vagrant ssh $vm -- $dir/setup.sh - vagrant ssh $vm -- $dir/install-newly.sh $apt_repo_type - vagrant destroy -f $vm + lxc launch $image target + sleep 5 + lxc config device add target host disk source=$PWD path=/host + lxc list + lxc exec target -- $dir/setup.sh + lxc exec target -- $dir/install-newly.sh $apt_repo_type + lxc stop target + lxc delete target done for test_filename in ${test_filenames[@]}; do echo -e "\nRun test: $test_filename\n" - vagrant up $vm - vagrant ssh $vm -- $dir/setup.sh - vagrant ssh $vm -- $dir/$test_filename - vagrant destroy -f $vm - # I want to use snapshot instead of destorying it for every test, - # but somehow, it will be often an error on GitHub Actions... - # $ vagrant ssh $vm -- $dir/setup.sh - # $ vagrant snapshot save -f $vm after-setup - # (execute a test) - # $ vagrant snapshot restore $vm after-setup + lxc launch $image target + sleep 5 + lxc config device add target host disk source=$PWD path=/host + lxc list + lxc exec target -- $dir/setup.sh + lxc exec target -- $dir/$test_filename + lxc stop target + lxc delete target done echo -e "\nAll Success!\n" diff --git a/fluent-package/apt/systemd-test/update-from-v4.sh b/fluent-package/apt/systemd-test/update-from-v4.sh index 968f212de..14657a05e 100755 --- a/fluent-package/apt/systemd-test/update-from-v4.sh +++ b/fluent-package/apt/systemd-test/update-from-v4.sh @@ -12,7 +12,7 @@ sudo apt install -y ./fluentd-apt-source_2020.8.25-1_all.deb # Install v4 sudo apt clean all # Uncomment when v5 repository was deployed -#apt_source_package=/vagrant/${distribution}/pool/${code_name}/${channel}/*/*/fluent-apt-source*_all.deb +#apt_source_package=/host/${distribution}/pool/${code_name}/${channel}/*/*/fluent-apt-source*_all.deb #sudo apt install -V -y ${apt_source_package} ca-certificates sudo apt update sudo apt install -V -y td-agent=${td_agent_version}-1 @@ -21,7 +21,7 @@ systemctl status --no-pager td-agent # Install the current sudo apt install -V -y \ - /vagrant/${distribution}/pool/${code_name}/${channel}/*/*/fluent-package_*_${architecture}.deb + /host/${distribution}/pool/${code_name}/${channel}/*/*/fluent-package_*_${architecture}.deb # Test: service status systemctl status --no-pager fluentd diff --git a/fluent-package/apt/systemd-test/update-to-next-version-with-backward-compat-for-v4.sh b/fluent-package/apt/systemd-test/update-to-next-version-with-backward-compat-for-v4.sh index d7e6ba4cd..b8436f773 100755 --- a/fluent-package/apt/systemd-test/update-to-next-version-with-backward-compat-for-v4.sh +++ b/fluent-package/apt/systemd-test/update-to-next-version-with-backward-compat-for-v4.sh @@ -12,7 +12,7 @@ sudo apt install -y ./fluentd-apt-source_2020.8.25-1_all.deb # Install v4 sudo apt clean all # Uncomment when v5 repository was deployed -#apt_source_package=/vagrant/${distribution}/pool/${code_name}/${channel}/*/*/fluent-apt-source*_all.deb +#apt_source_package=/host/${distribution}/pool/${code_name}/${channel}/*/*/fluent-apt-source*_all.deb #sudo apt install -V -y ${apt_source_package} ca-certificates sudo apt update sudo apt install -V -y td-agent=${td_agent_version}-1 @@ -21,7 +21,7 @@ systemctl status --no-pager td-agent # Install the current sudo apt install -V -y \ - /vagrant/${distribution}/pool/${code_name}/${channel}/*/*/fluent-package_*_${architecture}.deb + /host/${distribution}/pool/${code_name}/${channel}/*/*/fluent-package_*_${architecture}.deb systemctl status --no-pager fluentd sudo systemctl stop fluentd @@ -32,7 +32,7 @@ systemctl status --no-pager fluentd systemctl status --no-pager td-agent # Make a dummy pacakge for the next version -dpkg-deb -R /vagrant/${distribution}/pool/${code_name}/${channel}/*/*/fluent-package_*_${architecture}.deb tmp +dpkg-deb -R /host/${distribution}/pool/${code_name}/${channel}/*/*/fluent-package_*_${architecture}.deb tmp last_ver=$(cat tmp/DEBIAN/control | grep "Version: " | sed -E "s/Version: ([0-9.]+)-([0-9]+)/\2/g") sed -i -E "s/Version: ([0-9.]+)-([0-9]+)/Version: \1-$(($last_ver+1))/g" tmp/DEBIAN/control dpkg-deb --build tmp next_version.deb diff --git a/fluent-package/apt/systemd-test/update-to-next-version.sh b/fluent-package/apt/systemd-test/update-to-next-version.sh index 9fb2bb27a..6e8ee1ebb 100755 --- a/fluent-package/apt/systemd-test/update-to-next-version.sh +++ b/fluent-package/apt/systemd-test/update-to-next-version.sh @@ -6,10 +6,10 @@ set -exu # Install the current sudo apt install -V -y \ - /vagrant/${distribution}/pool/${code_name}/${channel}/*/*/fluent-package_*_${architecture}.deb + /host/${distribution}/pool/${code_name}/${channel}/*/*/fluent-package_*_${architecture}.deb # Make a dummy pacakge for the next version -dpkg-deb -R /vagrant/${distribution}/pool/${code_name}/${channel}/*/*/fluent-package_*_${architecture}.deb tmp +dpkg-deb -R /host/${distribution}/pool/${code_name}/${channel}/*/*/fluent-package_*_${architecture}.deb tmp last_ver=$(cat tmp/DEBIAN/control | grep "Version: " | sed -E "s/Version: ([0-9.]+)-([0-9]+)/\2/g") sed -i -E "s/Version: ([0-9.]+)-([0-9]+)/Version: \1-$(($last_ver+1))/g" tmp/DEBIAN/control dpkg-deb --build tmp next_version.deb diff --git a/fluent-package/yum/systemd-test/install-newly.sh b/fluent-package/yum/systemd-test/install-newly.sh index c30d57791..3a79e9cfe 100755 --- a/fluent-package/yum/systemd-test/install-newly.sh +++ b/fluent-package/yum/systemd-test/install-newly.sh @@ -7,7 +7,7 @@ set -exu case $1 in local) sudo $DNF install -y \ - /vagrant/${distribution}/${DISTRIBUTION_VERSION}/x86_64/Packages/fluent-package-[0-9]*.rpm + /host/${distribution}/${DISTRIBUTION_VERSION}/x86_64/Packages/fluent-package-[0-9]*.rpm ;; v5) case $DISTRIBUTION in diff --git a/fluent-package/yum/systemd-test/test.sh b/fluent-package/yum/systemd-test/test.sh index f254cea5b..5357c7a81 100755 --- a/fluent-package/yum/systemd-test/test.sh +++ b/fluent-package/yum/systemd-test/test.sh @@ -1,22 +1,15 @@ #!/bin/bash if [ -z $1 ]; then - echo "Error: Need to specify VM name in the Vagrantfile." - echo "Ex.) $ ./test.sh almalinux-9" + echo "Error: Need to specify distribution name." + echo "Ex.) $ ./test.sh centos-7" exit 1 fi -vm=$1 -dir="/vagrant/fluent-package/yum/systemd-test" +image=$1 +dir="/host/fluent-package/yum/systemd-test" -vagrant status $vm | grep -E "^${vm}\s+not created (.*)$" -if [ $? -ne 0 ]; then - echo "Error: The VM already exists. Need to destroy it in advance with the following command." - echo "$ vagrant destroy $vm" - exit 1 -fi - -set -eu +set -eux test_filenames=( update-from-v4.sh @@ -26,21 +19,24 @@ test_filenames=( for yum_repo_type in local v5 lts; do echo -e "\nRun test: $yum_repo_type\n" - vagrant up $vm - vagrant ssh $vm -- $dir/install-newly.sh $yum_repo_type - vagrant destroy -f $vm + lxc launch $image target + sleep 5 + lxc config device add target host disk source=$PWD path=/host + lxc list + lxc exec target -- $dir/install-newly.sh $yum_repo_type + lxc stop target + lxc delete target done for test_filename in ${test_filenames[@]}; do echo -e "\nRun test: $test_filename\n" - vagrant up $vm - vagrant ssh $vm -- $dir/$test_filename - vagrant destroy -f $vm - # I want to use snapshot instead of destroying it for every test, - # but somehow, it will be often an error on GitHub Actions... - # $ vagrant snapshot save -f $vm after-setup - # (execute a test) - # $ vagrant snapshot restore $vm after-setup + lxc launch $image target + sleep 5 + lxc config device add target host disk source=$PWD path=/host + lxc list + lxc exec target -- $dir/$test_filename + lxc stop target + lxc delete target done echo -e "\nAll Success!\n" diff --git a/fluent-package/yum/systemd-test/update-from-v4.sh b/fluent-package/yum/systemd-test/update-from-v4.sh index 735d35834..b63807722 100755 --- a/fluent-package/yum/systemd-test/update-from-v4.sh +++ b/fluent-package/yum/systemd-test/update-from-v4.sh @@ -36,7 +36,7 @@ systemctl status --no-pager td-agent # Install the current sudo $DNF install -y \ - /vagrant/${distribution}/${DISTRIBUTION_VERSION}/x86_64/Packages/fluent-package-[0-9]*.rpm + /host/${distribution}/${DISTRIBUTION_VERSION}/x86_64/Packages/fluent-package-[0-9]*.rpm # Test: service status systemctl status --no-pager fluentd # Migration process starts the service automatically diff --git a/fluent-package/yum/systemd-test/update-to-next-version-with-backward-compat-for-v4.sh b/fluent-package/yum/systemd-test/update-to-next-version-with-backward-compat-for-v4.sh index 678d2301a..f1b3d342e 100755 --- a/fluent-package/yum/systemd-test/update-to-next-version-with-backward-compat-for-v4.sh +++ b/fluent-package/yum/systemd-test/update-to-next-version-with-backward-compat-for-v4.sh @@ -35,7 +35,7 @@ sudo systemctl enable --now td-agent systemctl status --no-pager td-agent # Install the current -package="/vagrant/${distribution}/${DISTRIBUTION_VERSION}/x86_64/Packages/fluent-package-[0-9]*.rpm" +package="/host/${distribution}/${DISTRIBUTION_VERSION}/x86_64/Packages/fluent-package-[0-9]*.rpm" sudo $DNF install -y $package systemctl status --no-pager fluentd # Migration process starts the service automatically sudo systemctl enable --now fluentd diff --git a/fluent-package/yum/systemd-test/update-to-next-version.sh b/fluent-package/yum/systemd-test/update-to-next-version.sh index aac01ecb6..1c0382ff7 100755 --- a/fluent-package/yum/systemd-test/update-to-next-version.sh +++ b/fluent-package/yum/systemd-test/update-to-next-version.sh @@ -5,7 +5,7 @@ set -exu . $(dirname $0)/commonvar.sh # Install the current -package="/vagrant/${distribution}/${DISTRIBUTION_VERSION}/x86_64/Packages/fluent-package-[0-9]*.rpm" +package="/host/${distribution}/${DISTRIBUTION_VERSION}/x86_64/Packages/fluent-package-[0-9]*.rpm" sudo $DNF install -y $package sudo systemctl enable --now fluentd systemctl status --no-pager fluentd From 564a0fb851b677cef08eaa542035b617bd0709b3 Mon Sep 17 00:00:00 2001 From: Kentaro Hayashi Date: Thu, 7 Dec 2023 16:50:28 +0900 Subject: [PATCH 2/7] github: use latest td-agent Signed-off-by: Kentaro Hayashi --- fluent-package/yum/systemd-test/commonvar.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fluent-package/yum/systemd-test/commonvar.sh b/fluent-package/yum/systemd-test/commonvar.sh index 346af6dfe..e056a2e47 100755 --- a/fluent-package/yum/systemd-test/commonvar.sh +++ b/fluent-package/yum/systemd-test/commonvar.sh @@ -2,7 +2,7 @@ distribution=$(cat /etc/system-release-cpe | awk '{print substr($0, index($1, "o"))}' | cut -d: -f2) version=$(cat /etc/system-release-cpe | awk '{print substr($0, index($1, "o"))}' | cut -d: -f4) -td_agent_version=4.5.1 +td_agent_version=4.5.2 case $distribution in amazon) From 9a14f45f0dba9fa85c1828b2d3cd3cc93c90989a Mon Sep 17 00:00:00 2001 From: Kentaro Hayashi Date: Fri, 8 Dec 2023 11:48:37 +0900 Subject: [PATCH 3/7] github: remove obsolete condition since v5.0.2, user/group is changed to be kept. Signed-off-by: Kentaro Hayashi --- fluent-package/yum/systemd-test/install-newly.sh | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/fluent-package/yum/systemd-test/install-newly.sh b/fluent-package/yum/systemd-test/install-newly.sh index 3a79e9cfe..a698f08c4 100755 --- a/fluent-package/yum/systemd-test/install-newly.sh +++ b/fluent-package/yum/systemd-test/install-newly.sh @@ -46,18 +46,8 @@ test -e /var/log/fluent/fluentd.log sudo $DNF remove -y fluent-package sudo systemctl daemon-reload -case $1 in - local) - getent passwd fluentd >/dev/null - getent group fluentd >/dev/null - ;; - *) - # TODO: Remove this branch after the following fix is applied to the latest release. - # https://github.com/fluent/fluent-package-builder/pull/598 - (! getent passwd fluentd >/dev/null) - (! getent group fluentd >/dev/null) - ;; -esac +getent passwd fluentd >/dev/null +getent group fluentd >/dev/null # `sudo systemctl daemon-reload` clears the service completely. # (The result of `systemctl status` will be `unfound`) # Note: RPM does not leave links like `@/etc/systemd/system/fluentd.service`. From e8a2d9c1857390fe213dd20d0a22a2e58c6a6c5e Mon Sep 17 00:00:00 2001 From: Kentaro Hayashi Date: Fri, 8 Dec 2023 11:51:08 +0900 Subject: [PATCH 4/7] github: install missing curl Signed-off-by: Kentaro Hayashi --- fluent-package/apt/systemd-test/setup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fluent-package/apt/systemd-test/setup.sh b/fluent-package/apt/systemd-test/setup.sh index 4b628611a..f62cb1395 100755 --- a/fluent-package/apt/systemd-test/setup.sh +++ b/fluent-package/apt/systemd-test/setup.sh @@ -3,4 +3,4 @@ set -exu sudo apt update -sudo apt install -V -y lsb-release +sudo apt install -V -y lsb-release curl From 9d2952b8f457e3877053a906d874df13b747fcf9 Mon Sep 17 00:00:00 2001 From: Kentaro Hayashi Date: Fri, 8 Dec 2023 12:24:29 +0900 Subject: [PATCH 5/7] github: add amazonlinux Note that ubuntu-latest has switched to CGroup V2, so can't launch CGroup V1 container by default. Signed-off-by: Kentaro Hayashi --- .github/workflows/yum.yml | 39 ++++++++++++++++++++++++++++++++------- 1 file changed, 32 insertions(+), 7 deletions(-) diff --git a/.github/workflows/yum.yml b/.github/workflows/yum.yml index fa620a87c..ba02491ec 100644 --- a/.github/workflows/yum.yml +++ b/.github/workflows/yum.yml @@ -89,22 +89,47 @@ jobs: --env CENTOS_STREAM=${{ matrix.centos-stream }} \ ${{ matrix.test-docker-image }} \ /fluentd/fluent-package/yum/binstubs-test.sh - test: - name: Test + v1test: + name: Test with CGroup V1 + needs: build + runs-on: ubuntu-20.04 + strategy: + fail-fast: false + matrix: + label: + - CentOS 7 x86_64 + - AmazonLinux 2 x86_64 + - AmazonLinux 2023 x86_64 + include: + - label: CentOS 7 x86_64 + rake-job: centos-7 + test-lxc-image: images:centos/7 + - label: AmazonLinux 2 x86_64 + rake-job: amazonlinux-2 + test-lxc-image: images:amazonlinux/2 + - label: AmazonLinux 2023 x86_64 + rake-job: amazonlinux-2023 + test-lxc-image: images:amazonlinux/2023 + steps: + - uses: actions/checkout@master + - uses: actions/download-artifact@master + with: + name: packages-${{ matrix.rake-job }} + - uses: canonical/setup-lxd@v0.1.1 + - name: Run Test + run: fluent-package/yum/systemd-test/test.sh ${{ matrix.test-lxc-image }} + + v2test: + name: Test with CGroup V2 needs: build runs-on: ubuntu-latest strategy: fail-fast: false matrix: label: - # CGroup V1 is not supported - # - CentOS 7 x86_64 - RockyLinux 8 x86_64 - AlmaLinux 9 x86_64 include: - # - label: CentOS 7 x86_64 - # rake-job: centos-7 - # test-lxc-image: images:centos/7 - label: RockyLinux 8 x86_64 rake-job: rockylinux-8 test-lxc-image: images:rockylinux/8 From 0ec852d23199c44acbc0241c1d90c3f0259ca3d2 Mon Sep 17 00:00:00 2001 From: Kentaro Hayashi Date: Fri, 8 Dec 2023 14:12:57 +0900 Subject: [PATCH 6/7] github: skip upgrade test from v4 on AmazonLinux 2023 Signed-off-by: Kentaro Hayashi --- fluent-package/yum/systemd-test/test.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/fluent-package/yum/systemd-test/test.sh b/fluent-package/yum/systemd-test/test.sh index 5357c7a81..7ccd2b56c 100755 --- a/fluent-package/yum/systemd-test/test.sh +++ b/fluent-package/yum/systemd-test/test.sh @@ -12,11 +12,17 @@ dir="/host/fluent-package/yum/systemd-test" set -eux test_filenames=( - update-from-v4.sh update-to-next-version.sh - update-to-next-version-with-backward-compat-for-v4.sh ) +if [ ! $image = "images:amazonlinux/2023" ]; then + # As no AmazonLinux/2023 package for v4, so execute upgrade test for other images. + test_filenames+=( + update-from-v4.sh + update-to-next-version-with-backward-compat-for-v4.sh + ) +fi + for yum_repo_type in local v5 lts; do echo -e "\nRun test: $yum_repo_type\n" lxc launch $image target From 18fc6059b83792c6f649108fd9d970afeb0c8ed6 Mon Sep 17 00:00:00 2001 From: Kentaro Hayashi Date: Fri, 8 Dec 2023 16:35:28 +0900 Subject: [PATCH 7/7] github: fix failure on AmazonLinux 2023 EPEL is not supported in AmazonLinux 2023. Signed-off-by: Kentaro Hayashi --- .../yum/systemd-test/update-to-next-version.sh | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/fluent-package/yum/systemd-test/update-to-next-version.sh b/fluent-package/yum/systemd-test/update-to-next-version.sh index 1c0382ff7..aa42de076 100755 --- a/fluent-package/yum/systemd-test/update-to-next-version.sh +++ b/fluent-package/yum/systemd-test/update-to-next-version.sh @@ -13,13 +13,22 @@ systemctl status --no-pager fluentd # Make a dummy pacakge for the next version case $distribution in amazon) - sudo amazon-linux-extras install -y epel + case $version in + 2023) + curl -L -o rpmrebuild.noarch.rpm https://sourceforge.net/projects/rpmrebuild/files/latest/download + sudo $DNF install -y ./rpmrebuild.noarch.rpm + ;; + 2) + sudo amazon-linux-extras install -y epel + sudo $DNF install -y rpmrebuild + ;; + esac ;; *) sudo $DNF install -y epel-release + sudo $DNF install -y rpmrebuild ;; esac -sudo $DNF install -y rpmrebuild # Example: "1.el9" release=$(rpmquery --queryformat="%{Release}" -p $package) # Example: "1"