Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

modify oboot-activate #16

Closed
wants to merge 12 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
235 changes: 120 additions & 115 deletions .github/workflows/test-platforms.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ jobs:
needs: pr-info
if: needs.pr-info.outputs.allowed_user == 'true'
name: Run tests on the platform
runs-on: [self-hosted, kstest]
runs-on: [self-hosted, kstest-test]
env:
STATUS_NAME: test-platforms
TARGET_BRANCH: ${{ needs.pr-info.outputs.base_ref }}
Expand All @@ -94,16 +94,12 @@ jobs:
sudo podman volume rm --all || true
sudo rm -rf * .git

- name: Clone repository
uses: actions/checkout@v4
with:
ref: ${{ needs.pr-info.outputs.sha }}
path: kickstart-tests

- name: Check out kickstart-tests
uses: actions/checkout@v4
with:
repository: rhinstaller/kickstart-tests
ref: ${{ needs.pr-info.outputs.sha }}
#repository: rhinstaller/kickstart-tests
repository: rvykydal/kickstart-tests
path: kickstart-tests

- name: Generate test cases
Expand Down Expand Up @@ -135,9 +131,18 @@ jobs:
working-directory: ./kickstart-tests
id: get_changed_tests
run: |
set -eux

git fetch origin
CHANGED_TESTS=$(git diff --name-only origin/$TARGET_BRANCH ${{ needs.pr-info.outputs.sha }} -- *.ks.in $(find -maxdepth 1 -name '*.sh' -perm -u+x) | sed 's/\.ks\.in$//; s/\.sh$//' | sort -u | tr '\n' ' ')
git config user.name github-actions
git config user.email [email protected]
git log --oneline -1
git log --oneline -1 origin/${{ env.TARGET_BRANCH }}
git rebase origin/${{ env.TARGET_BRANCH }}
BASE_COMMIT=$(git merge-base HEAD origin/$TARGET_BRANCH)
CHANGED_TESTS=$(git diff --name-only $BASE_COMMIT HEAD -- *.ks.in $(find -maxdepth 1 -name '*.sh' -perm -u+x) | sed 's/\.ks\.in$//; s/\.sh$//' | sort -u | tr '\n' ' ')
echo "changed_tests=${CHANGED_TESTS}" >> $GITHUB_OUTPUT
git checkout ${{ needs.pr-info.outputs.sha }}

- name: Get skipped tests for platform ${{ matrix.platform }}
id: get_platform_specs
Expand Down Expand Up @@ -216,112 +221,112 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# Fetch boot.iso and configure its local location
- name: Fetch boot.iso if available for platform ${{ matrix.platform }}
id: boot_iso_for_platform
run: |
set -eux
BOOT_ISO_PATH="${{ github.workspace }}/${{ matrix.platform }}.boot.iso"
BOOT_ISO_URL="file://$BOOT_ISO_PATH"
if [ "${{ matrix.platform }}" == "daily-iso" ]; then
${{ github.workspace }}/kickstart-tests/containers/runner/fetch_daily_iso.sh $GITHUB_TOKEN $BOOT_ISO_PATH
echo "boot_iso=\"bootIso\":{\"x86_64\":\"${BOOT_ISO_URL}\"}," >> $GITHUB_OUTPUT
elif [ "${{ matrix.platform }}" == "rawhide" ]; then
curl -L https://download.fedoraproject.org/pub/fedora/linux/development/rawhide/Server/x86_64/os/images/boot.iso --output $BOOT_ISO_PATH
echo "boot_iso=\"bootIso\":{\"x86_64\":\"${BOOT_ISO_URL}\"}," >> $GITHUB_OUTPUT
else
echo "Boot.iso for ${{ matrix.platform }} can't be fetched."
echo "boot_iso=" >> $GITHUB_OUTPUT
fi

# Configure location of installation repositories for the platform
# Also default boot.iso is defined by the value of urls.installation_tree
# of kstestParams event structure.
- name: Set installation tree for the platform
id: set_installation_urls
run: |
set -eux
if [ "${{ matrix.platform }}" == "rhel8" ]; then
echo "installation_tree=http://download.eng.bos.redhat.com/rhel-8/nightly/RHEL-8/latest-RHEL-8.10.0/compose/BaseOS/x86_64/os" >> $GITHUB_OUTPUT
echo "modular_url=http://download.eng.bos.redhat.com/rhel-8/nightly/RHEL-8/latest-RHEL-8.10.0/compose/AppStream/x86_64/os" >> $GITHUB_OUTPUT
elif [ "${{ matrix.platform }}" == "rhel9" ]; then
echo "installation_tree=http://download.eng.bos.redhat.com/rhel-9/nightly/RHEL-9/latest-RHEL-9.4.0/compose/BaseOS/x86_64/os" >> $GITHUB_OUTPUT
echo "modular_url=http://download.eng.bos.redhat.com/rhel-9/nightly/RHEL-9/latest-RHEL-9.4.0/compose/AppStream/x86_64/os" >> $GITHUB_OUTPUT
else
echo "Installation tree location for ${{ matrix.platform }} not configured"
if [ -z "${{ steps.boot_iso_for_platform.outputs.boot_iso }}" ]; then
echo "No boot.iso source is defined"
exit 2
fi
echo "installation_tree=" >> $GITHUB_OUTPUT
echo "modular_url=" >> $GITHUB_OUTPUT
fi

