#######################################################
#
# Test command modules
# Redmine#7302: support persistent classes
#
#######################################################
body common control
{
  inputs => { "../../default.sub.cf", "../../plucked.sub.cf" };
  bundlesequence => { default("$(this.promise_filename)") };
  version => "1.0";
}

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

bundle agent check
{
  vars:
    "command"
      string => "($(sys.cf_agent) -Kvf $(this.promise_filename).sub; $(sys.cf_promises) -v)| $(G.grep) 'x4eXfWrHT0zsSbrAXh5jFnRnDLKqNsP'";

  methods:
    # sample output
    # verbose: Module set persistent class 'Cx4eXfWrHT0zsSbrAXh5jFnRnDLKqNsP' for 20 minutes
    # verbose: Adding persistent class 'Cx4eXfWrHT0zsSbrAXh5jFnRnDLKqNsP' to heap
    # note we check that Ax4eXfWrHT0zsSbrAXh5jFnRnDLKqNsP and Bx4eXfWrHT0zsSbrAXh5jFnRnDLKqNsP are not set persistently!
    "check"
      usebundle => dcs_passif_output(
        ".*Module set persistent class 'Cx4eXfWrHT0zsSbrAXh5jFnRnDLKqNsP' for 20 minutes.*",
        ".*Module set persistent class '[AB]x4eXfWrHT0zsSbrAXh5jFnRnDLKqNsP'.*",
        $(command),
        $(this.promise_filename)
      );
}

### PROJECT_ID: core
### CATEGORY_ID: 27
