From 215bb0a83f6660e22bfadeee590dc758679d7c01 Mon Sep 17 00:00:00 2001 From: Sergio Franco Date: Thu, 5 Dec 2024 09:24:58 -0600 Subject: [PATCH] Add test for rel between AWSAccount and AutoScalingGroup --- .../intel/aws/ec2/test_ec2_auto_scaling_groups.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tests/integration/cartography/intel/aws/ec2/test_ec2_auto_scaling_groups.py b/tests/integration/cartography/intel/aws/ec2/test_ec2_auto_scaling_groups.py index fba2ec3ce0..26543e8bbd 100644 --- a/tests/integration/cartography/intel/aws/ec2/test_ec2_auto_scaling_groups.py +++ b/tests/integration/cartography/intel/aws/ec2/test_ec2_auto_scaling_groups.py @@ -52,6 +52,7 @@ def test_sync_ec2_auto_scaling_groups(mock_get_instances, mock_get_launch_config (GET_AUTO_SCALING_GROUPS[0]['AutoScalingGroupARN'], GET_AUTO_SCALING_GROUPS[0]['AutoScalingGroupName']), (GET_AUTO_SCALING_GROUPS[1]['AutoScalingGroupARN'], GET_AUTO_SCALING_GROUPS[1]['AutoScalingGroupName']), } + assert check_nodes(neo4j_session, 'LaunchConfiguration', ['id', 'arn', 'name']) == { ( GET_LAUNCH_CONFIGURATIONS[0]['LaunchConfigurationARN'], @@ -69,6 +70,20 @@ def test_sync_ec2_auto_scaling_groups(mock_get_instances, mock_get_launch_config GET_LAUNCH_CONFIGURATIONS[2]['LaunchConfigurationName'], ), } + + assert check_rels( + neo4j_session, + node_1_label='AutoScalingGroup', + node_1_attr='id', + node_2_label='AWSAccount', + node_2_attr='id', + rel_label='RESOURCE', + rel_direction_right=False, + ) == { + (GET_AUTO_SCALING_GROUPS[0]['AutoScalingGroupARN'], TEST_ACCOUNT_ID), + (GET_AUTO_SCALING_GROUPS[1]['AutoScalingGroupARN'], TEST_ACCOUNT_ID), + } + assert check_rels( neo4j_session, node_1_label='AutoScalingGroup',