- name: Create Permian settings file
working-directory: ./permian
run: |
cat <<EOF > settings.ini
[kickstart_test]
kstest_local_repo=${{ github.workspace }}/kickstart-tests
[library]
directPath=${{ github.workspace }}/kickstart-tests/testlib
EOF

- name: Run kickstart tests in container
working-directory: ./permian
run: |
sudo --preserve-env=TEST_JOBS \
PYTHONPATH=${PYTHONPATH:-}:${{ github.workspace }}/tplib \
./run_subset --debug-log permian.log \
--settings settings.ini \
--override workflows.dry_run=${{ needs.pr-info.outputs.dry_run }} \
--testcase-query '${{ steps.generate_query.outputs.query }}' \
run_event '{
"type":"everything",
"everything_testplan":{
"configurations":[{"architecture":"x86_64"}],
"point_person":"[email protected]"
},
${{ steps.boot_iso_for_platform.outputs.boot_iso }}
"kstestParams":{
"platform":"${{ steps.get_platform_specs.outputs.platform }}",
"urls":{
"x86_64":{
"installation_tree":"${{ steps.set_installation_urls.outputs.installation_tree }}",
"modular_url":"${{ steps.set_installation_urls.outputs.modular_url }}"
}
}
}
}'

# Permian hides the exit code of launcher, so error out this step manually based on logs
rc=$( awk '/Runner return code: /{ print $4 }' permian.log)
if [ -n "$rc" ]; then
exit $rc
else
grep -q "All execution and reporting is done" permian.log || exit 111
fi

- name: Collect anaconda logs
if: always()
uses: actions/upload-artifact@v4
with:
name: 'logs-${{ matrix.platform }}'
# skip the /anaconda subdirectories, too large
path: |
kickstart-tests/data/logs/kstest*.log
kickstart-tests/data/logs/kstest.log.json
kickstart-tests/data/logs/kstest-*/*.log
kickstart-tests/data/logs/kstest-*/anaconda/lorax-packages.log

- name: Collect Permian logs
if: always()
uses: actions/upload-artifact@v4
with:
name: 'logs-permian-${{ matrix.platform }}'
path: |
permian/permian.log

