integration tests: use dstat to monitor system

Dstat is a tool used to monitor system in real-time. It's used by
Devstack in OpenStack gate to monitor system during jobs.
This tool would be useful for Puppet OpenStack Integration jobs so we
would be able to monitor the system during Puppet & Tempest runs, and
help us to debug eventual failures.

Change-Id: I5b6d6c662f1c23478ba0e0fb4f3d861a060abce7
Depends-On: I79c5b9521265e97595d3323149ba6e7d1e8e972b
This commit is contained in:
Emilien Macchi 2015-08-29 12:22:57 -04:00
parent bc53a53883
commit 78d7bf2502

View File

@ -39,6 +39,30 @@ function run_puppet() {
return $res
}
function is_fedora {
# note we consider CentOS 7 as fedora for now
lsb_release -i 2>/dev/null | grep -iq "fedora" || \
lsb_release -i 2>/dev/null | grep -iq "CentOS"
}
function uses_debs {
# check if apt-get is installed, valid for debian based
type "apt-get" 2>/dev/null
}
if uses_debs; then
sudo apt-get install -y dstat
elif is_fedora; then
sudo yum install -y dstat
fi
# use dstat to monitor system activity during integration testing
if type "dstat" 2>/dev/null; then
$SUDO dstat -tcmndrylpg --top-cpu-adv --top-io-adv --nocolor | sudo tee --append /var/log/dstat.log > /dev/null &
fi
$SUDO ./install_modules.sh
# Run puppet and assert something changes.
set +e
run_puppet scenario001