From db4ee0416725deffcbe74f8be94e4c7e5bde7be7 Mon Sep 17 00:00:00 2001 From: Karel Srot Date: Tue, 25 Feb 2025 14:05:15 +0100 Subject: [PATCH] add setup/reboot test --- setup/reboot/main.fmf | 6 +++++ setup/reboot/runtest.sh | 52 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 58 insertions(+) create mode 100644 setup/reboot/main.fmf create mode 100755 setup/reboot/runtest.sh diff --git a/setup/reboot/main.fmf b/setup/reboot/main.fmf new file mode 100644 index 0000000..739c0ea --- /dev/null +++ b/setup/reboot/main.fmf @@ -0,0 +1,6 @@ +summary: reboot test system +description: '' +contact: Karel Srot +test: ./runtest.sh +framework: beakerlib +duration: 15m diff --git a/setup/reboot/runtest.sh b/setup/reboot/runtest.sh new file mode 100755 index 0000000..9b71a29 --- /dev/null +++ b/setup/reboot/runtest.sh @@ -0,0 +1,52 @@ +#!/bin/bash +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Description: reboot test system +# Author: Karel Srot +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2025 Red Hat, Inc. +# +# This copyrighted material is made available to anyone wishing +# to use, modify, copy, or redistribute it subject to the terms +# and conditions of the GNU General Public License version 2. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public +# License along with this program; if not, write to the Free +# Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +# Boston, MA 02110-1301, USA. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +# Include Beaker environment +. /usr/share/beakerlib/beakerlib.sh || exit 1 + +COOKIE=/var/tmp/opencryptoki-setup-system-rebooted + +rlJournalStart + + if [ ! -e $COOKIE ]; then + rlPhaseStartSetup "pre-reboot phase" + rlRun "uname -a" + rlRun "cat /proc/cmdline" + rlRun "touch $COOKIE" + rlLogInfo "going to reboot now..." + rlPhaseEnd + rhts-reboot + else + rlPhaseStartTest "post-reboot phase" + rlRun "uname -a" + rlRun "cat /proc/cmdline" + rlRun "uptime" + rlRun "rm -f $COOKIE" + rlPhaseEnd + fi + +rlJournalPrintText +rlJournalEnd