Skip to content

Commit 5041956

Browse files
authored
Merge pull request #77 from redhat-performance/check_tuned
Check tuned to make sure did not change, also is set when told to set.
2 parents 424d8d8 + b6ec45e commit 5041956

File tree

2 files changed

+37
-1
lines changed

2 files changed

+37
-1
lines changed

general_setup

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,10 @@ do
187187
if [[ $value != *"none"* ]]; then
188188
to_tuned_setting="${value}"
189189
if [ -f /usr/sbin/tuned-adm ]; then
190-
tuned-adm active ${value}
190+
tuned-adm profile ${value}
191+
if [[ $? -ne 0 ]]; then
192+
echo Warning: Unable to set tuned profile $value.
193+
fi
191194
else
192195
echo Warning: asking for tuned setting $value, but tuned-adm is not installed.
193196
fi
@@ -222,6 +225,19 @@ fi
222225
if [[ $to_tuned_setting == "" ]]; then
223226
to_tuned_setting=`${TOOLS_BIN}/get_tuned_setting`
224227
fi
228+
229+
#
230+
# Get the actual setting of the tuned for future comparison,
231+
# Do not depend on $to_tuned_setting. It might not have set
232+
# properly to start with.
233+
#
234+
which tuned-adm >> /dev/null 2>&1
235+
if [[ $? -ne 0 ]]; then
236+
echo tuned-adm not available > ~/tuned_before
237+
else
238+
tuned-adm active | cut -d: -f 2 | sed "s/ //g" > ~/tuned_before
239+
fi
240+
225241
if [[ $to_test_verify_file != "" ]]; then
226242
$TOOLS_BIN/verification --test_cmd $test_cmd --test_name $test_name --verify_file $to_test_verify_file --run_user $to_user --home_parent $to_home_root
227243
exit $?

save_results

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,26 @@ mkdir -p ${RESULTS_PATH}
172172

173173
copy_file $results $RESULTS_PATH
174174

175+
which tuned-adm >> /dev/null 2>&1
176+
if [[ $? -ne 0 ]]; then
177+
echo tuned-adm not available > ~/tuned_after
178+
else
179+
tuned-adm active | cut -d: -f 2 | sed "s/ //g" > ~/tuned_after
180+
fi
181+
diff ~/tuned_before ~/tuned_after > $RESULTS_PATH/tuned_setting
182+
183+
if [[ $? -ne -0 ]]; then
184+
echo 'Tuned settings have changed!!!!'
185+
echo Start of run
186+
cat ~/tuned_before
187+
echo End of run
188+
cat ~/tuned_after
189+
echo 'Tuned settings have changed!!!!' >> $RESULTS_PATH/tuned_setting
190+
else
191+
echo "Tuned stayed the same." >> $RESULTS_PATH/tuned_setting
192+
fi
193+
194+
175195
if [[ $other_files != "" ]]; then
176196
file_list=`echo $other_files | sed "s/,/ /g"`
177197
for i in $file_list; do

0 commit comments

Comments
 (0)