blob: ef2af2497758c1bc3fbc264622f466b2a10fb95e [file] [log] [blame]
Éric Lemoine71272712016-11-08 12:53:51 +00001-- Copyright 2015 Mirantis, Inc.
2--
3-- Licensed under the Apache License, Version 2.0 (the "License");
4-- you may not use this file except in compliance with the License.
5-- You may obtain a copy of the License at
6--
7-- http://www.apache.org/licenses/LICENSE-2.0
8--
9-- Unless required by applicable law or agreed to in writing, software
10-- distributed under the License is distributed on an "AS IS" BASIS,
11-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12-- See the License for the specific language governing permissions and
13-- limitations under the License.
14
15require('luaunit')
16package.path = package.path .. ";../heka/files/lua/common/?.lua;lua/mocks/?.lua"
17
18local gse_utils = require('gse_utils')
19local consts = require('gse_constants')
20
21TestGseUtils = {}
22
23 function TestGseUtils:test_max_status()
24 local status = gse_utils.max_status(consts.DOWN, consts.WARN)
25 assertEquals(consts.DOWN, status)
26 local status = gse_utils.max_status(consts.OKAY, consts.WARN)
27 assertEquals(consts.WARN, status)
28 local status = gse_utils.max_status(consts.OKAY, consts.DOWN)
29 assertEquals(consts.DOWN, status)
30 local status = gse_utils.max_status(consts.UNKW, consts.DOWN)
31 assertEquals(consts.DOWN, status)
32 end
33
34lu = LuaUnit
35lu:setVerbosity( 1 )
36os.exit( lu:run() )