mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-09 15:39:03 +00:00
Fix Bash tests. Add basic pt-align tests.
This commit is contained in:
@@ -31,8 +31,10 @@ $sb->create_dbs($dbh, ['test']);
|
||||
my $output;
|
||||
my $cnf = '/tmp/12345/my.sandbox.cnf';
|
||||
my $cmd = "$trunk/bin/pt-heartbeat -F $cnf ";
|
||||
my $pid_file = "/tmp/__mk-heartbeat-test.pid";
|
||||
my $ps_grep_cmd = "ps x | grep mk-heartbeat | grep daemonize | grep -v grep";
|
||||
my $pid_file = "/tmp/__pt-heartbeat-test.pid";
|
||||
my $ps_grep_cmd = "ps x | grep pt-heartbeat | grep daemonize | grep -v grep";
|
||||
|
||||
`rm /tmp/pt-heartbeat-sentinel 2>/dev/null`;
|
||||
|
||||
$dbh->do('drop table if exists test.heartbeat');
|
||||
$dbh->do(q{CREATE TABLE test.heartbeat (
|
||||
@@ -40,7 +42,7 @@ $dbh->do(q{CREATE TABLE test.heartbeat (
|
||||
ts datetime NOT NULL
|
||||
) ENGINE=MEMORY});
|
||||
|
||||
# Issue: mk-heartbeat should check that the heartbeat table has a row
|
||||
# Issue: pt-heartbeat should check that the heartbeat table has a row
|
||||
$output = `$cmd -D test --check --no-insert-heartbeat-row 2>&1`;
|
||||
like($output, qr/heartbeat table is empty/ms, 'Dies on empty heartbeat table with --check (issue 45)');
|
||||
|
||||
@@ -100,8 +102,8 @@ like($output, qr/Successfully created/, 'Created sentinel');
|
||||
sleep(2);
|
||||
$output = `$ps_grep_cmd`;
|
||||
unlike($output, qr/$cmd/, 'It is not running');
|
||||
ok(-f '/tmp/mk-heartbeat-sentinel', 'Sentinel file is there');
|
||||
unlink('/tmp/mk-heartbeat-sentinel');
|
||||
ok(-f '/tmp/pt-heartbeat-sentinel', 'Sentinel file is there');
|
||||
unlink('/tmp/pt-heartbeat-sentinel');
|
||||
$dbh->do('drop table if exists test.heartbeat'); # This will kill it
|
||||
|
||||
# #############################################################################
|
||||
|
Reference in New Issue
Block a user