# # Fetch boot.iso and configure its local location
# - name: Fetch boot.iso if available for platform ${{ matrix.platform }}
# id: boot_iso_for_platform
# run: |
# set -eux
# BOOT_ISO_PATH="${{ github.workspace }}/${{ matrix.platform }}.boot.iso"
# BOOT_ISO_URL="file://$BOOT_ISO_PATH"
# if [ "${{ matrix.platform }}" == "daily-iso" ]; then
# ${{ github.workspace }}/kickstart-tests/containers/runner/fetch_daily_iso.sh $GITHUB_TOKEN $BOOT_ISO_PATH
# echo "boot_iso=\"bootIso\":{\"x86_64\":\"${BOOT_ISO_URL}\"}," >> $GITHUB_OUTPUT
# elif [ "${{ matrix.platform }}" == "rawhide" ]; then
# curl -L https://download.fedoraproject.org/pub/fedora/linux/development/rawhide/Server/x86_64/os/images/boot.iso --output $BOOT_ISO_PATH
# echo "boot_iso=\"bootIso\":{\"x86_64\":\"${BOOT_ISO_URL}\"}," >> $GITHUB_OUTPUT
# else
# echo "Boot.iso for ${{ matrix.platform }} can't be fetched."
# echo "boot_iso=" >> $GITHUB_OUTPUT
# fi
#
# # Configure location of installation repositories for the platform
# # Also default boot.iso is defined by the value of urls.installation_tree
# # of kstestParams event structure.
# - name: Set installation tree for the platform
# id: set_installation_urls
# run: |
# set -eux
# if [ "${{ matrix.platform }}" == "rhel8" ]; then
# echo "installation_tree=http://download.eng.bos.redhat.com/rhel-8/nightly/RHEL-8/latest-RHEL-8.10.0/compose/BaseOS/x86_64/os" >> $GITHUB_OUTPUT
# echo "modular_url=http://download.eng.bos.redhat.com/rhel-8/nightly/RHEL-8/latest-RHEL-8.10.0/compose/AppStream/x86_64/os" >> $GITHUB_OUTPUT
# elif [ "${{ matrix.platform }}" == "rhel9" ]; then
# echo "installation_tree=http://download.eng.bos.redhat.com/rhel-9/nightly/RHEL-9/latest-RHEL-9.4.0/compose/BaseOS/x86_64/os" >> $GITHUB_OUTPUT
# echo "modular_url=http://download.eng.bos.redhat.com/rhel-9/nightly/RHEL-9/latest-RHEL-9.4.0/compose/AppStream/x86_64/os" >> $GITHUB_OUTPUT
# else
# echo "Installation tree location for ${{ matrix.platform }} not configured"
# if [ -z "${{ steps.boot_iso_for_platform.outputs.boot_iso }}" ]; then
# echo "No boot.iso source is defined"
# exit 2
# fi
# echo "installation_tree=" >> $GITHUB_OUTPUT
# echo "modular_url=" >> $GITHUB_OUTPUT
# fi
#
# - name: Create Permian settings file
# working-directory: ./permian
# run: |
# cat <<EOF > settings.ini
# [kickstart_test]
# kstest_local_repo=${{ github.workspace }}/kickstart-tests
# [library]
# directPath=${{ github.workspace }}/kickstart-tests/testlib
# EOF
#
# - name: Run kickstart tests in container
# working-directory: ./permian
# run: |
# sudo --preserve-env=TEST_JOBS \
# PYTHONPATH=${PYTHONPATH:-}:${{ github.workspace }}/tplib \
# ./run_subset --debug-log permian.log \
# --settings settings.ini \
# --override workflows.dry_run=${{ needs.pr-info.outputs.dry_run }} \
# --testcase-query '${{ steps.generate_query.outputs.query }}' \
# run_event '{
# "type":"everything",
# "everything_testplan":{
# "configurations":[{"architecture":"x86_64"}],
# "point_person":"[email protected]"
# },
# ${{ steps.boot_iso_for_platform.outputs.boot_iso }}
# "kstestParams":{
# "platform":"${{ steps.get_platform_specs.outputs.platform }}",
# "urls":{
# "x86_64":{
# "installation_tree":"${{ steps.set_installation_urls.outputs.installation_tree }}",
# "modular_url":"${{ steps.set_installation_urls.outputs.modular_url }}"
# }
# }
# }
# }'
#
# # Permian hides the exit code of launcher, so error out this step manually based on logs
# rc=$( awk '/Runner return code: /{ print $4 }' permian.log)
# if [ -n "$rc" ]; then
# exit $rc
# else
# grep -q "All execution and reporting is done" permian.log || exit 111
# fi
#
# - name: Collect anaconda logs
# if: always()
# uses: actions/upload-artifact@v4
# with:
# name: 'logs-${{ matrix.platform }}'
# # skip the /anaconda subdirectories, too large
# path: |
# kickstart-tests/data/logs/kstest*.log
# kickstart-tests/data/logs/kstest.log.json
# kickstart-tests/data/logs/kstest-*/*.log
# kickstart-tests/data/logs/kstest-*/anaconda/lorax-packages.log
#
# - name: Collect Permian logs
# if: always()
# uses: actions/upload-artifact@v4
# with:
# name: 'logs-permian-${{ matrix.platform }}'
# path: |
# permian/permian.log
#
result:
if: ${{ always() }}
name: Set result status
Expand Down
2 changes: 2 additions & 0 deletions lang.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
#
# Red Hat Author(s): Chris Lumens <[email protected]>

# modified on master

# Ignore unused variable parsed out by tooling scripts as test tags metadata
# shellcheck disable=SC2034
TESTTYPE="language i18n coverage"
Expand Down
1 change: 1 addition & 0 deletions onboot-activate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ TESTTYPE="network coverage"

. ${KSTESTDIR}/functions.sh

#modify

kernel_args() {
echo ${DEFAULT_BOOTOPTS} ip=${KSTEST_NETDEV1}:dhcp
Expand Down
1 change: 1 addition & 0 deletions team.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ TESTTYPE=${TESTTYPE:-"network"}

. ${KSTESTDIR}/functions.sh

# change team

kernel_args() {
echo ${DEFAULT_BOOTOPTS} ip=${KSTEST_NETDEV1}:dhcp
Expand Down