-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
vagrant on macos is fragile recently, try to use lxc. * remove obsolete condition from install-newly.sh since v5.0.2, user/group is changed to be kept. * github: added AmazonLinux, note that ubuntu-latest has switched to CGroup V2, so can't launch CGroup V1 container by default.
- Loading branch information
Showing
14 changed files
with
146 additions
and
101 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,4 @@ | |
set -exu | ||
|
||
sudo apt update | ||
sudo apt install -V -y lsb-release | ||
sudo apt install -V -y lsb-release curl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,48 @@ | ||
#!/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 | ||
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" | ||
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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.