-
Notifications
You must be signed in to change notification settings - Fork 338
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1463 from gst/fix_template_self_use
Fix : Infinite recursion when template uses itself
- Loading branch information
Showing
4 changed files
with
51 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
|
||
from shinken_test import ShinkenTest | ||
|
||
|
||
class TestConfig(ShinkenTest): | ||
|
||
def setUp(self): | ||
pass # force no setUp for this class. | ||
|
||
def test_bad_template_use_itself(self): | ||
self.setup_with_file('etc/bad_template_use_itself.cfg') | ||
self.assertIn(u"Host u'bla' use/inherits from itself ! Imported from: etc/bad_template_use_itself.cfg:1", | ||
self.conf.hosts.configuration_errors) | ||
|
||
def test_bad_host_use_undefined_template(self): | ||
self.setup_with_file('etc/bad_host_use_undefined_template.cfg') | ||
self.assertIn(u"Host u'bla' use/inherit from an unknown template (u'undefined') ! Imported from: etc/bad_host_use_undefined_template.cfg:2", | ||
self.conf.hosts.configuration_warnings) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
|
||
define host { | ||
host_name bla | ||
use undefined | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
define host { | ||
name bla | ||
use bla | ||
register 0 | ||
} |