Updated testing for filter selects in reports
[ninja.git] / test / unit_test / reports / timeperiod.tst
blob04906cfb5b123be9f595e2f1d19648eb8359451f
1 description = Reports using timeperiods
2 logfile = softstates.log
4 # for now, these tests only work when run on CET-using machine
6 global_vars {
7         # mon feb 11 00:00:00 CET 2008
8         start_time = 1202684400
9         # tue feb 12 00:00:00 CET 2008
10         end_time = 1202770800
11         report_type = hosts
12         objects {
13                 testhost
14         }
15         timeperiod {
16                 timeperiod_name = an_exclude
17                 2008-02-11 = 22:00-23:30
18         }
21 monday lunchtime 12:00-13:00 {
22         timeperiod {
23                 monday = 12:00-13:00
24         }
25         correct {
26                 TIME_UP_UNSCHEDULED = 3600
27                 TIME_INACTIVE = 82800
28         }
31 simple timeperiod {
32         timeperiod {
33                 monday = 02:15-03:25
34         }
35         correct {
36                 TIME_UP_UNSCHEDULED = 4200
37                 TIME_INACTIVE = 82200
38                 TOTAL_TIME_ACTIVE = 4200
39         }
42 slightly tricksier timeperiod {
43         timeperiod {
44                 monday = 02:15-03:25,04:15-05:25
45         }
46         correct {
47                 TIME_UP_UNSCHEDULED = 8400
48                 TIME_INACTIVE = 78000
49                 TOTAL_TIME_ACTIVE = 8400
50         }
53 tricksy timeperiod indeed {
54         timeperiod {
55                 monday = 00:15-00:25,01:15-01:25,02:15-02:25,03:15-03:25,04:00-05:00
56         }
57         correct {
58                 TIME_UP_UNSCHEDULED = 6000
59                 TIME_INACTIVE = 80400
60                 TOTAL_TIME_ACTIVE = 6000
61         }
64 timeperiod with simple exception {
65         timeperiod {
66                 monday = 00:00-24:00
67                 2008-02-11 = 22:00-23:30
68         }
69         correct {
70                 TIME_UP_UNSCHEDULED = 4200
71                 TIME_DOWN_UNSCHEDULED = 1200
72                 TIME_INACTIVE = 81000
73         }
76 # ensure that exceptions are only added once
77 timeperiod with simple exception and three days {
78         # sun feb 10 00:00:00 CET 2008
79         start_time = 1202598000
80         # wed feb 13 00:00:00 CET 2008
81         end_time = 1202857200
82         timeperiod {
83                 monday = 00:00-24:00
84                 2008-02-11 = 22:00-23:30
85         }
86         correct {
87                 TIME_UP_UNSCHEDULED = 4200
88                 TIME_DOWN_UNSCHEDULED = 1200
89                 TIME_INACTIVE = 253800
90         }
93 timeperiod with simple excludes {
94         timeperiod {
95                 monday = 00:00-24:00
96                 excludes {
97                         0 = an_exclude
98                 }
99         }
100         correct {
101                 TIME_UP_UNSCHEDULED = 79200
102                 TIME_DOWN_UNSCHEDULED = 1800
103                 TIME_INACTIVE = 5400
104         }
107 # apparently, some versions have failed to set the "down" event's stop to the
108 # timeperiod end, rather than the report period end.
109 another timeperiod {
110         timeperiod {
111                 monday = 23:00-23:30
112         }
113         correct {
114                 TIME_UP_UNSCHEDULED = 600
115                 TIME_DOWN_UNSCHEDULED = 1200
116                 TIME_INACTIVE = 84600
117         }