###########################################################
#
# Test maparray for multi-index arrays
# Redmine#6033
#
###########################################################
body common control
{
  inputs => { "../../default.sub.cf" };
  bundlesequence => { default("$(this.promise_filename)") };
  version => "1.0";
}

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

###########################################################
bundle agent test
{
  vars:
    "bundles[x][y][z1]" string => "xyz1";
    "bundles[x][y][z23]" slist => { "xyz2", "xyz3" };
    "bundles[zculib][mypaths]" slist => { "pathsa.cf", "pathsb.cf" };
    "bundles[zculib][myservices]" slist => { "myservices.cf" };

    #make sure that below variables will be not mapped
    "bundles[zcuinventory][zcuinventory]" slist => { "inv_zcuinventory.cf" };

    "bundles[zcuinventory][inventory_fibrechannel]"
      slist => { "inv_fibrechannel.cf" };

    "bundles[zcuinventory][inventory_virtualization]"
      slist => { "inv_virtualization.cf" };

    "bundles[services][afs]" slist => { "afs.cf", "afsadm.cf" };
    "bundles[services][base]" slist => { "base.cf", "base2.cf" };
    "bundles[onelevel1]" slist => { "onelevel1_avalue", "onelevel1_bvalue" };
    "bundles[onelevel2]" string => "onelevel2value";
    "inputs" slist => maparray("zculib/$(this.v)", "bundles[zculib]");
    "merged_bundles" data => mergedata(bundles);
    "merged_zculib" data => mergedata("bundles[zculib]");
}

###########################################################
bundle agent check
{
  methods:
    "check"
      usebundle => dcs_check_state(
        test,
        "$(this.promise_filename).expected.json",
        $(this.promise_filename)
      );
}
