adding new test

This commit is contained in:
Ondrej Mejzlik 2023-04-24 12:38:24 +02:00
commit cb2a8419b7
2 changed files with 105 additions and 0 deletions

View file

@ -0,0 +1,28 @@
summary: Test for bz476557 ([RFE] - Rebase/backport libevent package)
description: |
Bug summary: [RFE] - Rebase/backport libevent package
Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=476557
Description:
Escalated to Bugzilla from IssueTracker
component:
- libevent
test: ./runtest.sh
framework: beakerlib
recommend:
- libevent
- nfs-utils
duration: 15m
enabled: true
tag:
- TIPfail_infra
- TIPpass
- Tier1
tier: '1'
link:
- relates: https://bugzilla.redhat.com/show_bug.cgi?id=476557
- relates: https://bugzilla.redhat.com/show_bug.cgi?id=580528
extra-nitrate: TC#0144522
extra-summary: /CoreOS/libevent/Regression/bz476557-RFE-Rebase-backport-libevent-package
extra-task: /CoreOS/libevent/Regression/bz476557-RFE-Rebase-backport-libevent-package

View file

@ -0,0 +1,77 @@
#!/bin/bash
# vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# runtest.sh of /CoreOS/libevent/Regression/bz476557-RFE-Rebase-backport-libevent-package
# Description: Test for bz476557 ([RFE] - Rebase/backport libevent 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
PACKAGE="libevent"
TMPDIR="/"$(date +%F)-libevent-test-tmp
TESTFILE="testLibeventFile"
rlJournalStart
rlPhaseStartSetup
rlAssertRpm $PACKAGE || rlDie "Package $PACKAGE not installed"
rlRun "rlFileBackup /etc/exports" 0 "Back up /etc/exports"
rlRun "echo \"/ *(rw,insecure,fsid=0)\" > /etc/exports" 0 "Setting export"
rlRun "echo \"/tmp *(rw,insecure,fsid=1)\" >> /etc/exports" 0 "Setting tmp export"
rlAssertNotExists "$TMPDIR" 0
rlRun "mkdir $TMPDIR" 0 "Create $TMPDIR for mounting"
if rlIsRHEL '<8'; then
rlRun "rlServiceStart nfs-config"
fi
rlRun "rlServiceStart nfs-server"
rlRun "exportfs -r" 0 "Export all directories"
rlRun "TmpDir=\`mktemp -d\`" 0 "Creating testing tmp directory"
TESTDIR=$(pwd)
rlRun "pushd $TmpDir"
rlPhaseEnd
rlPhaseStartTest
rlRun "mount -t nfs4 localhost:/tmp $TMPDIR" 0 "Mount /tmp into $TMPDIR"
rlRun "echo testFile > /tmp/$TESTFILE" 0 "Create a test file in the mount point"
rlRun "ls -liah /tmp | grep -v TESTOUT > $TESTDIR/list1.txt" 0 "Get /tmp listing"
rlRun "ls -liah $TMPDIR | grep -v TESTOUT > $TESTDIR/list2.txt" 0 "Get $TMPDIR listing"
# check these lists are identical
rlRun "diff $TESTDIR/list1.txt $TESTDIR/list2.txt" 0 "Check listings are identical"
ls $TESTDIR
cat $TESTDIR/list1.txt
cat $TESTDIR/list2.txt
rlBundleLogs logs $TESTDIR/list1.txt $TESTDIR/list2.txt
rlPhaseEnd
rlPhaseStartCleanup
rlRun "umount $TMPDIR" 0 "Umount $TMPDIR" 0 "Umount $TMPDIR"
rlRun "rm -rf $TMPDIR" 0 "Remove $TMPDIR" 0 "Remove $TMPDIR"
rlRun "rm -f $TESTDIR/list1.txt $TESTDIR/list2.txt" 0 "Remove test files"
rlRun "rlFileRestore" 0 "Restore /etc/exports"
rlRun "rlServiceRestore nfs-server"
rlRun "popd"
rlRun "rm -r $TmpDir" 0 "Removing tmp directory"
rlPhaseEnd
rlJournalPrintText
rlJournalEnd