From 78d7bf2502b4dcbd2253953713fed08d3ed28aea Mon Sep 17 00:00:00 2001 From: Emilien Macchi Date: Sat, 29 Aug 2015 12:22:57 -0400 Subject: [PATCH] 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 --- run_tests.sh | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/run_tests.sh b/run_tests.sh index 154a4db07..75187ba0a 100755 --- a/run_tests.sh +++ b/run_tests.sh @@ -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