1####################################################### 2# 3# Test getindices(), size 2 4# 5####################################################### 6 7body common control 8{ 9 inputs => { "../../default.cf.sub" }; 10 bundlesequence => { default("$(this.promise_filename)") }; 11 version => "1.0"; 12} 13 14####################################################### 15 16bundle agent init 17{ 18 vars: 19 "dummy" string => "dummy"; 20 21 files: 22 "$(G.testfile).expected" 23 create => "true", 24 edit_line => init_insert; 25} 26 27bundle edit_line init_insert 28{ 29 insert_lines: 30 "alpha"; 31 "beta"; 32} 33 34####################################################### 35 36bundle agent test 37{ 38 vars: 39 "array[alpha]" string => "zero"; 40 "array[beta]" string => "two"; 41 42 "keys" slist => getindices("array"); 43 44 files: 45 "$(G.testfile).actual" 46 create => "true", 47 edit_line => test_insert; 48 49 reports: 50 DEBUG:: 51 "Inserting line: $(keys)"; 52} 53 54bundle edit_line test_insert 55{ 56 vars: 57 "keys" slist => { @{test.keys} }; 58 59 insert_lines: 60 "$(keys)"; 61} 62 63####################################################### 64 65bundle agent check 66{ 67 methods: 68 "any" usebundle => sorted_check_diff("$(G.testfile).actual", 69 "$(G.testfile).expected", 70 "$(this.promise_filename)"); 71} 72 73