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

Enable GitHub action to test the patches as early and as often as possible #21

Merged
merged 11 commits into from
Dec 19, 2024
54 changes: 54 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: kdump-utils tests

Comment on lines +1 to +2
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In commit message
s/kexec-tools repo/kdump-utils repo/

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in new version, thanks!

on: pull_request

jobs:
format-check:
runs-on: ubuntu-latest
container: docker.io/fedora:latest
steps:
- uses: actions/checkout@v4
- run: dnf install shfmt -y
- run: shfmt -s -d *.sh kdumpctl mk*dumprd tests/*/*/*.sh dracut/*/*.sh tools/*.sh

static-analysis:
runs-on: ubuntu-latest
container: docker.io/fedora:latest
steps:
- uses: actions/checkout@v4
- run: dnf install shellcheck -y
# Currently, for kdump-utils, there is need for shellcheck to require
# the sourced file to give correct warnings about the checked file
- run: shellcheck -x *.sh spec/*.sh kdumpctl mk*dumprd
- run: shellcheck -x dracut/*/*.sh
- run: shellcheck -x tests/*/*/*.sh tools/*.sh

unit-tests:
runs-on: ubuntu-latest
container: docker.io/fedora:latest
steps:
- uses: actions/checkout@v4
- run: sudo dnf install -y make dracut grubby hostname
- run: curl -L -O https://github.com/shellspec/shellspec/archive/latest.tar.gz && tar -xzf latest.tar.gz
- run: cd shellspec-latest && sudo make install
- run: shellspec

integration-tests:
runs-on: self-hosted
timeout-minutes: 45
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.fedora_version }}-${{ matrix.test }}
cancel-in-progress: true
strategy:
matrix:
fedora_version: [
"40",
]
fail-fast: false
steps:
- name: "Checkout Repository"
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: "${{ matrix.fedora_version }} kdump tests"
run: tools/run-integration-tests.sh ${{ matrix.fedora_version }}
9 changes: 9 additions & 0 deletions tests/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Use dracut code style
[*]
shell_variant = bash
indent_style = space
indent_size = 4
switch_case_indent = true
function_next_line = false
binary_next_line = true
space_redirects = true
1 change: 1 addition & 0 deletions tests/.fmf/version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1
88 changes: 0 additions & 88 deletions tests/Makefile

This file was deleted.

65 changes: 0 additions & 65 deletions tests/README

This file was deleted.

14 changes: 14 additions & 0 deletions tests/plans/local.fmf
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
summary: Kdump local dumping
# Disable this plan due to https://bugzilla.redhat.com/show_bug.cgi?id=2270423
enabled: false
discover:
how: fmf
test:
- /setup/default_crashkernel
- /setup/trigger_crash
- /tests/check_vmcore/local

provision:
- name: client
how: virtual
connection: system
17 changes: 17 additions & 0 deletions tests/plans/lvm2_thinp.fmf
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
summary: Kdump LVM2 provision dumping
discover:
how: fmf
test:
- /setup/default_crashkernel
- /setup/lvm2_thinp
- /setup/trigger_crash
- /tests/check_vmcore/lvm2_thinp

provision:
- name: client
how: virtual
connection: system
hardware:
disk:
- size: = 40GB
- size: = 1GB
34 changes: 34 additions & 0 deletions tests/plans/main.fmf
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
provision:
- name: server
how: virtual
connection: system

- name: client
how: virtual
connection: system


prepare:
# Set root password to log in as root in the console
- name: Set root password
how: shell
script:
- echo root:kdump | chpasswd

- name: Use custom mirror
how: shell
script:
- test -v CUSTOM_MIRROR && sed -e 's/^metalink=/#metalink=/g' -e "s|^#baseurl=http://download.example/pub/fedora/linux|baseurl=${CUSTOM_MIRROR}|g" -i.bak /etc/yum.repos.d/fedora*.repo || true
- dnf config-manager --set-disabled fedora-cisco-openh264 || true

- name: Install built RPM
how: install
package:
- "$KDUMP_UTILS_RPM"
where:
- client


execute:
how: tmt
exit-first: true
33 changes: 33 additions & 0 deletions tests/plans/nfs.fmf
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
summary: Kdump NFS dumping tests
discover:
- name: Set up crashkernel
how: fmf
test:
- setup/default_crashkernel
where:
- client
- name: Set up NFS server
how: fmf
test:
- setup/nfs_server
where:
- server
- name: Setup NFS client
how: fmf
test:
# For tmt, nfs means nfs*, so use nfs$ to exclude nfs_early
- setup/network_client/nfs$
where:
- client
- name: Panic kernel
how: fmf
test:
- /setup/trigger_crash
where:
- client
- name: Check vmcore
how: fmf
test:
- /tests/check_vmcore/nfs
where:
- server
26 changes: 26 additions & 0 deletions tests/plans/nfs_early.fmf
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
summary: Kdump NFS early dumping tests
discover:
- name: Set up crashkernel
how: fmf
test:
- setup/default_crashkernel
where:
- client
- name: Set up NFS server
how: fmf
test:
- setup/nfs_server
where:
- server
- name: Set up NFS client
how: fmf
test:
- setup/network_client/nfs_early
where:
- client
- name: Check vmcore
how: fmf
test:
- /tests/check_vmcore/nfs
where:
- server
26 changes: 26 additions & 0 deletions tests/plans/ssh.fmf
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
summary: Kdump SSH dumping tests
discover:
- name: Set up crashkernel
how: fmf
test:
- /setup/default_crashkernel
where:
- client
- name: Set up ssh client
how: fmf
test:
- /setup/network_client/ssh
where:
- client
- name: Panic kernel
how: fmf
test:
- /setup/trigger_crash
where:
- client
- name: Check vmcore
how: fmf
test:
- /tests/check_vmcore/ssh
where:
- server
Loading
Loading