Skip to content

Commit ece3392

Browse files
larsewibtriller
authored andcommitted
Added acceptance tests for log mode hard classes
Ticket: CFE-4126 Signed-off-by: Lars Erik Wik <lars.erik.wik@northern.tech>
1 parent 4325e05 commit ece3392

File tree

7 files changed

+213
-0
lines changed

7 files changed

+213
-0
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
bundle agent main
2+
{
3+
reports:
4+
debug_mode.opt_debug::
5+
"is debug mode";
6+
verbose_mode::
7+
"is verbose mode";
8+
inform_mode::
9+
"is inform mode";
10+
notice_mode::
11+
"is notice mode";
12+
warning_mode::
13+
"is warning mode";
14+
error_mode::
15+
"is error mode";
16+
}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#######################################################
2+
#
3+
# Test mode_debug hard class
4+
#
5+
#######################################################
6+
7+
body common control
8+
{
9+
inputs => { "../../default.cf.sub" };
10+
bundlesequence => { default("$(this.promise_filename)") };
11+
version => "1.0";
12+
}
13+
14+
#######################################################
15+
16+
bundle agent test
17+
{
18+
meta:
19+
"description" -> { "CFE-4126" }
20+
string => "Test mode debug class";
21+
}
22+
23+
#######################################################
24+
25+
bundle agent check
26+
{
27+
methods:
28+
"Check Agent Output"
29+
usebundle => dcs_passif_output1(".*R: is debug mode.*",
30+
"$(sys.cf_agent) --log-level debug -Kf $(this.promise_dirname)/log_mode.cf.sub",
31+
"$(this.promise_filename)");
32+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#######################################################
2+
#
3+
# Test mode_error hard class
4+
#
5+
#######################################################
6+
7+
body common control
8+
{
9+
inputs => { "../../default.cf.sub" };
10+
bundlesequence => { default("$(this.promise_filename)") };
11+
version => "1.0";
12+
}
13+
14+
#######################################################
15+
16+
bundle agent test
17+
{
18+
meta:
19+
"description" -> { "CFE-4126" }
20+
string => "Test mode error class";
21+
}
22+
23+
#######################################################
24+
25+
bundle agent check
26+
{
27+
methods:
28+
"Check Agent Output"
29+
usebundle => dcs_passif_output(".*R: is error mode.*",
30+
".*R: is (debug|verbose|inform|notice|warning) mode.*",
31+
"$(sys.cf_agent) --log-level error -Kf $(this.promise_dirname)/log_mode.cf.sub",
32+
"$(this.promise_filename)");
33+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#######################################################
2+
#
3+
# Test mode_inform hard class
4+
#
5+
#######################################################
6+
7+
body common control
8+
{
9+
inputs => { "../../default.cf.sub" };
10+
bundlesequence => { default("$(this.promise_filename)") };
11+
version => "1.0";
12+
}
13+
14+
#######################################################
15+
16+
bundle agent test
17+
{
18+
meta:
19+
"description" -> { "CFE-4126" }
20+
string => "Test mode inform class";
21+
}
22+
23+
#######################################################
24+
25+
bundle agent check
26+
{
27+
methods:
28+
"Check Agent Output"
29+
usebundle => dcs_passif_output(".*R: is inform mode.*",
30+
".*R: is (debug|verbose) mode.*",
31+
"$(sys.cf_agent) --log-level inform -Kf $(this.promise_dirname)/log_mode.cf.sub",
32+
"$(this.promise_filename)");
33+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#######################################################
2+
#
3+
# Test mode_notice hard class
4+
#
5+
#######################################################
6+
7+
body common control
8+
{
9+
inputs => { "../../default.cf.sub" };
10+
bundlesequence => { default("$(this.promise_filename)") };
11+
version => "1.0";
12+
}
13+
14+
#######################################################
15+
16+
bundle agent test
17+
{
18+
meta:
19+
"description" -> { "CFE-4126" }
20+
string => "Test mode notice class";
21+
}
22+
23+
#######################################################
24+
25+
bundle agent check
26+
{
27+
methods:
28+
"Check Agent Output"
29+
usebundle => dcs_passif_output(".*R: is notice mode.*",
30+
".*R: is (debug|verbose|inform) mode.*",
31+
"$(sys.cf_agent) --log-level notice -Kf $(this.promise_dirname)/log_mode.cf.sub",
32+
"$(this.promise_filename)");
33+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#######################################################
2+
#
3+
# Test mode_verbose hard class
4+
#
5+
#######################################################
6+
7+
body common control
8+
{
9+
inputs => { "../../default.cf.sub" };
10+
bundlesequence => { default("$(this.promise_filename)") };
11+
version => "1.0";
12+
}
13+
14+
#######################################################
15+
16+
bundle agent test
17+
{
18+
meta:
19+
"description" -> { "CFE-4126" }
20+
string => "Test mode verbose class";
21+
}
22+
23+
#######################################################
24+
25+
bundle agent check
26+
{
27+
methods:
28+
"Check Agent Output"
29+
usebundle => dcs_passif_output(".*R: is verbose mode.*",
30+
".*R: is debug mode.*",
31+
"$(sys.cf_agent) --log-level verbose -Kf $(this.promise_dirname)/log_mode.cf.sub",
32+
"$(this.promise_filename)");
33+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#######################################################
2+
#
3+
# Test mode_warning hard class
4+
#
5+
#######################################################
6+
7+
body common control
8+
{
9+
inputs => { "../../default.cf.sub" };
10+
bundlesequence => { default("$(this.promise_filename)") };
11+
version => "1.0";
12+
}
13+
14+
#######################################################
15+
16+
bundle agent test
17+
{
18+
meta:
19+
"description" -> { "CFE-4126" }
20+
string => "Test mode warning class";
21+
}
22+
23+
#######################################################
24+
25+
bundle agent check
26+
{
27+
methods:
28+
"Check Agent Output"
29+
usebundle => dcs_passif_output(".*R: is warning mode.*",
30+
".*R: is (debug|verbose|inform|notice) mode.*",
31+
"$(sys.cf_agent) --log-level warning -Kf $(this.promise_dirname)/log_mode.cf.sub",
32+
"$(this.promise_filename)");
33+
}

0 commit comments

Comments
 (0)