Skip to content

Instantly share code, notes, and snippets.

@jan-matejka
Created June 28, 2012 19:34
Show Gist options
  • Select an option

  • Save jan-matejka/3013380 to your computer and use it in GitHub Desktop.

Select an option

Save jan-matejka/3013380 to your computer and use it in GitHub Desktop.
cfe test case
#!/var/cfengine/bin/cf-agent -f
# vim: foldmethod=marker:foldmarker={,}
# is there a way to make subtest execute for each instance of t_ ?
# actual output:
# R: subtest rep: test: 1
# R: rep: test: 1
# R: rep: test: 2
# R: rep: test: 3
# expected output:
# R: subtest rep: test: 1
# R: rep: test: 1
# R: rep: test: 2
# R: subtest rep: test: 2
# R: rep: test: 3
# R: subtest rep: test: 3
body common control {
bundlesequence => {
t
};
inputs => {
"cfengine_stdlib.cf",
};
}
bundle agent t {
methods:
"t1" usebundle => t_(1);
"t2" usebundle => t_(2);
"t3" usebundle => t_(3);
}
bundle agent t_(a) {
vars:
"ke" string => "test: ${a}",
policy => "overridable";
methods:
"subtest" usebundle => subtest;
reports:
cfengine::
"rep: ${ke}";
}
bundle agent subtest {
reports:
cfengine::
"subtest rep: ${t_.ke}";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment