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
Levin Zimmermann
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
Show 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,
...
@@ -46,7 +46,6 @@ setup(name=name,
'slapos.libnetworkcache'
,
'slapos.libnetworkcache'
,
'erp5.util'
,
'erp5.util'
,
'supervisor'
,
'supervisor'
,
'six'
,
],
],
zip_safe
=
True
,
zip_safe
=
True
,
test_suite
=
'test'
,
test_suite
=
'test'
,
...
...
software/fluentd/test/test.py
View file @
fae5bba1
...
@@ -34,11 +34,10 @@ import struct
...
@@ -34,11 +34,10 @@ import struct
import
subprocess
import
subprocess
import
tempfile
import
tempfile
import
time
import
time
import
six
import
sys
import
sys
from
six.moves.SimpleHTTPS
erver
import
SimpleHTTPRequestHandler
from
http.s
erver
import
SimpleHTTPRequestHandler
from
s
ix.moves.s
ocketserver
import
StreamRequestHandler
,
TCPServer
from
socketserver
import
StreamRequestHandler
,
TCPServer
from
slapos.testing.testcase
import
makeModuleSetUpAndTestCaseClass
from
slapos.testing.testcase
import
makeModuleSetUpAndTestCaseClass
from
slapos.testing.utils
import
findFreeTCPPort
from
slapos.testing.utils
import
findFreeTCPPort
...
@@ -49,8 +48,8 @@ FLUSH_INTERVAL = 1
...
@@ -49,8 +48,8 @@ FLUSH_INTERVAL = 1
setUpModule
,
SlapOSInstanceTestCase
=
makeModuleSetUpAndTestCaseClass
(
setUpModule
,
SlapOSInstanceTestCase
=
makeModuleSetUpAndTestCaseClass
(
os
.
path
.
abspath
(
os
.
path
.
abspath
(
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
'..'
,
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
'..'
,
'software.cfg'
)))
'software%s.cfg'
%
(
"-py2"
if
six
.
PY2
else
""
))))
class
FluentdTestCase
(
SlapOSInstanceTestCase
):
class
FluentdTestCase
(
SlapOSInstanceTestCase
):
__partition_reference__
=
'fluentd'
__partition_reference__
=
'fluentd'
...
@@ -135,11 +134,11 @@ class WendelinTutorialTestCase(FluentdTestCase):
...
@@ -135,11 +134,11 @@ class WendelinTutorialTestCase(FluentdTestCase):
return
subprocess
.
check_output
(
return
subprocess
.
check_output
(
[
self
.
_fluentd_bin
,
'-c'
,
conf_path
,
'--dry-run'
],
[
self
.
_fluentd_bin
,
'-c'
,
conf_path
,
'--dry-run'
],
env
=
{
'GEM_PATH'
:
self
.
_gem_path
},
env
=
{
'GEM_PATH'
:
self
.
_gem_path
},
universal_newlines
=
True
,
text
=
True
,
)
)
def
_test_configuration
(
self
,
expected_str
):
def
_test_configuration
(
self
,
expected_str
):
self
.
assertRegex
pMatches
(
self
.
assertRegex
(
self
.
read_fluentd_conf
(
self
.
_conf
),
self
.
read_fluentd_conf
(
self
.
_conf
),
expected_str
,
expected_str
,
)
)
...
@@ -168,12 +167,12 @@ class SensorConfTestCase(WendelinTutorialTestCase):
...
@@ -168,12 +167,12 @@ class SensorConfTestCase(WendelinTutorialTestCase):
@
classmethod
@
classmethod
def
sensor_conf
(
cls
,
script_path
):
def
sensor_conf
(
cls
,
script_path
):
return
'''
\
return
f
'''
\
<source>
<source>
@type exec
@type exec
tag tag.name
tag tag.name
command
%s %s
command
{
sys
.
executable
}
{
script_path
}
run_interval
%s
s
run_interval
{
FLUSH_INTERVAL
}
s
<parse>
<parse>
keys pressure, humidity, temperature
keys pressure, humidity, temperature
</parse>
</parse>
...
@@ -182,12 +181,12 @@ class SensorConfTestCase(WendelinTutorialTestCase):
...
@@ -182,12 +181,12 @@ class SensorConfTestCase(WendelinTutorialTestCase):
@type forward
@type forward
<server>
<server>
name myserver1
name myserver1
host
%s
host
{
cls
.
_ipv6_address
}
</server>
</server>
<buffer>
<buffer>
flush_mode immediate
flush_mode immediate
</buffer>
</buffer>
</match>'''
%
(
sys
.
executable
,
script_path
,
FLUSH_INTERVAL
,
cls
.
_ipv6_address
)
</match>'''
@
classmethod
@
classmethod
def
sensor_script
(
cls
,
measurementList
):
def
sensor_script
(
cls
,
measurementList
):
...
@@ -199,8 +198,7 @@ print("%s")''' % "\t".join(measurementList)
...
@@ -199,8 +198,7 @@ print("%s")''' % "\t".join(measurementList)
def
test_configuration
(
self
):
def
test_configuration
(
self
):
self
.
_test_configuration
(
self
.
_test_configuration
(
r'adding forwarding server \'myserver1\' host="%s" port=%s weight=60'
fr'adding forwarding server \'myserver1\' host="
{
self
.
_ipv6_address
}
" port=
{
FLUENTD_PORT
}
weight=60'
%
(
self
.
_ipv6_address
,
FLUENTD_PORT
)
)
)
def
test_send_data
(
self
):
def
test_send_data
(
self
):
...
@@ -229,25 +227,24 @@ class GatewayConfTestCase(WendelinTutorialTestCase):
...
@@ -229,25 +227,24 @@ class GatewayConfTestCase(WendelinTutorialTestCase):
@
classmethod
@
classmethod
def
gateway_conf
(
cls
,
fluentd_port
,
wendelin_port
):
def
gateway_conf
(
cls
,
fluentd_port
,
wendelin_port
):
return
'''
\
return
f
'''
\
<source>
<source>
@type forward
@type forward
port
%s
port
{
fluentd_port
}
bind
%s
bind
{
cls
.
_ipv6_address
}
</source>
</source>
<match tag.name>
<match tag.name>
@type wendelin
@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
user foo
password bar
password bar
<buffer>
<buffer>
flush_mode interval
flush_mode interval
@type file
@type file
path fluentd-buffer-file/
path fluentd-buffer-file/
flush_interval
%s
s
flush_interval
{
FLUSH_INTERVAL
}
s
</buffer>
</buffer>
</match>'''
%
(
fluentd_port
,
cls
.
_ipv6_address
,
cls
.
_ipv6_address
,
</match>'''
wendelin_port
,
FLUSH_INTERVAL
)
@
classmethod
@
classmethod
def
get_configuration
(
cls
):
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