1#######################################################
2#
3# Test that getindices() returns the expected list from
4# a data container
5#
6#######################################################
7
8body common control
9{
10      inputs => { "../../default.cf.sub" };
11      bundlesequence  => { default("$(this.promise_filename)") };
12      version => "1.0";
13}
14
15#######################################################
16
17bundle agent init
18{
19  vars:
20    "data" data => parsejson('{
21  "foo": [
22          "alpha",
23          "bravo"
24         ],
25  "bar": { "one": "1"  "two": "2" }
26}');
27}
28
29#######################################################
30
31bundle agent test
32{
33  meta:
34      "test_soft_fail" string => "!any",
35        meta => { "redmine7116" };
36
37  vars:
38      # expected: one, two
39      "values_data" slist => getindices("init.data[bar]");
40}
41
42#######################################################
43
44bundle agent check
45{
46  methods:
47      "check"  usebundle => dcs_check_state(test,
48                                           "$(this.promise_filename).expected.json",
49                                           $(this.promise_filename));
50}
51