Commit Graph

11099 Commits

Author SHA1 Message Date
Kekoa Kaaikala d811c6548c Island: Prefer existing OS data to ping OS data
Co-authored-by: Mike Salvatore <mike.s.salvatore@gmail.com>
2022-09-29 18:34:46 +00:00
vakarisz 9b30770777 Island: Fix ping scan handler to add machines IP 2022-09-29 18:34:46 +00:00
vakarisz ff2b04c703 Common: Override target for PingScanEvent to more specific type hint 2022-09-29 18:34:46 +00:00
vakarisz 4d2a6083a1 Island: Fix a bug where failed ping scan created machines 2022-09-29 18:34:46 +00:00
vakarisz 3d80adbcd5 Common: Flatten the ping scan event 2022-09-29 18:34:46 +00:00
vakarisz 6aa69a10b6 Island: Setup ping scan event listener/handler 2022-09-29 18:32:51 +00:00
Kekoa Kaaikala 65d43575d1 UT: Make tests pass 2022-09-29 18:32:51 +00:00
vakarisz 168a5845fd UT: Fix and rename unit tests in test_handle_ping_scan_event.py 2022-09-29 18:32:51 +00:00
vakarisz b6d9f88dee Island: Style improvements in handle_ping_scan_event.py 2022-09-29 18:32:50 +00:00
vakarisz c807f97d18 Island: Rename handle_scan_data to handle_ping_scan_event 2022-09-29 18:32:50 +00:00
vakarisz ecb7ca0d8d Island: Subscribe ping scan events 2022-09-29 18:32:50 +00:00
Kekoa Kaaikala 799f08e383 UT: Implement test_handle_scan_data__upserts_machine_if_not_existed 2022-09-29 18:32:50 +00:00
Kekoa Kaaikala 29355e9d14 UT: Implement test_handle_scan_data__node_not_upserted_if_no_matching_machine 2022-09-29 18:32:50 +00:00
Kekoa Kaaikala 18ca84a247 UT: Implement test_handle_scan_data__node_not_upserted_if_no_matching_agent 2022-09-29 18:32:50 +00:00
Kekoa Kaaikala ce8219aa6d UT: Implement test_handle_scan_data__upserts_node 2022-09-29 18:32:50 +00:00
Kekoa Kaaikala ab32daa0e0 Common: Fix AbstractAgentEvent union 2022-09-29 18:32:50 +00:00
Kekoa Kaaikala 1c127781ca UT: Implement test_handle_scan_data__upserts_machine 2022-09-29 18:32:50 +00:00
Kekoa Kaaikala a0d6565c4a UT: Stub out unit tests for handle_scan_data 2022-09-29 18:32:50 +00:00
Kekoa Kaaikala 371ca12dfb Island: Add handle_scan_data to __init__.py 2022-09-29 18:32:50 +00:00
Kekoa Kaaikala 89c6e2b7bc Island: Extract methods in handle_scan_data 2022-09-29 18:32:50 +00:00
Kekoa Kaaikala eacd426969 Island: Handle StorageError in handle_scan_data 2022-09-29 18:32:50 +00:00
Kekoa Kaaikala 304dfbd21f Island: Add callable to handle PingScanEvent 2022-09-29 18:32:50 +00:00
Mike Salvatore 3dc6eba2da Common: Remove disused common/port_status.py
This was moved to common.types and should have been removed in
8ae11e94aa
2022-09-29 13:22:25 -04:00
Mike Salvatore 0207519343 Merge branch '2267-common-port-status' into develop 2022-09-29 13:15:38 -04:00
Mike Salvatore 8ae11e9faa Common,Agent: Move PortStatus to common.types 2022-09-29 13:15:03 -04:00
Ilija Lazoroski 18f8594deb Agent: Use common.PortStatus instead of i_puppet.PortStatus 2022-09-29 13:13:36 -04:00
Ilija Lazoroski c32013bf87 Common: Add PortStatus enum 2022-09-29 13:13:25 -04:00
Ilija Lazoroski 725c6d9419 UT: Make string ports to be integers
Pydantic converts strings to integer but if we enter
integers is safer.
2022-09-29 13:12:04 -04:00
Mike Salvatore 17017d6962 UT: Add missing SocketAddress tests for invalid ports 2022-09-29 11:37:54 -04:00
Mike Salvatore 64b9432bb9 UI: Capitalize "Agent" in info_box_scan_my_metworks 2022-09-29 09:21:12 -04:00
Mike Salvatore 5a0251c442
Merge pull request #2358 from guardicore/2268-modify-ping-scanner-with-agent-queue
2268 modify ping scanner with agent queue
2022-09-29 07:57:29 -04:00
Ilija Lazoroski 66e8032ef3 UT: Replace call_args comparison with assert_called_with in test_ping_scanner 2022-09-29 13:45:59 +02:00
Mike Salvatore 2ab86fa428 UT: Remove patch_get_agent_id()
1. This fixture was never actually executing
2. get_agent_id() always returns the same value (per process). This
   means that _get_ping_scan_event() and the ping scanner will receive
   the same value for any given test. In other words, mocking it is
   unnecessary.
2022-09-29 07:39:57 -04:00
Shreya Malviya 03ebdd461f UT: Check that correct events are published in test_ping_scanner.py 2022-09-29 15:34:07 +05:30
Shreya Malviya d78615fa92 UT: Add _get_ping_scan_event()to test_ping_scanner.py 2022-09-29 15:30:12 +05:30
Shreya Malviya 9f15bea5bd UT: Extract data to variables HOST_IP and TIMEOUT in test_ping_scanner.py 2022-09-29 15:27:55 +05:30
Shreya Malviya a65bbc592d UT: Check that publish is being called with expected event in test_linux_ping_success 2022-09-29 15:23:57 +05:30
Mike Salvatore 2eee427901 Agent: Generate PingScanEvent timestamp closer to ping command 2022-09-29 14:29:53 +05:30
Mike Salvatore 0cd8cd577d UT: Remove unnecessary tests from test_ping_scan_event.py
These tests are unnecessary because we will not use json() to convert to
JSON.
2022-09-29 14:29:53 +05:30
Mike Salvatore 6390993875 UT: Handle ValueError in test_construct_invalid_field__value_error() 2022-09-29 14:29:53 +05:30
Mike Salvatore d3c9691dfe UT: Add assertion to PingScanEvent serialization tests 2022-09-29 14:29:53 +05:30
Ilija Lazoroski 14f8014709 Agent: Save correct event timestamp in ping_scanner 2022-09-29 14:29:53 +05:30
Ilija Lazoroski d235e7a19e UT: Add unit tests for PingScanEvent 2022-09-29 14:29:53 +05:30
Ilija Lazoroski 478ea05fa9 Common: Override target in PingScanEvent 2022-09-29 14:29:52 +05:30
Ilija Lazoroski aa2b49bc66 Agent: Seperate the generation of PingScanEvents 2022-09-29 14:29:52 +05:30
Ilija Lazoroski 3202bfa2c1 Common: Flatten out PingScanEvent 2022-09-29 14:29:52 +05:30
Ilija Lazoroski 228ce9bae1 Agent: Publish PingScanEvent from ping_scanner 2022-09-29 14:29:52 +05:30
Ilija Lazoroski 0357d43d33 Agent: Accept IAgentEventQueue in Puppet constructor 2022-09-29 14:29:52 +05:30
Ilija Lazoroski ec56b15219 Agent: Pass IAgentEventQueue to the Puppet 2022-09-29 14:29:52 +05:30
Mike Salvatore ba0ffeacce Agent: Change method order 2022-09-29 14:29:52 +05:30