def METHOD_NAME():
    tgen = get_topogen()
    if tgen.routers_have_failure():
        pytest.skip(tgen.errors)
    router = tgen.gears["r2"]
    def _bgp_converge(router):
        output = json.loads(router.vtysh_cmd("show ip bgp neighbor 192.168.255.2 json"))
        expected = {
            "192.168.255.2": {
                "bgpState": "Established",
                "addressFamilyInfo": {"ipv4Unicast": {"acceptedPrefixCounter": 2}},
            }
        }
        return topotest.json_cmp(output, expected)
    def _bgp_has_aggregated_route_with_stripped_as_set(router):
        output = json.loads(router.vtysh_cmd("show ip bgp 172.16.0.0/16 json"))
        expected = {
            "paths": [{"aspath": {"string": "Local", "segments": [], "length": 0}}]
        }
        return topotest.json_cmp(output, expected)
    def _bgp_announce_route_without_as_sets(router):
        output = json.loads(
            router.vtysh_cmd(
                "show ip bgp neighbor 192.168.254.2 advertised-routes json"
            )
        )
        expected = {
            "advertisedRoutes": {
                "172.16.0.0/16": {"path": ""},
                "192.168.254.0/30": {"path": "65003"},
                "192.168.255.0/30": {"path": "65001"},
            },
            "totalPrefixCounter": 3,
        }
        return topotest.json_cmp(output, expected)
    test_func = functools.partial(_bgp_converge, router)
    success, result = topotest.run_and_expect(test_func, None, count=60, wait=0.5)
    assert result is None, 'Failed bgp convergence in "{}"'.format(router)
    test_func = functools.partial(
        _bgp_has_aggregated_route_with_stripped_as_set, router
    )
    success, result = topotest.run_and_expect(test_func, None, count=60, wait=0.5)
    assert result is None, 'Failed to see an aggregated route in "{}"'.format(router)
    test_func = functools.partial(_bgp_announce_route_without_as_sets, router)
    success, result = topotest.run_and_expect(test_func, None, count=60, wait=0.5)
    assert (
        result is None
    ), 'Route 172.16.0.0/16 should be sent without AS_SET to r3 "{}"'.format(router)