1
0
Fork 0

beakerlibtests: add new test

Add slowdown for centos stream -
systemd failure:
Active: failed (Result: start-limit-hit)
This commit is contained in:
Robin Hack 2021-10-06 05:59:08 -04:00
parent bcbf2a5489
commit 9bf602afba
2 changed files with 95 additions and 0 deletions

View file

@ -0,0 +1,30 @@
summary: variables support in profiles
description: ''
contact: rhack@redhat.com
component:
- tuned
test: ./runtest.sh
framework: beakerlib
require:
- library(tuned/basic)
recommend:
- tuned
duration: 5m
enabled: true
tag:
- FedoraReady
- NoRHEL4
- NoRHEL5
- TIPfail_infra
- TIPpass
- Tier1
tier: '1'
link:
- relates: https://bugzilla.redhat.com/show_bug.cgi?id=1225124
adjust:
- enabled: false
when: distro < rhel-7
continue: false
extra-nitrate: TC#0496575
extra-summary: /CoreOS/tuned/Sanity/variables-support-in-profiles
extra-task: /CoreOS/tuned/Sanity/variables-support-in-profiles

View file

@ -0,0 +1,65 @@
#!/bin/bash
# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# runtest.sh of /CoreOS/tuned/Sanity/variables-support-in-profiles
# Description: variables support in profiles
# Author: Branislav Blaskovic <bblaskov@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright Red Hat
#
# SPDX-License-Identifier: GPL-2.0-or-later WITH GPL-CC-1.0
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Include Beaker environment
. /usr/share/beakerlib/beakerlib.sh || exit 1
PACKAGE="tuned"
rlJournalStart
rlPhaseStartSetup
rlAssertRpm $PACKAGE
rlImport "tuned/basic"
rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory"
rlRun "pushd $TmpDir"
sleep 2
rlServiceStart "tuned"
sleep 2
tunedProfileBackup
rlFileBackup "/usr/lib/tuned/balanced/tuned.conf"
echo "
[variables]
SWAPPINESS1 = 70
SWAPPINESS2 = \${SWAPPINESS1}
[sysctl]
vm.swappiness = \${SWAPPINESS2}
" >> /usr/lib/tuned/balanced/tuned.conf
rlRun "cat /usr/lib/tuned/balanced/tuned.conf"
OLD_SWAPPINESS=$(sysctl -n vm.swappiness)
rlPhaseEnd
rlPhaseStartTest
rlRun "tuned-adm profile balanced"
rlRun -s "sysctl -n vm.swappiness"
rlAssertGrep "70" "$rlRun_LOG"
rlPhaseEnd
rlPhaseStartCleanup
rlRun "sysctl vm.swappiness=$OLD_SWAPPINESS"
rlFileRestore
tunedProfileRestore
sleep 2
rlServiceRestore "tuned"
rlRun "popd"
rlRun "rm -r $TmpDir" 0 "Removing tmp directory"
rlPhaseEnd
rlJournalPrintText
rlJournalEnd