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
Titouan Soulard
slapos
Commits
fae5bba1
Commit
fae5bba1
authored
Sep 05, 2022
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
software/fluentd: drop python2 support
parent
7e78e14e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
28 deletions
+18
-28
software/fluentd/software-py2.cfg
software/fluentd/software-py2.cfg
+0
-6
software/fluentd/test/setup.py
software/fluentd/test/setup.py
+0
-1
software/fluentd/test/test.py
software/fluentd/test/test.py
+18
-21
No files found.
software/fluentd/software-py2.cfg
deleted
100644 → 0
View file @
7e78e14e
[buildout]
extends =
software.cfg
[python]
part = python2.7
software/fluentd/test/setup.py
View file @
fae5bba1
...
...
@@ -46,7 +46,6 @@ setup(name=name,
'slapos.libnetworkcache'
,
'erp5.util'
,
'supervisor'
,
'six'
,
],
zip_safe
=
True
,
test_suite
=
'test'
,
...
...
software/fluentd/test/test.py
View file @
fae5bba1
...
...
@@ -34,11 +34,10 @@ import struct
import
subprocess
import
tempfile
import
time
import
six
import
sys
from
six.moves.SimpleHTTPS
erver
import
SimpleHTTPRequestHandler
from
s
ix.moves.s
ocketserver
import
StreamRequestHandler
,
TCPServer
from
http.s
erver
import
SimpleHTTPRequestHandler
from
socketserver
import
StreamRequestHandler
,
TCPServer
from
slapos.testing.testcase
import
makeModuleSetUpAndTestCaseClass
from
slapos.testing.utils
import
findFreeTCPPort
...
...
@@ -49,8 +48,8 @@ FLUSH_INTERVAL = 1
setUpModule
,
SlapOSInstanceTestCase
=
makeModuleSetUpAndTestCaseClass
(
os
.
path
.
abspath
(
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
'..'
,
'software%s.cfg'
%
(
"-py2"
if
six
.
PY2
else
""
))))
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
'..'
,
'software.cfg'
)))
class
FluentdTestCase
(
SlapOSInstanceTestCase
):
__partition_reference__
=
'fluentd'
...
...
@@ -135,11 +134,11 @@ class WendelinTutorialTestCase(FluentdTestCase):
return
subprocess
.
check_output
(
[
self
.
_fluentd_bin
,
'-c'
,
conf_path
,
'--dry-run'
],
env
=
{
'GEM_PATH'
:
self
.
_gem_path
},
universal_newlines
=
True
,
text
=
True
,
)
def
_test_configuration
(
self
,
expected_str
):
self
.
assertRegex
pMatches
(
self
.
assertRegex
(
self
.
read_fluentd_conf
(
self
.
_conf
),
expected_str
,
)
...
...
@@ -168,12 +167,12 @@ class SensorConfTestCase(WendelinTutorialTestCase):
@
classmethod
def
sensor_conf
(
cls
,
script_path
):
return
'''
\
return
f
'''
\
<source>
@type exec
tag tag.name
command
%s %s
run_interval
%s
s
command
{
sys
.
executable
}
{
script_path
}
run_interval
{
FLUSH_INTERVAL
}
s
<parse>
keys pressure, humidity, temperature
</parse>
...
...
@@ -182,12 +181,12 @@ class SensorConfTestCase(WendelinTutorialTestCase):
@type forward
<server>
name myserver1
host
%s
host
{
cls
.
_ipv6_address
}
</server>
<buffer>
flush_mode immediate
</buffer>
</match>'''
%
(
sys
.
executable
,
script_path
,
FLUSH_INTERVAL
,
cls
.
_ipv6_address
)
</match>'''
@
classmethod
def
sensor_script
(
cls
,
measurementList
):
...
...
@@ -199,8 +198,7 @@ print("%s")''' % "\t".join(measurementList)
def
test_configuration
(
self
):
self
.
_test_configuration
(
r'adding forwarding server \'myserver1\' host="%s" port=%s weight=60'
%
(
self
.
_ipv6_address
,
FLUENTD_PORT
)
fr'adding forwarding server \'myserver1\' host="
{
self
.
_ipv6_address
}
" port=
{
FLUENTD_PORT
}
weight=60'
)
def
test_send_data
(
self
):
...
...
@@ -229,25 +227,24 @@ class GatewayConfTestCase(WendelinTutorialTestCase):
@
classmethod
def
gateway_conf
(
cls
,
fluentd_port
,
wendelin_port
):
return
'''
\
return
f
'''
\
<source>
@type forward
port
%s
bind
%s
port
{
fluentd_port
}
bind
{
cls
.
_ipv6_address
}
</source>
<match tag.name>
@type wendelin
streamtool_uri http://[
%s]:%s
/erp5/portal_ingestion_policies/default
streamtool_uri http://[
{
cls
.
_ipv6_address
}
]:
{
wendelin_port
}
/erp5/portal_ingestion_policies/default
user foo
password bar
<buffer>
flush_mode interval
@type file
path fluentd-buffer-file/
flush_interval
%s
s
flush_interval
{
FLUSH_INTERVAL
}
s
</buffer>
</match>'''
%
(
fluentd_port
,
cls
.
_ipv6_address
,
cls
.
_ipv6_address
,
wendelin_port
,
FLUSH_INTERVAL
)
</match>'''
@
classmethod
def
get_configuration
(
cls
):
...
...
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