#######################################################
#
# Test services custom keyword
#
#######################################################

body common control
{
      inputs => { "../default.sub.cf" };
      bundlesequence  => { default("$(this.promise_filename)") };
      version => "1.0";
}

#######################################################

bundle agent init
{
  vars:
      "dummy" string => "dummy";
}

#######################################################

bundle agent test
{
  meta:
      "test_soft_fail" string => "windows",
        meta => { "CFE-2402" };

  services:
      "myservice"
      service_policy => "custom",
      service_method => service_test;
}

body service_method service_test {
      service_bundle => test_services("$(this.promiser)","$(this.service_policy)");
}

bundle agent test_services(service, state) {
  vars:
      "service_state" string => "$(state)";
}


#######################################################

bundle agent check
{
  classes:
      "ok" expression => strcmp("custom", "$(test_services.service_state)");

  reports:
    ok::
      "$(this.promise_filename) Pass";
    !ok::
      "$(this.promise_filename) FAIL";
}

### PROJECT_ID: core
### CATEGORY_ID: 39
