1
0
Fork 0

tests: add new tests.

This commit is contained in:
Robin Hack 2023-03-28 07:39:21 -04:00
parent bc41116e95
commit 432253afc1
4 changed files with 225 additions and 0 deletions

View file

@ -0,0 +1,30 @@
summary: Test for BZ#2179362 (Traceback caused by scheduler plugin with)
description: |
Bug summary: Traceback caused by scheduler plugin with runtime=0
Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=2179362
enabled: true
link:
- relates: https://bugzilla.redhat.com/show_bug.cgi?id=2179362
- relates: https://bugzilla.redhat.com/show_bug.cgi?id=2179364
tag:
- NoRHEL4
- NoRHEL5
- NoRHEL6
- NoRHEL7
adjust:
- enabled: false
when: distro == rhel-4, rhel-5, rhel-6, rhel-7
continue: false
contact: Robin Hack <rhack@redhat.com>
component:
- tuned
framework: beakerlib
require:
- library(tuned/basic)
recommend:
- tuned
duration: 10m
extra-nitrate: TC#0615117
extra-summary: /CoreOS/tuned/Regression/Traceback-caused-by-scheduler-plugin-with
extra-task: /CoreOS/tuned/Regression/Traceback-caused-by-scheduler-plugin-with
id: 12f842cb-4a75-4e52-80fe-79d297ac5b02

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/tuned/Regression/Traceback-caused-by-scheduler-plugin-with
# Description: Test for BZ#2179362 (Traceback caused by scheduler plugin with)
# Author: Robin Hack <rhack@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2023 Red Hat, Inc.
#
# This program is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation, either version 2 of
# the License, or (at your option) any later version.
#
# 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, see http://www.gnu.org/licenses/.
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Include Beaker environment
. /usr/share/beakerlib/beakerlib.sh || exit 1
PACKAGE="tuned"
rlJournalStart
rlPhaseStartSetup
rlAssertRpm $PACKAGE
rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory"
rlRun "pushd $TmpDir"
rlServiceStart "tuned"
rlImport "tuned/basic"
tunedProfileBackup
rlFileBackup "/etc/tuned/active_profile"
rlFileBackup "/etc/tuned/profile_mode"
rlRun "mkdir /etc/tuned/test-profile"
rlServiceStart "tuned"
sleep 1
rlFileBackup "/var/log/tuned/tuned.log"
rlRun "rm -rf /var/log/tuned/tuned.log"
rlPhaseEnd
rlPhaseStartTest
rlRun "pushd /etc/tuned/test-profile"
cat << EOF > tuned.conf
[scheduler]
runtime=0
EOF
rlRun "popd"
rlRun "tuned-adm profile test-profile"
rlServiceStop "tuned"
sleep 3
rlServiceStart "tuned"
sleep 3
rlServiceStop "tuned"
rlAssertNotGrep "Traceback" "/var/log/tuned/tuned.log"
rlAssertNotGrep "object has no attribute '_evlist'" "/var/log/tuned/tuned.log"
rlPhaseEnd
rlPhaseStartCleanup
rlServiceStart "tuned"
rlRun "popd"
rlRun "rm -r $TmpDir" 0 "Removing tmp directory"
tunedProfileRestore
rlServiceStop "tuned"
rlFileRestore
rlServiceRestore "tuned"
rlRun "rm -rf /etc/tuned/test-profile"
rlPhaseEnd
rlJournalPrintText
rlJournalEnd

View file

@ -0,0 +1,30 @@
summary: Test for BZ#2071418 (TuneD exits on duplicate config lines (new)
description: |
Bug summary: TuneD exits on duplicate config lines (new ConfigParser implementation)
Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=2071418
enabled: true
link:
- relates: https://bugzilla.redhat.com/show_bug.cgi?id=2071418
tag:
- NoRHEL4
- NoRHEL5
- NoRHEL6
- NoRHEL7
- Tier1
adjust:
- enabled: false
when: distro == rhel-4, rhel-5, rhel-6, rhel-7
continue: false
contact: something else <rhack@redhat.com>
component:
- tuned
framework: beakerlib
require:
- library(tuned/basic)
recommend:
- tuned
duration: 5m
extra-nitrate: TC#0614594
extra-summary: /CoreOS/tuned/Regression/bz2071418-TuneD-exits-on-duplicate-config-lines-new
extra-task: /CoreOS/tuned/Regression/bz2071418-TuneD-exits-on-duplicate-config-lines-new
id: 5d6ed632-88cd-4f46-aeef-98ef09fcbab5

View file

@ -0,0 +1,80 @@
#!/bin/bash
# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# runtest.sh of /CoreOS/tuned/Regression/bz2071418-TuneD-exits-on-duplicate-config-lines-new
# Description: Test for BZ#2071418 (TuneD exits on duplicate config lines (new)
# Author: something else <rhack@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2022 Red Hat, Inc.
#
# This program is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation, either version 2 of
# the License, or (at your option) any later version.
#
# 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, see http://www.gnu.org/licenses/.
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Include Beaker environment
. /usr/share/beakerlib/beakerlib.sh || exit 1
PACKAGE="tuned"
rlJournalStart
rlPhaseStartSetup
rlAssertRpm $PACKAGE
rlImport "tuned/basic"
rlServiceStart "tuned"
tunedProfileBackup
rlRun "mkdir /etc/tuned/test-profile"
rlRun "pushd /etc/tuned/test-profile"
cat << EOF > tuned.conf
[sysctl]
kernel.sem = 1250 256000 100 8192
kernel.sem = 1250 256000 100 8192
[selinux]
avc_cache_threshold=8192
avc_cache_threshold=16384
EOF
rlRun "popd"
rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory"
rlRun "pushd $TmpDir"
rlPhaseEnd
rlPhaseStartTest
rlRun "tuned-adm profile test-profile"
rlRun "tuned-adm verify"
rlAssertGrep "test-profile" "/etc/tuned/active_profile"
# last value from config is used
rlAssertGrep "16384$" /sys/fs/selinux/avc/cache_threshold
rlPhaseEnd
rlPhaseStartCleanup
rlRun "popd"
rlRun "rm -r $TmpDir" 0 "Removing tmp directory"
tunedProfileRestore
rlServiceRestore "tuned"
rlRun "rm -rf /etc/tuned/test-profile"
rlPhaseEnd
rlJournalPrintText
rlJournalEnd