# Redmine#4025

body common control
{
      inputs => { "../../default.sub.cf", "namespaced.cf.sub" };
      bundlesequence => {
                          ns1:mytest("x"),
                          ns2:mytest("x", "y"),
                          default("$(this.promise_filename)") };
      version => "1.0";
}

bundle agent init
{
}

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

bundle agent check
{
  vars:
      "checks" slist => { "ns1:ns1global", "ns2:ns2global", "ns1:ns1global_from_ppkeys", "ns1:ns1global_from_ppkeys_explicit",
                          "ns1global", "ns2global",
                          "ok_ns1string", "ok_ns2string", "ok_ns2string2",
      };

  classes:
      "ok_ns1string" expression => strcmp($(ns1:mytest.ns1string), $(this.promise_dirname));
      "ok_ns2string" expression => strcmp($(ns2:mytest.ns2string), $(sys.fqhost));
      "ok_ns2string2" expression => strcmp($(ns2:mytest.ns2string2), $(const.t));

      "ok" and => { "ns1:ns1global", "ns2:ns2global", "ns1:ns1global_from_ppkeys", "ns1:ns1ppkeys",
                    "!ns1global", "!ns2global",
                    "ok_ns1string", "ok_ns2string", "ok_ns2string2",
      };

  reports:
    EXTRA::
      "class $(checks) is ON" if => $(checks);
    EXTRA::
      "class $(checks) is OFF" if => "!$(checks)";
    DEBUG.ns1:ns1global_from_ppkeys::
      "ns1:ns1global_from_ppkeys is on as expected";
    DEBUG.ns1:ns1global_from_ppkeys_explicit::
      "ns1:ns1global_from_ppkeys_explicit is on as expected";
    DEBUG.!ns1:ns1global_from_ppkeys::
      "ns1:ns1global_from_ppkeys is NOT on as expected";
    DEBUG.!ns1:ns1global_from_ppkeys_explicit::
      "ns1:ns1global_from_ppkeys_explicit is NOT on as expected";
    ok::
      "$(this.promise_filename) Pass";
    !ok::
      "$(this.promise_filename) FAIL";
}
