Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
F
flame-clmc
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
flame
flame-clmc
Commits
55df381e
Commit
55df381e
authored
7 years ago
by
MJB
Browse files
Options
Downloads
Patches
Plain Diff
fixed merge conflicts causing rspec check failure in telegraf-agents test
parent
2d27ecda
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
test/telegraf-agents/test_rspec.py
+1
-1
1 addition, 1 deletion
test/telegraf-agents/test_rspec.py
test/telegraf-agents/test_telegraf_agents.py
+18
-4
18 additions, 4 deletions
test/telegraf-agents/test_telegraf_agents.py
with
19 additions
and
5 deletions
test/telegraf-agents/test_rspec.py
+
1
−
1
View file @
55df381e
...
...
@@ -11,7 +11,7 @@ import pytest
'
nginx
'
,
'
mongo
'
,
'
ffmpeg
'
,
'
ipendpoin
t
'
'
hos
t
'
])
def
test_service_name
(
telegraf_agent_config
,
service_name
):
"""
...
...
This diff is collapsed.
Click to expand it.
test/telegraf-agents/test_telegraf_agents.py
+
18
−
4
View file @
55df381e
#!/usr/bin/python3
import
pytest
from
subprocess
import
run
from
platform
import
system
from
influxdb
import
InfluxDBClient
@pytest.mark.parametrize
(
"
service_name
"
,
[
...
...
@@ -15,10 +17,22 @@ def test_service_name(telegraf_agent_config, service_name):
assert
any
(
s
[
'
name
'
]
==
service_name
for
s
in
telegraf_agent_config
[
'
hosts
'
]),
"
{0} not in list of hosts
"
.
format
(
service_name
)
def
test_ping
(
telegraf_agent_config
):
"""
This test will only run on linux as the process call is not portable, there
'
s a better way
"""
for
host
in
telegraf_agent_config
[
'
hosts
'
]:
response
=
os
.
system
(
"
ping -c 1
"
+
host
[
'
ip_address
'
])
assert
response
==
0
,
"
Could not ping {0} on ip address {1}
"
.
format
(
host
[
'
name
'
],
host
[
'
ip_address
'
])
"""
Pings each service to test for liveliness
:param streaming_sim_config: the configuration fixture collected from conftest.py
"""
print
(
"
\n
"
)
# blank line printed for formatting purposes
ping_count
=
1
system_dependent_param
=
"
-n
"
if
system
().
lower
()
==
"
windows
"
else
"
-c
"
for
service
in
telegraf_agent_config
[
'
hosts
'
]:
command
=
[
"
ping
"
,
system_dependent_param
,
str
(
ping_count
),
service
[
'
ip_address
'
]]
assert
run
(
command
).
returncode
==
0
,
"
Service ping test failed for {0} with ip address {1}
"
.
format
(
service
[
'
name
'
],
service
[
'
ip_address
'
])
print
(
"
\n
Successfully passed ping test for service: {0}
\n
"
.
format
(
service
[
'
name
'
]))
@pytest.mark.parametrize
(
"
measurement, query, expected_result
"
,
[
(
'
nginx
'
,
'
SELECT mean(
"
requests
"
) AS
"
mean
"
FROM
"
CLMCMetrics
"
.
"
autogen
"
.
"
nginx
"'
,
0
),
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment