#######################################################
#
# Test that the 'cancel' attribute cannot undefine a hard class (CFE-4686).
#
# Cancelling a reserved hard class must be refused (with a warning) and the
# class left in place, consistent with the cancel_* classes body attributes.
#
#######################################################
body common control
{
  inputs => { "../../default.sub.cf" };
  bundlesequence => { default("$(this.promise_filename)") };
  version => "1.0";
}

#######################################################
bundle agent init
{
}

#######################################################
bundle agent test
{
  meta:
    "description" -> { "CFE-4686" }
      string => "classes promise 'cancel' attribute must not undefine a hard class";

  classes:
    # cfengine is a reserved hard class - the cancel must be ignored.
    "cfengine" cancel => "true";
}

#######################################################
bundle agent check
{
  classes:
    "ok" expression => "cfengine";

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

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