Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
slapos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
92
Merge Requests
92
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
nexedi
slapos
Commits
149210d6
Commit
149210d6
authored
Jan 16, 2020
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test
parent
6c8b203d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
5 deletions
+15
-5
software/grafana/test/test.py
software/grafana/test/test.py
+15
-5
No files found.
software/grafana/test/test.py
View file @
149210d6
...
...
@@ -40,8 +40,18 @@ setUpModule, SlapOSInstanceTestCase = makeModuleSetUpAndTestCaseClass(
os
.
path
.
abspath
(
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
'..'
,
'software.cfg'
)))
SlapOSInstanceTestCase
.
report_max_retry
=
5
class
TestGrafana
(
SlapOSInstanceTestCase
):
class
GrafanaTestCase
(
SlapOSInstanceTestCase
):
"""Base test case for grafana.
Since the instances takes timte to start and stop,
we increate as lot the number of retries.
"""
report_max_retry
=
30
instance_max_retry
=
30
class
TestGrafana
(
GrafanaTestCase
):
def
setUp
(
self
):
self
.
grafana_url
=
self
.
computer_partition
.
getConnectionParameterDict
(
)[
'grafana-url'
]
...
...
@@ -83,7 +93,7 @@ class TestGrafana(SlapOSInstanceTestCase):
sorted
([
ds
[
'type'
]
for
ds
in
resp
.
json
()]))
class
TestInfluxDb
(
SlapOSInstance
TestCase
):
class
TestInfluxDb
(
Grafana
TestCase
):
def
setUp
(
self
):
self
.
influxdb_url
=
self
.
computer_partition
.
getConnectionParameterDict
(
)[
'influxdb-url'
]
...
...
@@ -116,7 +126,7 @@ class TestInfluxDb(SlapOSInstanceTestCase):
[
connection_params
[
'influxdb-database'
]],
result
[
'series'
][
0
][
'values'
])
class
TestTelegraf
(
SlapOSInstance
TestCase
):
class
TestTelegraf
(
Grafana
TestCase
):
def
test_telegraf_running
(
self
):
with
self
.
slap
.
instance_supervisor_rpc
as
supervisor
:
all_process_info
=
supervisor
.
getAllProcessInfo
()
...
...
@@ -124,7 +134,7 @@ class TestTelegraf(SlapOSInstanceTestCase):
self
.
assertEqual
(
'RUNNING'
,
process_info
[
'statename'
])
class
TestLoki
(
SlapOSInstance
TestCase
):
class
TestLoki
(
Grafana
TestCase
):
@
classmethod
def
getInstanceParameterDict
(
cls
):
cls
.
_logfile
=
tempfile
.
NamedTemporaryFile
(
suffix
=
'log'
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment