33# Test autorun
44#
55#######################################################
6-
76body common control
87{
9- inputs => { '../default.cf.sub' };
10- bundlesequence => { default("$(this.promise_filename)") };
11- version => "1.0";
8+ inputs => { '../default.cf.sub' };
9+ bundlesequence => { default("$(this.promise_filename)") };
10+ version => "1.0";
1211}
1312
1413bundle agent init
1514{
1615 commands:
17- "$(G.make) install DESTDIR=$(G.testdir)"
18- contain => in_dir_shell("$(this.promise_dirname)/../../..");
19- vars:
20- # If masterfiles are installed with --prefix=/other/prefix then we
21- # need to figure out where did "make install DESTDIR=..." has put
22- # the files.
23- "promises_cf_slist" slist =>
24- findfiles("$(G.testdir)/**/promises.cf");
25- "promises_cf_path" string => nth(promises_cf_slist, 0);
16+ "$(G.make) install DESTDIR=$(G.testdir)"
17+ contain => in_dir_shell("$(this.promise_dirname)/../../..");
2618
27- "masterfiles_path" string => dirname("$(promises_cf_path)");
28- "def_cf_path" string => concat("$(masterfiles_path)", "/controls/def.cf");
19+ vars:
20+ # If masterfiles are installed with --prefix=/other/prefix then we
21+ # need to figure out where did "make install DESTDIR=..." has put
22+ # the files.
23+ "promises_cf_slist" slist => findfiles("$(G.testdir)/**/promises.cf");
24+ "promises_cf_path" string => nth(promises_cf_slist, 0);
25+ "masterfiles_path" string => dirname("$(promises_cf_path)");
26+ "def_cf_path" string => concat("$(masterfiles_path)", "/controls/def.cf");
2927}
3028
3129bundle agent test
3230{
3331 meta:
34-
35-
36- "description"
37- string => "Test that enabling autorun from policy is not sufficient for activation.
32+ "description"
33+ string => "Test that enabling autorun from policy is not sufficient for activation.
3834
3935In order to prevent the parsing of files unnecessarily we guard that with the
4036definition of the services_autorun class. If that class is defined from
@@ -44,27 +40,28 @@ behavior to change so that defining from policy worked as desired. This
4440test is intended to track that specific case and if ever fixed, simply
4541update this test to allow it to pass.";
4642
47- "test_soft_fail"
48- string => "any",
49- meta => { "redmine7572", "jiraCFE2135"};
43+ "test_soft_fail"
44+ string => "any",
45+ meta => { "redmine7572", "jiraCFE2135" };
5046
5147 files:
52- "$(init.def_cf_path)" edit_line => enable_autorun;
48+ "$(init.def_cf_path)" edit_line => enable_autorun;
5349}
5450
5551bundle edit_line enable_autorun
5652{
5753 insert_lines:
58- 'bundle common __autorun_enable { classes: "services_autorun" expression => "any"; }';
54+ 'bundle common __autorun_enable { classes: "services_autorun" expression => "any"; }';
5955}
60-
6156#######################################################
62-
6357bundle agent check
6458{
6559 methods:
66- "" usebundle => dcs_passif_output(".*R: hello_world_autorun: Hello, this is an automatically loaded bundle.*",
67- "",
68- "$(sys.cf_agent) -v -f $(init.promises_cf_path) | $(G.grep) Hello",
69- $(this.promise_filename));
60+ ""
61+ usebundle => dcs_passif_output(
62+ ".*R: hello_world_autorun: Hello, this is an automatically loaded bundle.*",
63+ "",
64+ "$(sys.cf_agent) -v -f $(init.promises_cf_path) | $(G.grep) Hello",
65+ $(this.promise_filename)
66+ );
7067}
0 commit comments