From 14791eda512b8d4f9b1f2a494d0480ee38cef348 Mon Sep 17 00:00:00 2001 From: Victor Seva Date: Thu, 16 Jul 2015 12:26:03 +0200 Subject: [PATCH] MT#14011 fail if no config is found on tests that need it Change-Id: I16ddebd5b3c3559599c1aadf997077746f221538 --- ce/01_running-processes.t | 8 ++++++-- pro/03_open-ports.t | 7 +++++-- pro/03_sites-ok.t | 8 ++++++-- 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/ce/01_running-processes.t b/ce/01_running-processes.t index 3a21534..5f0637f 100755 --- a/ce/01_running-processes.t +++ b/ce/01_running-processes.t @@ -38,8 +38,12 @@ if ($Bin =~ m{/.+(ce|pro)$}) { } } my $config = LoadFile($file_config); -plan 'skip_all' => "no configuration sections for 'running-processes'" - if (not $config or not $config->{'running-processes'}); +do { + fail("no configuration sections for 'running-processes'"); + done_testing(); + exit 1; +} if (not $config or not $config->{'running-processes'}); + exit main(); diff --git a/pro/03_open-ports.t b/pro/03_open-ports.t index 12cfabf..8da5ce1 100755 --- a/pro/03_open-ports.t +++ b/pro/03_open-ports.t @@ -41,8 +41,11 @@ if ($Bin =~ m{/.+(ce|pro)$}) { } } my $config = LoadFile($file_config); -plan 'skip_all' => "no configuration sections for 'open-ports'" - if (not $config or not $config->{'open-ports'}); +do { + fail("no configuration sections for 'open-ports'"); + done_testing(); + exit 1; +} if (not $config or not $config->{'open-ports'}); my $netstat=`netstat -anu`; diff --git a/pro/03_sites-ok.t b/pro/03_sites-ok.t index c56265f..856a563 100755 --- a/pro/03_sites-ok.t +++ b/pro/03_sites-ok.t @@ -39,8 +39,12 @@ if ($Bin =~ m{/.+(ce|pro)$}) { } } my $config = LoadFile($file_config); -plan 'skip_all' => "no configuration sections for 'sites-ok'" - if (not $config or not $config->{'sites-ok'}); +do { + fail("no configuration sections for 'sites-ok'"); + done_testing(); + exit 1; +} if (not $config or not $config->{'sites-ok'}); + exit main();