basic test for setup

This commit is contained in:
pdancak 2024-06-20 15:20:55 +02:00
commit 296d28a013
3 changed files with 101 additions and 0 deletions

View file

@ -0,0 +1,3 @@
PURPOSE of /CoreOS/setup/Sanity/Basic-sanity-test
Description: Tests core functionality of the setup package
Author: Martin Cermak <mcermak@redhat.com>

View file

@ -0,0 +1,13 @@
summary: Tests contents of the setup package
contact: Petr Dancak <pdancak@redhat.com>
component:
- setup
test: ./runtest.sh
path: /Sanity/Basic-sanity-test
framework: beakerlib
recommend:
- setup
duration: 15m
enabled: true
extra-summary: /CoreOS/setup/Sanity/Basic-sanity-test
extra-task: /CoreOS/setup/Sanity/Basic-sanity-test

View file

@ -0,0 +1,85 @@
#!/bin/bash
# vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# runtest.sh of /CoreOS/setup/Sanity/Basic-sanity-test
# Description: Tests core functionality of the setup package
# Author: Martin Cermak <mcermak@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2010 Red Hat, Inc. All rights reserved.
#
# 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 rhts environment
. /usr/share/beakerlib/beakerlib.sh || exit 1
PACKAGE="setup"
rlJournalStart
rlPhaseStartSetup
rlAssertRpm $PACKAGE
rlPhaseEnd
rlPhaseStartTest
rlAssertExists "/etc/aliases"
rlAssertExists "/etc/bashrc"
rlAssertExists "/etc/csh.cshrc"
rlAssertExists "/etc/csh.login"
rlAssertExists "/etc/environment"
rlAssertExists "/etc/exports"
rlAssertExists "/etc/filesystems"
rlAssertExists "/etc/fstab"
rlAssertExists "/etc/group"
rlAssertExists "/etc/gshadow"
rlAssertExists "/etc/host.conf"
rlAssertExists "/etc/hosts"
# https://bugzilla.redhat.com/show_bug.cgi?id=1663556
if rlIsRHEL ">7" || rlIsFedora ">=20"; then
rlAssertNotExists "/etc/hosts.allow"
rlAssertNotExists "/etc/hosts.deny"
else
rlAssertExists "/etc/hosts.allow"
rlAssertExists "/etc/hosts.deny"
fi
rlAssertExists "/etc/inputrc"
rlAssertExists "/etc/motd"
rlAssertExists "/etc/mtab"
rlAssertExists "/etc/passwd"
rlAssertExists "/etc/printcap"
rlAssertExists "/etc/profile"
rlAssertExists "/etc/profile.d"
rlAssertExists "/etc/protocols"
# https://bugzilla.redhat.com/show_bug.cgi?id=1090639
if rlIsRHEL ">7" || rlIsFedora ">=21" ; then
rlAssertNotExists "/etc/securetty"
else
rlAssertExists "/etc/securetty"
fi
rlAssertExists "/etc/services"
rlAssertExists "/etc/shadow"
rlAssertExists "/etc/shells"
rlAssertExists "/var/log/lastlog"
rlPhaseEnd
rlPhaseStartCleanup
rlPhaseEnd
#rlJournalPrintText
rlJournalEnd