From 427a0698018c5cfc46a698a22391cd6a1b148ae6 Mon Sep 17 00:00:00 2001 From: Daniel Nichter Date: Fri, 30 Mar 2012 15:02:45 -0600 Subject: [PATCH] Test that vmstatu runs for --run-time with --no-stalk. --- t/pt-stalk/pt-stalk.t | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/t/pt-stalk/pt-stalk.t b/t/pt-stalk/pt-stalk.t index 7e44dea8..9e628797 100644 --- a/t/pt-stalk/pt-stalk.t +++ b/t/pt-stalk/pt-stalk.t @@ -24,7 +24,7 @@ if ( !$dbh ) { plan skip_all => 'Cannot connect to sandbox master'; } else { - plan tests => 25; + plan tests => 26; } my $cnf = "/tmp/12345/my.sandbox.cnf"; @@ -263,6 +263,17 @@ is( "Not stalking, collect ran for --run-time" ); +my $vmstat = `which vmstat 2>/dev/null`; +SKIP: { + skip "vmstat is not installed", 1 unless $vmstat; + chomp(my $n=`awk '/[ ]*[0-9]/ { n += 1 } END { print n }' "$dest/nostalk-vmstat"`); + is( + $n, + "2", + "vmstat ran for --run-time seconds (bug 955860)" + ); +}; + is( `cat $dest/nostalk-hostname`, `hostname`,