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
[template-fluentd-config]
filename = templates/fluentd-conf.cnf.in
md5sum = 85d7770376821f35c0cce782b716efc3
md5sum = b26c319983469f08ebb9fad3c702e369
[template-caddy-service]
filename = templates/template-caddy-service.sh.in
......
......@@ -3,37 +3,24 @@
port 5438
</source>
# HTTP input
# http://localhost:8888/<tag>?json=<json>
#<source>
# @type http
# @id http_input
# port 8888
#</source>
## output tag=sensor.** to Wendelin
<match tag_*>
@type wendelin
@id wendelin_out
streamtool_uri http://{{local_ip}}:4443
buffer_type memory
buffer_chunk_limit 1MB
flush_interval 1s
num_threads 1
use_keep_alive true
</match>
# all parameters of BufferedOutput & Output classes are supported too, e.g.
# `buffer_type`, `flush_interval`, `num_threads`, `log_level`, etc - see
# their code near:
#
# 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_chunk_limit 1MB
#buffer_path "#{ENV['HOME']/var}"
flush_interval 1s
num_threads 1
use_keep_alive true
......@@ -64,23 +51,7 @@
port 5443
</source>
## match tag=debug.** and dump to console
<match debug.**>
@type stdout
@id stdout_output
</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):
time.sleep(10)
self.assertEqual(test_msg, TestServerHandler.posted_data)
def test_keepAlive_on(self):
print("############## TEST 3 ##############")
start_fluentd_cat(self, "dummyInputDelayCheckKeepAlive", "tag_test_3")
time.sleep(10)
time.sleep(20)
self.assertEqual(
['ESTABLISHED'],
[conn.status for conn in self.caddy_process.connections('inet')
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):
......@@ -175,6 +174,25 @@ class TestIngestion(FluentdPluginTestCase):
time.sleep(10)
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):
"""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