forked from redhat-performance/tuned
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bcbf2a5
commit 5e5dd15
Showing
2 changed files
with
92 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
#!/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" | ||
rlServiceStart "tuned" | ||
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 | ||
rlServiceRestore "tuned" | ||
rlRun "popd" | ||
rlRun "rm -r $TmpDir" 0 "Removing tmp directory" | ||
rlPhaseEnd | ||
rlJournalPrintText | ||
rlJournalEnd |