1####################################################### 2# 3# Test strftime() 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 # we don't use locale-sensitive formats! 20 "results" slist => { "1973-03-03 09:46:40", "124 1 18 200000000", $(dow) }; 21 22 Monday:: 23 "dow" string => "1"; 24 Tuesday:: 25 "dow" string => "2"; 26 Wednesday:: 27 "dow" string => "3"; 28 Thursday:: 29 "dow" string => "4"; 30 Friday:: 31 "dow" string => "5"; 32 Saturday:: 33 "dow" string => "6"; 34 Sunday:: 35 "dow" string => "0"; 36 37 files: 38 "$(G.testfile).expected" 39 create => "true", 40 edit_line => init_insert; 41} 42 43bundle edit_line init_insert 44{ 45 insert_lines: 46 "$(init.results)"; 47} 48 49####################################################### 50 51bundle agent test 52{ 53 vars: 54 "vals" slist => { 55 strftime('gmtime', '%F %T', 100000000), 56 strftime('localtime', '%j %w %W %s', 200000000), 57 strftime('localtime', '%w', now()), 58 }; 59 60 files: 61 "$(G.testfile).actual" 62 create => "true", 63 edit_line => test_insert; 64} 65 66bundle edit_line test_insert 67{ 68 insert_lines: 69 "$(test.vals)"; 70} 71 72####################################################### 73 74bundle agent check 75{ 76 methods: 77 "any" usebundle => sorted_check_diff("$(G.testfile).actual", 78 "$(G.testfile).expected", 79 "$(this.promise_filename)"); 80} 81