def test_forwarding_rules_scanner_all_match(self):
        rules_local_path = get_datafile_path(__file__,
            'forward_rule_test_1.yaml')
        scanner = forwarding_rule_scanner.ForwardingRuleScanner(
            {}, {}, mock.MagicMock(), '', '', rules_local_path)

        project_id = "abc-123"

        gcp_forwarding_rules_resource_data = [
            {
                "id": "46",
                "creationTimestamp": "2017-06-01 04:19:37",
                "name": "abc-123",
                "description": "",
                "region": "https://www.googleapis.com/compute/v1/projects/abc-123/regions/asia-east1",
                "IPAddress": "198.51.100.99",
                "IPProtocol": "UDP",
                "portRange": "4500-4500",
                "ports": [],
                "target": "https://www.googleapis.com/compute/v1/projects/abc-123/regions/asia-east1/abc-123/abc-123",
                "loadBalancingScheme": "EXTERNAL",
            },
            {
                "id": "23",
                "creationTimestamp": "2017-06-01 04:19:37",
                "name": "abc-123",
                "description": "",
                "region": "https://www.googleapis.com/compute/v1/projects/abc-123/regions/asia-east1",
                "IPAddress": "198.51.100.23",
                "IPProtocol": "TCP",
                "ports": [8080],
                "target": "https://www.googleapis.com/compute/v1/projects/abc-123/regions/asia-east1/abc-123/abc-123",
                "loadBalancingScheme": "INTERNAL",
            },
            {
                "id": "46",
                "creationTimestamp": "2017-06-01 04:19:37",
                "name": "abc-123",
                "description": "",
                "region": "https://www.googleapis.com/compute/v1/projects/abc-123/regions/asia-east1",
                "IPAddress": "198.51.100.46",
                "IPProtocol":  "ESP",
                "ports": [],
                "target": "https://www.googleapis.com/compute/v1/projects/abc-123/regions/asia-east1/abc-123/abc-123",
                "loadBalancingScheme":  "EXTERNAL",
            },
            {
                "id": "46",
                "creationTimestamp": "2017-06-01 04:19:37",
                "name": "abc-123",
                "description": "",
                "region": "https://www.googleapis.com/compute/v1/projects/abc-123/regions/asia-east1",
                "IPAddress": "198.51.100.35",
                "IPProtocol":  "TCP",
                "portRange": "4500-4500",
                "target": "https://www.googleapis.com/compute/v1/projects/abc-123/regions/asia-east1/abc-123/abc-123",
                "loadBalancingScheme":  "EXTERNAL",
            }
        ]
        gcp_forwarding_rules_resource_objs = []
        for gcp_forwarding_rule_resource_data in gcp_forwarding_rules_resource_data:
            gcp_forwarding_rules_resource_objs.append(
                fr.ForwardingRule.from_dict(
                    project_id, '', gcp_forwarding_rule_resource_data))

        violations = scanner._find_violations(gcp_forwarding_rules_resource_objs)
        self.assertEqual(0, len(violations))