Commit 9f1f2912 authored by Eteri's avatar Eteri

add new test for ingesting with 2 different url's

parent 16b30cbb
...@@ -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
......
...@@ -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>
...@@ -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(10) time.sleep(20)
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_afet = %s" %str(self.caddy_process.connections())) print("conn_after = %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.
""" """
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment