Skip to content

Commit

Permalink
tests: improve node-control test case
Browse files Browse the repository at this point in the history
  • Loading branch information
sni committed Oct 31, 2024
1 parent 46d73bf commit fa716c8
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 3 deletions.
35 changes: 32 additions & 3 deletions t/scenarios/lmd_federation_multitier_e2e/t/local/node-control.t
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,19 @@ use strict;
use Test::More;

BEGIN {
plan tests => 36;

use lib('t');
require TestUtils;
import TestUtils;

use IO::Socket::SSL;
IO::Socket::SSL::set_ctx_defaults( SSL_verify_mode => 0 );
$ENV{PERL_LWP_SSL_VERIFY_HOSTNAME} = "0";
}

plan tests => 7;
$ENV{'THRUK_TEST_AUTH_KEY'} = "key_tier1a";
$ENV{'THRUK_TEST_AUTH_USER'} = "omdadmin";

###########################################################
# test thruks script path
Expand All @@ -18,6 +25,28 @@ TestUtils::test_command({
}) or BAIL_OUT("wrong thruk path");

TestUtils::test_command({
cmd => '/usr/bin/env thruk nc runtime tier2a',
errlike => ['/tier2a updated runtime sucessfully: OK/'],
cmd => '/usr/bin/env thruk nc facts tier1a',
errlike => ['/tier1a updated facts sucessfully: OK/'],
});

TestUtils::test_command({
cmd => '/usr/bin/env thruk nc facts tier2c',
errlike => ['/tier2c updated facts sucessfully: OK/'],
});

TestUtils::test_page(
url => 'https://localhost/demo/thruk/cgi-bin/node_control.cgi',
like => ['6.66-test'],
);

TestUtils::test_page(
url => 'https://localhost/demo/thruk/cgi-bin/node_control.cgi',
post => { "action" => "save_options", "omd_default_version" => "6.66-test" },
redirect => 1,
);

TestUtils::test_page(
url => 'https://localhost/demo/thruk/cgi-bin/node_control.cgi',
post => { "action" => "omd_restart", "peer" => "tier2c", "service" => "crontab" },
like => ['"success" : 1'],
);
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
- role: thruk_developer
- role: thruk_plugin_editor
- role: node_control_client
- role: omd_clone_fake_version
tasks:
- copy:
src: "/root/thruk_local.conf"
Expand Down
2 changes: 2 additions & 0 deletions t/scenarios/lmd_federation_multitier_e2e/tier2c/playbook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
- hosts: all
roles:
- role: common
- role: node_control_client
- role: omd_clone_fake_version
tasks:
- name: "omd config change"
shell: "omd config demo change"
Expand Down

0 comments on commit fa716c8

Please sign in to comment.