forked from rhkdump/kdump-utils
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
For local vmcore dumping, we only need to trigger a kernel crash and check if vmcore exists and it can re-use some setups and tests from NFS dumping. Note 1. plans/main.fmf is created for NFS and local dumping test plans to inherit . 2. Virtual tests [1] are created so local dumping can re-use the code of checking vmcore on an NFS server 3. The local test is disabled for now due to [2] 4. exit-first=true [3] is to make the executor stop executing tests once a test failure is encountered. But TMT currently has the problem of exit-first not applying across discover phase boundaries [4]. So for local dumping test plan, simply remove multiple discover phases [5]. [1] https://tmt.readthedocs.io/en/stable/guide.html#virtual-tests [2] https://bugzilla.redhat.com/show_bug.cgi?id=2270423 [3] https://tmt.readthedocs.io/en/stable/spec/plans.html#exit-first [4] teemtee/tmt#3116 [5] https://tmt.readthedocs.io/en/stable/guide.html#multihost-testing Signed-off-by: Coiby Xu <[email protected]>
- Loading branch information
Showing
9 changed files
with
115 additions
and
75 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
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 | ||
- /tests/trigger_crash | ||
- /tests/check_vmcore/local | ||
|
||
provision: | ||
- name: client | ||
how: virtual | ||
connection: system |
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 |
---|---|---|
@@ -0,0 +1,33 @@ | ||
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 | ||
|
||
- name: Install built RPM | ||
how: install | ||
package: | ||
- "$KDUMP_UTILS_RPM" | ||
where: | ||
- client | ||
|
||
|
||
execute: | ||
how: tmt | ||
exit-first: true |
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
summary: Set up NFS dumping target | ||
require: | ||
- nfs-utils |
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 |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#!/bin/bash | ||
# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k | ||
. /usr/share/beakerlib/beakerlib.sh || exit 1 | ||
|
||
function get_IP() { | ||
if echo $1 | grep -E -q '[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+'; then | ||
echo $1 | ||
else | ||
host $1 | sed -n -e 's/.*has address //p' | head -n 1 | ||
fi | ||
} | ||
|
||
function assign_server_roles() { | ||
if [ -n "${TMT_TOPOLOGY_BASH}" ] && [ -f ${TMT_TOPOLOGY_BASH} ]; then | ||
# assign roles based on tmt topology data | ||
cat ${TMT_TOPOLOGY_BASH} | ||
. ${TMT_TOPOLOGY_BASH} | ||
|
||
export CLIENT=${TMT_GUESTS["client.hostname"]} | ||
export SERVER=${TMT_GUESTS["server.hostname"]} | ||
MY_IP="${TMT_GUEST['hostname']}" | ||
elif [ -n "$SERVERS" ]; then | ||
# assign roles using SERVERS and CLIENTS variables | ||
export SERVER=$( echo "$SERVERS $CLIENTS" | awk '{ print $1 }') | ||
export CLIENT=$( echo "$SERVERS $CLIENTS" | awk '{ print $2 }') | ||
fi | ||
|
||
[ -z "$MY_IP" ] && MY_IP=$( hostname -I | awk '{ print $1 }' ) | ||
[ -n "$SERVER" ] && export SERVER_IP=$( get_IP $SERVER ) | ||
[ -n "$CLIENT" ] && export CLIENT_IP=$( get_IP $CLIENT ) | ||
} | ||
|
||
rlJournalStart | ||
|
||
rlPhaseStartSetup | ||
assign_server_roles | ||
rlLog "SERVER: $SERVER ${SERVER_IP}" | ||
rlLog "CLIENT: ${CLIENT} ${CLIENT}" | ||
rlLog "This system is: $(hostname) ${MY_IP}" | ||
rlPhaseEnd | ||
|
||
rlPhaseStartTest | ||
rlRun "echo nfs $SERVER:/var/tmp/nfsshare >> /etc/kdump.conf" | ||
rlPhaseEnd | ||
rlJournalEnd |
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,3 +1 @@ | ||
summary: Dump kernel crash to an NFS server | ||
require: | ||
- nfs-utils | ||
summary: Trigger a kernel panic |
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,3 +1,13 @@ | ||
summary: Check vmcore on NFS server | ||
framework: shell | ||
require: | ||
- makedumpfile | ||
|
||
/nfs: | ||
summary: Check vmcore on NFS server | ||
environment: | ||
VMCORE_PATH: /var/tmp/nfsshare/var/crash | ||
|
||
/local: | ||
summary: Check vmcore locally | ||
environment: | ||
VMCORE_PATH: /var/crash |
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