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