"Fossies" - the Fresh Open Source Software Archive

Member "cfengine-3.15.4/tests/acceptance/00_basics/ifelapsed_and_expireafter/redmine_6334.cf" (7 Jun 2021, 2391 Bytes) of package /linux/misc/cfengine-3.15.4.tar.gz:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the latest Fossies "Diffs" side-by-side code changes report for "redmine_6334.cf": 3.15.3_vs_3.15.4.

    1 body common control
    2 {
    3       inputs => { "../../default.cf.sub" };
    4       bundlesequence  => { default("$(this.promise_filename)") };
    5       version => "1.0";
    6 }
    7 
    8 bundle agent test
    9 {
   10   meta:
   11     "test_flakey_fail" string => "sunos_5_11.sparc",
   12       meta => { "ENT-7068" };
   13 
   14   vars:
   15       "first"
   16         string =>
   17           execresult("$(sys.cf_agent) -KIf $(this.promise_filename).sub -b example -Dfirst",
   18                      "noshell"),
   19         comment => "Ignore locks in this first run - it will still write the locks!";
   20 
   21       "second"
   22         string =>
   23           execresult("$(sys.cf_agent) -If $(this.promise_filename).sub -b example -Dsecond",
   24                      "noshell"),
   25         comment => "Don't ignore locks here so for pass_only_first_test_second case";
   26 }
   27 
   28 bundle agent check
   29 {
   30   vars:
   31       "pass_strings" slist => { "test", "call_report_now", "only_first", "abort_now" };
   32       "activations" slist => { "test.first", "test.second" };
   33 
   34 # we want to see all of those in either "test.first" or "test.second"
   35       "pass_classes" slist => {
   36                               "pass_test_test_first",
   37                               "pass_call_report_now_test_first",
   38                               "pass_test_test_second",
   39                               "pass_call_report_now_test_second",
   40                               "pass_only_first_test_first",
   41                               };
   42 
   43 # we don't want to any of those in neither "test.first" nor "test.second"
   44       "fail_classes" slist => {
   45                               "pass_only_first_test_second",
   46                               "pass_abort_now_test_first",
   47                               "pass_abort_now_test_second"
   48                               };
   49 
   50   classes:
   51       "pass_$(pass_strings)_$(activations)" expression => regcmp(".*R: Called from $(pass_strings).*",
   52                                                                  "$($(activations))");
   53 
   54       "ok_pass" and => { @(pass_classes) };
   55       "fail_pass" or => { @(fail_classes) };
   56 
   57       "ok" expression => "ok_pass.!fail_pass";
   58 
   59   reports:
   60     DEBUG.!ok::
   61       "Failed activation $(activations): '$($(activations))'";
   62     DEBUG::
   63       "expected  : $(pass_classes)" ifvarclass => not("$(pass_classes)");
   64       "unexpected: $(fail_classes)" ifvarclass => "$(fail_classes)";
   65     ok::
   66       "$(this.promise_filename) Pass";
   67     !ok::
   68       "$(this.promise_filename) FAIL";
   69 }