forked from elastic/apm-server
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add tests for template setup. fixes elastic#1922
- Loading branch information
Showing
4 changed files
with
77 additions
and
34 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
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,31 @@ | ||
import unittest | ||
|
||
from apmserver import SubCommandTest | ||
from beat.beat import INTEGRATION_TESTS | ||
|
||
|
||
class SetupTemplateDefaultTest(SubCommandTest): | ||
""" | ||
Test setup template subcommand with default option. | ||
""" | ||
|
||
def start_args(self): | ||
return { | ||
"logging_args": ["-v", "-d", "*"], | ||
"extra_args": ["-e", | ||
"setup", | ||
"-template"] | ||
} | ||
|
||
@unittest.skipUnless(INTEGRATION_TESTS, "integration test") | ||
def test_setup_default_template(self): | ||
""" | ||
Test setup default template | ||
""" | ||
|
||
assert self.es.indices.exists_template(name='apm-*') | ||
assert self.log_contains("Loaded index template") | ||
assert self.log_contains("Index setup complete") | ||
# by default overwrite is set to true when `setup` cmd is run | ||
assert self.log_contains("Existing template will be overwritten, as overwrite is enabled.") | ||
self.assertNotRegexpMatches(self.get_log(), "ILM") |