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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Eteri
slapos
Commits
9f1f2912
Commit
9f1f2912
authored
Jul 11, 2018
by
Eteri
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add new test for ingesting with 2 different url's
parent
16b30cbb
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
43 deletions
+32
-43
software/erp5testnode/testsuite/fluentTest/buildout.hash.cfg
software/erp5testnode/testsuite/fluentTest/buildout.hash.cfg
+1
-1
software/erp5testnode/testsuite/fluentTest/templates/fluentd-conf.cnf.in
...stnode/testsuite/fluentTest/templates/fluentd-conf.cnf.in
+10
-39
software/erp5testnode/testsuite/fluentTest/tests/test.py
software/erp5testnode/testsuite/fluentTest/tests/test.py
+21
-3
No files found.
software/erp5testnode/testsuite/fluentTest/buildout.hash.cfg
View file @
9f1f2912
...
@@ -20,7 +20,7 @@ md5sum = 45c4adaae557bed5c25c24f4c4506b3d
...
@@ -20,7 +20,7 @@ md5sum = 45c4adaae557bed5c25c24f4c4506b3d
[template-fluentd-config]
[template-fluentd-config]
filename = templates/fluentd-conf.cnf.in
filename = templates/fluentd-conf.cnf.in
md5sum =
85d7770376821f35c0cce782b716efc3
md5sum =
b26c319983469f08ebb9fad3c702e369
[template-caddy-service]
[template-caddy-service]
filename = templates/template-caddy-service.sh.in
filename = templates/template-caddy-service.sh.in
...
...
software/erp5testnode/testsuite/fluentTest/templates/fluentd-conf.cnf.in
View file @
9f1f2912
...
@@ -3,37 +3,24 @@
...
@@ -3,37 +3,24 @@
port 5438
port 5438
</source>
</source>
# HTTP input
# http://localhost:8888/<tag>?json=<json>
#<source>
# @type http
# @id http_input
# port 8888
#</source>
## output tag=sensor.** to Wendelin
## output tag=sensor.** to Wendelin
<match tag_*>
<match tag_*>
@type wendelin
@type wendelin
@id wendelin_out
@id wendelin_out
streamtool_uri http://{{local_ip}}:4443
streamtool_uri http://{{local_ip}}:4443
buffer_type memory
buffer_chunk_limit 1MB
flush_interval 1s
# all parameters of BufferedOutput & Output classes are supported too, e.g.
num_threads 1
# `buffer_type`, `flush_interval`, `num_threads`, `log_level`, etc - see
use_keep_alive true
# their code near:
</match>
#
# https://github.com/fluent/fluentd/blob/master/lib/fluent/output.rb#L182
#
# logging setup description:
#
# http://docs.fluentd.org/articles/logging
<match diff_*>
@type wendelin
@id wendelin_out
streamtool_uri http://{{local_ip}}:4443/different_uri/
buffer_type memory
buffer_type memory
buffer_chunk_limit 1MB
buffer_chunk_limit 1MB
#buffer_path "#{ENV['HOME']/var}"
flush_interval 1s
flush_interval 1s
num_threads 1
num_threads 1
use_keep_alive true
use_keep_alive true
...
@@ -64,23 +51,7 @@
...
@@ -64,23 +51,7 @@
port 5443
port 5443
</source>
</source>
## match tag=debug.** and dump to console
<match debug.**>
<match debug.**>
@type stdout
@type stdout
@id stdout_output
@id stdout_output
</match>
</match>
## match fluent's internal events
#<match fluent.**>
# @type null
#</match>
## match not matched logs and write to file
#<match **>
# @type file
# path /var/log/fluent/else
# compress gz
#</match>
software/erp5testnode/testsuite/fluentTest/tests/test.py
View file @
9f1f2912
...
@@ -102,18 +102,17 @@ class TestIngestion(FluentdPluginTestCase):
...
@@ -102,18 +102,17 @@ class TestIngestion(FluentdPluginTestCase):
time
.
sleep
(
10
)
time
.
sleep
(
10
)
self
.
assertEqual
(
test_msg
,
TestServerHandler
.
posted_data
)
self
.
assertEqual
(
test_msg
,
TestServerHandler
.
posted_data
)
def
test_keepAlive_on
(
self
):
def
test_keepAlive_on
(
self
):
print
(
"############## TEST 3 ##############"
)
print
(
"############## TEST 3 ##############"
)
start_fluentd_cat
(
self
,
"dummyInputDelayCheckKeepAlive"
,
"tag_test_3"
)
start_fluentd_cat
(
self
,
"dummyInputDelayCheckKeepAlive"
,
"tag_test_3"
)
time
.
sleep
(
1
0
)
time
.
sleep
(
2
0
)
self
.
assertEqual
(
self
.
assertEqual
(
[
'ESTABLISHED'
],
[
'ESTABLISHED'
],
[
conn
.
status
for
conn
in
self
.
caddy_process
.
connections
(
'inet'
)
[
conn
.
status
for
conn
in
self
.
caddy_process
.
connections
(
'inet'
)
if
len
(
conn
.
raddr
)
>
1
and
conn
.
laddr
.
port
==
4443
])
if
len
(
conn
.
raddr
)
>
1
and
conn
.
laddr
.
port
==
4443
])
print
(
"conn_af
et
= %s"
%
str
(
self
.
caddy_process
.
connections
()))
print
(
"conn_af
ter
= %s"
%
str
(
self
.
caddy_process
.
connections
()))
def
test_ingest_with_15mins_delay
(
self
):
def
test_ingest_with_15mins_delay
(
self
):
...
@@ -175,6 +174,25 @@ class TestIngestion(FluentdPluginTestCase):
...
@@ -175,6 +174,25 @@ class TestIngestion(FluentdPluginTestCase):
time
.
sleep
(
10
)
time
.
sleep
(
10
)
self
.
assertEqual
(
"tag_Test_6_3"
,
TestServerHandler
.
request_tag
)
self
.
assertEqual
(
"tag_Test_6_3"
,
TestServerHandler
.
request_tag
)
def
test_simple_ingest_on_different_uri
(
self
):
print
(
"############## TEST 7 ##############"
)
kill_caddy
(
caddy_pid
)
time
.
sleep
(
5
)
start_caddy
(
caddy_pid
)
start_fluentd_cat
(
self
,
"dummyInputOnURI1"
,
"tag_uri_1"
)
start_fluentd_cat
(
self
,
"dummyInputOnURI2"
,
"different_tag_uri_2"
)
time
.
sleep
(
5
)
self
.
assertTrue
(
"dummyInputOnURI1"
in
TestServerHandler
.
all_data
)
self
.
assertTrue
(
"dummyInputOnURI2"
in
TestServerHandler
.
all_data
)
self
.
assertEqual
(
[
'ESTABLISHED'
,
'ESTABLISHED'
],
[
conn
.
status
for
conn
in
self
.
caddy_process
.
connections
(
'inet'
)
if
len
(
conn
.
raddr
)
>
1
and
conn
.
laddr
.
port
==
4443
])
print
(
"conn_after = %s"
%
str
(
self
.
caddy_process
.
connections
()))
def
start_fluentd_cat
(
self
,
test_msg
,
tag
):
def
start_fluentd_cat
(
self
,
test_msg
,
tag
):
"""Feeds `test_msg` with `tag` to fluentd.
"""Feeds `test_msg` with `tag` to fluentd.
"""
"""
...
...
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