"Fossies" - the Fresh Open Source Software Archive

Member "cfengine-3.15.4/tests/acceptance/00_basics/04_bundles/non_default_def.cf" (7 Jun 2021, 701 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.

    1 # Test that 'def' bundle in a non-default namespace works
    2 
    3 body common control
    4 {
    5       inputs => { "../../default.cf.sub" };
    6       bundlesequence => { default("$(this.promise_filename)") };
    7 }
    8 
    9 body file control
   10 {
   11         namespace => "my_ns";
   12 }
   13 
   14 bundle common def
   15 {
   16   vars:
   17       "some_var" string => "some value";
   18 }
   19 
   20 body file control
   21 {
   22         namespace => "default";
   23 }
   24 
   25 bundle agent init
   26 {
   27 }
   28 
   29 bundle agent test
   30 {
   31 }
   32 
   33 bundle agent check
   34 {
   35   classes:
   36       "ok" expression => strcmp("$(my_ns:def.some_var)", "some value");
   37 
   38   reports:
   39     ok::
   40       "$(this.promise_filename) Pass";
   41     !ok.DEBUG::
   42       "my_ns:def.some_var: $(my_ns:def.some_var)";
   43     !ok::
   44       "$(this.promise_filename) FAIL";
   45 }