collect_system_info shouldn't assume that sysctl is available.

It isn't on CentOS 5.5. It didn't really assume that it
was always there, but rather than the produced samples file
would be.
This commit is contained in:
Brian Fraser fraserb@gmail.com
2012-06-04 11:57:44 -03:00
parent a976677b05
commit 865b3e4e9d
2 changed files with 21 additions and 12 deletions

View File

@@ -168,7 +168,9 @@ test_linux_exclusive_collection () {
local PT_SUMMARY_SKIP=""
mkdir "$dir/1"
cp "$dir/sysctl" "$dir/1/"
if [ -e "$dir/sysctl" ]; then
cp "$dir/sysctl" "$dir/1/"
fi
linux_exclusive_collection "$dir/1"
is \
@@ -183,7 +185,9 @@ test_linux_exclusive_collection () {
done
mkdir "$dir/2"
cp "$dir/sysctl" "$dir/2/"
if [ -e "$dir/sysctl" ]; then
cp "$dir/sysctl" "$dir/2/"
fi
linux_exclusive_collection "$dir/2"
is \
@@ -205,8 +209,11 @@ platform="$(get_var platform "$p/summary")"
if [ "$platform" = "Linux" ]; then
mkdir "$TMPDIR/linux_data"
cp "$p/sysctl" "$TMPDIR/linux_data/sysctl"
if [ -e "$p/sysctl" ]; then
cp "$p/sysctl" "$TMPDIR/linux_data/sysctl"
fi
test_linux_exclusive_collection "$TMPDIR/linux_data"
rm -rf "$TMPDIR/linux_data"
else
skip 1 5 "Tests exclusive for Linux"
fi