Created
June 28, 2012 19:34
-
-
Save jan-matejka/3013380 to your computer and use it in GitHub Desktop.
cfe test case
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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