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
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Eric Zheng
slapos
Commits
046c54f6
Commit
046c54f6
authored
Jun 21, 2021
by
Thomas Gambier
🚴🏼
Browse files
Options
Browse Files
Download
Plain Diff
Update Release Candidate
parents
497f3ac1
0e4c73a9
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
60 additions
and
7 deletions
+60
-7
software/erp5/upgrade_test/test.py
software/erp5/upgrade_test/test.py
+1
-1
software/grafana/buildout.hash.cfg
software/grafana/buildout.hash.cfg
+1
-1
software/grafana/grafana-config-file.cfg.in
software/grafana/grafana-config-file.cfg.in
+1
-1
software/grafana/instance-input-schema.json
software/grafana/instance-input-schema.json
+5
-2
software/grafana/software.cfg.json
software/grafana/software.cfg.json
+1
-1
software/grafana/test/setup.py
software/grafana/test/setup.py
+1
-0
software/grafana/test/test.py
software/grafana/test/test.py
+49
-0
stack/slapos.cfg
stack/slapos.cfg
+1
-1
No files found.
software/erp5/upgrade_test/test.py
View file @
046c54f6
...
...
@@ -39,7 +39,7 @@ from slapos.testing.testcase import installSoftwareUrlList
from
slapos.testing.testcase
import
SlapOSNodeCommandError
from
slapos.grid.utils
import
md5digest
old_software_release_url
=
'https://lab.nexedi.com/nexedi/slapos/raw/1.0.167.
3
/software/erp5/software.cfg'
old_software_release_url
=
'https://lab.nexedi.com/nexedi/slapos/raw/1.0.167.
4
/software/erp5/software.cfg'
new_software_release_url
=
os
.
path
.
abspath
(
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
'..'
,
'software.cfg'
))
...
...
software/grafana/buildout.hash.cfg
View file @
046c54f6
...
...
@@ -27,7 +27,7 @@ md5sum = a1a9c22c2a7829c66a49fc2504604d21
[grafana-config-file]
filename = grafana-config-file.cfg.in
md5sum =
8244d430905b968795c7946049bed9e3
md5sum =
e255dcca466f5de51698d24cbd114577
[grafana-provisioning-config-file]
filename = grafana-provisioning-config-file.cfg.in
...
...
software/grafana/grafana-config-file.cfg.in
View file @
046c54f6
...
...
@@ -346,7 +346,7 @@ password = {{ slapparameter_dict.get('smtp-password', '') and '"""%s"""' % slapp
cert_file =
key_file =
#skip_verify = false
skip_verify = {{ slapparameter_dict.get('smtp-verify-ssl',
True)
and 'false' or 'true' }}
skip_verify = {{ slapparameter_dict.get('smtp-verify-ssl',
'true').lower() == 'true'
and 'false' or 'true' }}
#from_address = admin@grafana.localhost
from_address = {{ slapparameter_dict.get('email-from-address', '') }}
#from_name = Grafana
...
...
software/grafana/instance-input-schema.json
View file @
046c54f6
...
...
@@ -17,8 +17,11 @@
},
"smtp-verify-ssl"
:
{
"description"
:
"Verify SSL certificate of SMTP server"
,
"type"
:
"boolean"
,
"default"
:
true
"type"
:
"string"
,
"enum"
:
[
"true"
,
"false"
]
},
"email-from-address"
:
{
"description"
:
"Email address used in From: header of emails"
,
...
...
software/grafana/software.cfg.json
View file @
046c54f6
{
"name"
:
"Grafana"
,
"description"
:
"Grafana, Telegraf and Influxdb"
,
"serialisation"
:
"
json-in-
xml"
,
"serialisation"
:
"xml"
,
"software-type"
:
{
"default"
:
{
"title"
:
"Default"
,
...
...
software/grafana/test/setup.py
View file @
046c54f6
...
...
@@ -45,6 +45,7 @@ setup(
'slapos.libnetworkcache'
,
'erp5.util'
,
'requests'
,
'six'
,
'supervisor'
,
'psutil'
,
],
...
...
software/grafana/test/test.py
View file @
046c54f6
...
...
@@ -25,6 +25,8 @@
#
##############################################################################
from
__future__
import
unicode_literals
import
io
import
logging
import
os
import
tempfile
...
...
@@ -33,6 +35,7 @@ import time
import
psutil
import
requests
from
six.moves
import
configparser
from
slapos.testing.testcase
import
makeModuleSetUpAndTestCaseClass
...
...
@@ -93,6 +96,52 @@ class TestGrafana(GrafanaTestCase):
sorted
([
'influxdb'
,
'loki'
]),
sorted
([
ds
[
'type'
]
for
ds
in
resp
.
json
()]))
def
test_email_disabled
(
self
):
config
=
configparser
.
ConfigParser
()
# grafana config file is like an ini file with an implicit default section
with
open
(
os
.
path
.
join
(
self
.
computer_partition_root_path
,
'etc'
,
'grafana-config-file.cfg'
))
as
f
:
config
.
readfp
(
io
.
StringIO
(
'[default]
\
n
'
+
f
.
read
()))
self
.
assertEqual
(
config
.
get
(
'smtp'
,
'enabled'
),
'false'
)
class
TestGrafanaEmailEnabled
(
GrafanaTestCase
):
__partition_reference__
=
'mail'
smtp_verify_ssl
=
"true"
smtp_skip_verify
=
"false"
@
classmethod
def
getInstanceParameterDict
(
cls
):
return
{
"smtp-server"
:
"smtp.example.com:25"
,
"smtp-username"
:
"smtp_username"
,
"smtp-password"
:
"smtp_password"
,
'smtp-verify-ssl'
:
cls
.
smtp_verify_ssl
,
"email-from-address"
:
"grafana@example.com"
,
"email-from-name"
:
"Grafana From Name"
,
}
def
test_email_enabled
(
self
):
config
=
configparser
.
ConfigParser
()
with
open
(
os
.
path
.
join
(
self
.
computer_partition_root_path
,
'etc'
,
'grafana-config-file.cfg'
))
as
f
:
config
.
readfp
(
io
.
StringIO
(
'[default]
\
n
'
+
f
.
read
()))
self
.
assertEqual
(
config
.
get
(
'smtp'
,
'enabled'
),
'true'
)
self
.
assertEqual
(
config
.
get
(
'smtp'
,
'host'
),
'smtp.example.com:25'
)
self
.
assertEqual
(
config
.
get
(
'smtp'
,
'user'
),
'smtp_username'
)
self
.
assertEqual
(
config
.
get
(
'smtp'
,
'password'
),
'"""smtp_password"""'
)
self
.
assertEqual
(
config
.
get
(
'smtp'
,
'skip_verify'
),
self
.
smtp_skip_verify
)
self
.
assertEqual
(
config
.
get
(
'smtp'
,
'from_address'
),
'grafana@example.com'
)
self
.
assertEqual
(
config
.
get
(
'smtp'
,
'from_name'
),
'Grafana From Name'
)
class
TestGrafanaEmailEnabledSkipVerify
(
TestGrafanaEmailEnabled
):
smtp_verify_ssl
=
"false"
smtp_skip_verify
=
"true"
class
TestInfluxDb
(
GrafanaTestCase
):
def
setUp
(
self
):
...
...
stack/slapos.cfg
View file @
046c54f6
...
...
@@ -190,7 +190,7 @@ setuptools-dso = 1.7
rubygemsrecipe = 0.3.0
six = 1.12.0
slapos.cookbook = 1.0.197
slapos.core = 1.6.1
3
slapos.core = 1.6.1
4
slapos.extension.strip = 0.4
slapos.extension.shared = 1.0
slapos.libnetworkcache = 0.20
...
...
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