-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #79 from VinceMacBuche/ust_5211/5213/add_class_noop
Fixes #5213: Add class_noop generic_method
- Loading branch information
Showing
3 changed files
with
95 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
####################################################### | ||
# | ||
# Test if only noop classes are created | ||
# | ||
####################################################### | ||
|
||
bundle common acc_path | ||
{ | ||
vars: | ||
"root" string => getenv("NCF_TESTS_ACCEPTANCE", 1024); | ||
} | ||
|
||
body common control | ||
{ | ||
inputs => { "${acc_path.root}/default.cf.sub", "${acc_path.root}/default_ncf.cf.sub", "@{ncf_inputs.default_files}" }; | ||
bundlesequence => { default("$(this.promise_filename)") }; | ||
version => "1.0"; | ||
} | ||
|
||
####################################################### | ||
|
||
bundle agent init | ||
{ | ||
vars: | ||
"tmp" string => getenv("TEMP", 1024); | ||
} | ||
|
||
####################################################### | ||
|
||
bundle agent test | ||
{ | ||
methods: | ||
"ph1" usebundle => _classes_noop("my_class"); | ||
|
||
} | ||
|
||
####################################################### | ||
|
||
bundle agent check | ||
{ | ||
classes: | ||
"ok_noop" and => { "my_class_noop" }; | ||
"ok_success" expression => "!(promise_kept_my_class|my_class_kept|my_class_not_repaired|my_class_ok|my_class_reached)"; | ||
"ok_repaired" expression => "!(promise_repaired_my_class|my_class_repaired)"; | ||
"ok_error" expression => "!(repair_failed_my_class|repair_denied_class_my_class|repair_timeout_my_class|my_class_failed|my_class_not_ok|my_class_not_kept|my_class_denied|my_class_timeout)"; | ||
"ok" and => { "ok_noop", "ok_success", "ok_repaired", "ok_error" }; | ||
|
||
reports: | ||
ok:: | ||
"$(this.promise_filename) Pass"; | ||
!ok:: | ||
"$(this.promise_filename) FAIL"; | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
##################################################################################### | ||
# Copyright 2013 Normation SAS | ||
##################################################################################### | ||
# | ||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation, Version 3. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
# | ||
##################################################################################### | ||
|
||
# @name Classes noop definition | ||
# @description Defines noop classes based on a prefix | ||
# | ||
# @parameter class_prefix The prefix of the noop class to defined | ||
# | ||
# @class_prefix | ||
# @class_parameter | ||
# This bundle will define a class ${class_prefix}_noop | ||
|
||
bundle agent _classes_noop(class_prefix) | ||
{ | ||
vars: | ||
"suffix" slist => { "noop" }; | ||
|
||
"local_${suffix}" | ||
string => "${class_prefix}_${suffix}", | ||
classes => always("${class_prefix}_${suffix}"); | ||
} | ||
|
||
|
This file contains 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