Skip to content
This repository
Newer
Older
100755 46 lines (38 sloc) 1.629 kb
de083642 » htgoebel
2012-07-04 Fix she-bang line: always use `/usr/bin/env python`.
1 #!/usr/bin/env python
3ce92e6b » htgoebel
2012-07-04 Ensure all comments have a space in front of the text.
2 # Copyright (C) 2009-2010:
6bd06e02 » Gabes Jean
2011-04-04 Fix : forgot a new test.
3 # Gabes Jean, naparuba@gmail.com
4 # Gerhard Lausser, Gerhard.Lausser@consol.de
5 #
3ce92e6b » htgoebel
2012-07-04 Ensure all comments have a space in front of the text.
6 # This file is part of Shinken.
6bd06e02 » Gabes Jean
2011-04-04 Fix : forgot a new test.
7 #
3ce92e6b » htgoebel
2012-07-04 Ensure all comments have a space in front of the text.
8 # Shinken is free software: you can redistribute it and/or modify
9 # it under the terms of the GNU Affero General Public License as published by
10 # the Free Software Foundation, either version 3 of the License, or
11 # (at your option) any later version.
6bd06e02 » Gabes Jean
2011-04-04 Fix : forgot a new test.
12 #
3ce92e6b » htgoebel
2012-07-04 Ensure all comments have a space in front of the text.
13 # Shinken is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU Affero General Public License for more details.
6bd06e02 » Gabes Jean
2011-04-04 Fix : forgot a new test.
17 #
3ce92e6b » htgoebel
2012-07-04 Ensure all comments have a space in front of the text.
18 # You should have received a copy of the GNU Affero General Public License
19 # along with Shinken. If not, see <http://www.gnu.org/licenses/>.
6bd06e02 » Gabes Jean
2011-04-04 Fix : forgot a new test.
20
21 #
22 # This file is used to test reading and processing of config files
23 #
24
25 from shinken_test import *
26
27
28 class TestStarMemberGroup(ShinkenTest):
29 def setUp(self):
30 self.setup_with_file('etc/nagios_startmember_group.cfg')
31
3ce92e6b » htgoebel
2012-07-04 Ensure all comments have a space in front of the text.
32 # Check if service apply on a hostgroup * is good or not
6bd06e02 » Gabes Jean
2011-04-04 Fix : forgot a new test.
33 def test_starmembergroupdef(self):
34 hg = self.sched.conf.hostgroups.find_by_name('ping-servers')
35 self.assert_(hg is not None)
36 print hg.members
37 h = self.sched.conf.hosts.find_by_name('test_host_0')
38 r = self.sched.conf.hosts.find_by_name('test_router_0')
39 self.assert_(h in hg.members and r in hg.members)
40
41 s = self.sched.conf.services.find_srv_by_name_and_hostname('test_host_0', 'PING')
42 self.assert_(s is not None)
43
44
45 if __name__ == '__main__':
46 unittest.main()
Something went wrong with that request. Please try again.