def METHOD_NAME(self):
    """
    Basic sanity check of UE downlink/uplink flows during attach and
    detach procedures.
    """
    datapath = get_datapath()
    MAX_NUM_RETRIES = 5
    print("Checking for default table 0 flows")
    flows = get_flows(datapath, {"table_id": self.SPGW_TABLE})
    assert len(flows) == 2, "There should only be 2 default table 0 flows"
    self._s1ap_wrapper.configUEDevice(1)
    req = self._s1ap_wrapper.ue_req
    print("Running End to End attach for UE id ", req.ue_id)
    self._s1ap_wrapper._s1_util.attach(
        req.ue_id, s1ap_types.tfwCmd.UE_END_TO_END_ATTACH_REQUEST,
        s1ap_types.tfwCmd.UE_ATTACH_ACCEPT_IND,
        s1ap_types.ueAttachAccept_t,
    )
    self._s1ap_wrapper._s1_util.receive_emm_info()
    # UPLINK
    gtp_br_util = GTPBridgeUtils()
    gtp_port_no = gtp_br_util.get_gtp_port_no()
    print("Checking for uplink flow in-port %d", gtp_port_no)
    # try at least 5 times before failing as gateway
    # might take some time to install the flows in ovs
    for i in range(MAX_NUM_RETRIES):
        print("Get uplink flows: attempt ", i)
        uplink_flows = get_flows(
            datapath,
            {
                "table_id": self.SPGW_TABLE,
                "match": {"in_port": gtp_port_no},
            },
        )
        if len(uplink_flows) > 0:
            break
        time.sleep(5)  # sleep for 5 seconds before retrying
    assert len(uplink_flows) == 1, "Uplink flow missing for UE"
    assert uplink_flows[0]["match"]["tunnel_id"] is not None,\
        "Uplink flow missing tunnel id match"
    self.check_imsi_metadata(uplink_flows[0], req)
    # DOWNLINK
    print("Checking for downlink flow")
    ue_ip = str(self._s1ap_wrapper._s1_util.get_ip(req.ue_id))
    # Ryu can't match on ipv4_dst, so match on uplink in port
    # try at least 5 times before failing as gateway
    # might take some time to install the flows in ovs
    for i in range(MAX_NUM_RETRIES):
        print("Get downlink flows: attempt ", i)
        downlink_flows = get_flows(
            datapath,
            {
                "table_id": self.SPGW_TABLE,
                "match": {
                    "nw_dst": ue_ip,
                    "eth_type": 2048,
                    "in_port": self.LOCAL_PORT,
                },
            },
        )
        if len(downlink_flows) > 0:
            break
        time.sleep(5)  # sleep for 5 seconds before retrying
    assert len(downlink_flows) == 1, "Downlink flow missing for UE"
    assert downlink_flows[0]["match"]["ipv4_dst"] == ue_ip, \
        "UE IP match missing from downlink flow"
    actions = downlink_flows[0]["instructions"][0]["actions"]
    has_tunnel_action = any(
        action for action in actions
        if action["field"] == "tunnel_id" and
        action["type"] == "SET_FIELD"
    )
    assert has_tunnel_action, "Downlink flow missing set tunnel action"
    self.check_imsi_metadata(downlink_flows[0], req)
    print("Running UE detach for UE id ", req.ue_id)
    # Now detach the UE
    self._s1ap_wrapper.s1_util.detach(
        req.ue_id, s1ap_types.ueDetachType_t.UE_NORMAL_DETACH.value, True,
    )
    print("Checking that uplink/downlink flows were deleted")
    flows = get_flows(datapath, {"table_id": self.SPGW_TABLE})
    assert len(flows) == 2, "There should only be 2 default table 0 flows"