def METHOD_NAME():
    tgen = get_topogen()
    if tgen.routers_have_failure():
        pytest.skip(tgen.errors)
    r1 = tgen.gears["r1"]
    r2 = tgen.gears["r2"]
    def _bgp_converge():
        output = json.loads(r1.vtysh_cmd("show bgp neighbor json"))
        expected = {
            "192.168.1.2": {
                "bgpState": "Established",
                "neighborCapabilities": {
                    "dynamic": "advertisedAndReceived",
                    "softwareVersion": {
                        "advertisedSoftwareVersion": None,
                        "receivedSoftwareVersion": None,
                    },
                },
                "connectionsEstablished": 1,
                "connectionsDropped": 0,
            }
        }
        return topotest.json_cmp(output, expected)
    test_func = functools.partial(
        _bgp_converge,
    )
    _, result = topotest.run_and_expect(test_func, None, count=30, wait=1)
    assert result is None, "Can't converge"
    step("Enable software version capability and check if it's exchanged dynamically")
    r1.vtysh_cmd(
        """
    configure terminal
    router bgp
      neighbor 192.168.1.2 capability software-version
    """
    )
    r2.vtysh_cmd(
        """
    configure terminal
    router bgp
      neighbor 192.168.1.1 capability software-version
    """
    )
    def _bgp_check_if_session_not_reset():
        def _bgp_software_version():
            try:
                versions = output["192.168.1.2"]["neighborCapabilities"][
                    "softwareVersion"
                ]
                adv = versions["advertisedSoftwareVersion"]
                rcv = versions["receivedSoftwareVersion"]
                if not adv and not rcv:
                    return ""
                pattern = "FRRouting/\\d.+"
                if re.search(pattern, adv) and re.search(pattern, rcv):
                    return adv, rcv
            except:
                return ""
        output = json.loads(r1.vtysh_cmd("show bgp neighbor json"))
        adv, rcv = _bgp_software_version()
        expected = {
            "192.168.1.2": {
                "bgpState": "Established",
                "neighborCapabilities": {
                    "dynamic": "advertisedAndReceived",
                    "softwareVersion": {
                        "advertisedSoftwareVersion": adv,
                        "receivedSoftwareVersion": rcv,
                    },
                },
                "connectionsEstablished": 1,
                "connectionsDropped": 0,
            }
        }
        return topotest.json_cmp(output, expected)
    test_func = functools.partial(
        _bgp_check_if_session_not_reset,
    )
    _, result = topotest.run_and_expect(test_func, None, count=30, wait=1)
    assert (
        result is None
    ), "Session was reset after enabling software version capability"