summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorKerim Gokarslan <kgokarsl@cisco.com>2017-10-17 15:17:44 -0700
committerKerim Gokarslan <kgokarsl@cisco.com>2017-10-18 10:01:59 -0700
commit12e5c1edecb6c9fc835b0908b2d0fd9e8486fd09 (patch)
treea94302b236d71e5af9e7b7b6eef3f9a67530db43 /test
parent5be3729e65156be16a88d94e8943b79edf3f7eb0 (diff)
NFVBENCH-42 Add multiple fluentd aggregators support
Change-Id: I5b752f9ad4f7b4a60f2678d22467db570e02ab82 Signed-off-by: Kerim Gokarslan <kgokarsl@cisco.com>
Diffstat (limited to 'test')
-rw-r--r--test/test_nfvbench.py35
1 files changed, 34 insertions, 1 deletions
diff --git a/test/test_nfvbench.py b/test/test_nfvbench.py
index 85342bb..2578407 100644
--- a/test/test_nfvbench.py
+++ b/test/test_nfvbench.py
@@ -786,11 +786,44 @@ def test_config():
def test_fluentd():
logger = logging.getLogger('fluent-logger')
- handler = FluentLogHandler('nfvbench', fluentd_port=7081)
+
+ class FluentdConfig(dict):
+ def __getattr__(self, attr):
+ return self.get(attr)
+
+ fluentd_configs = [
+ FluentdConfig({
+ 'logging_tag': 'nfvbench',
+ 'result_tag': 'resultnfvbench',
+ 'ip': '127.0.0.1',
+ 'port': 7081
+ }),
+ FluentdConfig({
+ 'logging_tag': 'nfvbench',
+ 'result_tag': 'resultnfvbench',
+ 'ip': '127.0.0.1',
+ 'port': 24224
+ }),
+ FluentdConfig({
+ 'logging_tag': None,
+ 'result_tag': 'resultnfvbench',
+ 'ip': '127.0.0.1',
+ 'port': 7082
+ }),
+ FluentdConfig({
+ 'logging_tag': 'nfvbench',
+ 'result_tag': None,
+ 'ip': '127.0.0.1',
+ 'port': 7083
+ })
+ ]
+
+ handler = FluentLogHandler(fluentd_configs=fluentd_configs)
logger.addHandler(handler)
logger.setLevel(logging.INFO)
logger.info('test')
logger.warning('test %d', 100)
+
try:
raise Exception("test")
except Exception: