Skip to content

Commit

Permalink
tst: update gethostbyname expert data
Browse files Browse the repository at this point in the history
changed IP address of example.com and example.org
  • Loading branch information
sebix committed Jan 27, 2025
1 parent 528a376 commit fe02e87
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 3 deletions.
44 changes: 44 additions & 0 deletions intelmq/tests/bots/experts/filter/test_boolean.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# SPDX-FileCopyrightText: 2024 Bundesamt für Sicherheit in der Informationstechnik Software engineering by Intevation GmbH
#
# SPDX-License-Identifier: AGPL-3.0-or-later

# -*- coding: utf-8 -*-

import unittest

import intelmq.lib.test as test
from intelmq.bots.experts.filter.expert import FilterExpertBot

EXAMPLE_INPUT = {"__type": "Event",
"source.tor_node": True,
}
EXAMPLE_INPUT1 = {"__type": "Report",
"source.tor_node": False,
}


class TestFilterExpertBot(test.BotTestCase, unittest.TestCase):
"""
A simple TestCase for FilterExpertBot handling True / False and keep / drop.
"""

@classmethod
def set_bot(cls):
cls.bot_reference = FilterExpertBot
cls.input_message = EXAMPLE_INPUT
cls.sysconfig = {'filter_key': 'source.tor_node',
'filter_value': True,
'filter_action': 'drop'}

def test_extra_filter_drop(self):
self.run_bot()
self.assertOutputQueueLen(0)

def test_extra_filter_keep(self):
self.input_message = EXAMPLE_INPUT1
self.run_bot()
self.assertMessageEqual(0, EXAMPLE_INPUT1)


if __name__ == '__main__': # pragma: no cover
unittest.main()
6 changes: 3 additions & 3 deletions intelmq/tests/bots/experts/gethostbyname/test_expert.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
EXAMPLE_OUTPUT = {"__type": "Event",
"source.fqdn": "example.com",
"destination.fqdn": "example.org",
"source.ip": "93.184.215.14",
"destination.ip": "93.184.215.14",
"source.ip": "23.192.228.84",
"destination.ip": "23.215.0.132",
"time.observation": "2015-01-01T00:00:00+00:00"
}
NONEXISTING_INPUT = {"__type": "Event",
Expand All @@ -34,7 +34,7 @@
}
EXAMPLE_URL_OUTPUT = {"__type": "Event",
"source.url": "http://example.com",
"source.ip": "93.184.215.14",
"source.ip": "23.192.228.84",
}
EXISITNG_INPUT = {"__type": "Event",
"source.fqdn": "example.com",
Expand Down

0 comments on commit fe02e87

Please sign in to comment.