From d4b0934bb408c212bb356818ab2ea0df461f6796 Mon Sep 17 00:00:00 2001 From: Guillaume Rousse Date: Wed, 18 Jul 2012 09:08:12 +0200 Subject: [PATCH] reuse execution tests --- t/apps/agent.t | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/t/apps/agent.t b/t/apps/agent.t index 3d86030db2..1cd7c74c0a 100755 --- a/t/apps/agent.t +++ b/t/apps/agent.t @@ -49,7 +49,7 @@ my $base_options = "--debug --no-task ocsdeploy,wakeonlan,snmpquery,netdiscovery "$base_options --local - --no-category printer" ); -subtest "first inventory" => sub { +subtest "first inventory execution and content" => sub { check_execution_ok($err, $rc); check_content_ok($out); }; @@ -69,7 +69,7 @@ ok( "$base_options --local - --no-category printer,software" ); -subtest "second inventory" => sub { +subtest "second inventory execution and content" => sub { check_execution_ok($err, $rc); check_content_ok($out); }; @@ -103,7 +103,7 @@ close($file); ($out, $err, $rc) = run_agent( "$base_options --local - --no-category printer,software --additional-content $file" ); -subtest "third inventory" => sub { +subtest "third inventory execution and content" => sub { check_execution_ok($err, $rc); check_content_ok($out); }; @@ -138,7 +138,7 @@ my $value = $ENV{$name}; "$base_options --local - --no-category printer,software" ); -subtest "fourth inventory" => sub { +subtest "fourth inventory execution and content" => sub { check_execution_ok($err, $rc); check_content_ok($out); }; @@ -165,7 +165,7 @@ ok( "$base_options --local - --no-category printer,software,environment" ); -subtest "fifth inventory" => sub { +subtest "fifth inventory execution and content" => sub { check_execution_ok($err, $rc); check_content_ok($out); }; @@ -183,11 +183,15 @@ ok( # output location tests my $dir = File::Temp->newdir(CLEANUP => 1); ($out, $err, $rc) = run_agent("$base_options --local $dir"); -ok($rc == 0, '--local exit status'); +subtest "--local inventory execution" => sub { + check_execution_ok($err, $rc); +}; ok(<$dir/*.ocs>, '--local result file presence'); ($out, $err, $rc) = run_agent("$base_options --local $dir/foo"); -ok($rc == 0, '--local exit status'); +subtest "--local inventory execution" => sub { + check_execution_ok($err, $rc); +}; ok(-f "$dir/foo", '--local result file presence'); sub run_agent {