def METHOD_NAME(self):
    """
    Enrolls a Yubikey in YUBICO mode and verifies OTPs against it
    """
    url = self.testcase.http_host
    if self.testcase.http_port:
        url = "%s:%s" % (self.testcase.http_host, self.testcase.http_port)
    # Enroll Yubikey
    serialnum = "01382015"
    yubi_slot = 1
    serial = "UBAM%s_%s" % (serialnum, yubi_slot)
    otpkey = "9163508031b20d2fbb1868954e041729"
    yubi_otplen = 48
    description = "Enrolled by TestYubikey"
    public_uid = "ecebeeejedecebeg"
    inittoken_response = self.testcase.manage_ui.admin_api_call(
        "admin/init",
        {
            "type": "yubikey",
            "serial": serial,
            "otpkey": otpkey,
            "otplen": yubi_otplen,
            "description": description,
        },
    )
    assert inittoken_response, "Error enrolling Yubikey"
    self.testcase.manage_ui.user_view.select_user(self.user_name)
    pin = "asdf1234"
    self.testcase.manage_ui.token_view.assign_token(serial, pin)
    validate = Validate(
        self.testcase.http_protocol,
        self.testcase.http_host,
        self.testcase.http_port,
        self.testcase.http_username,
        self.testcase.http_password,
    )
    valid_otps = [
        public_uid + "fcniufvgvjturjgvinhebbbertjnihit",
        public_uid + "tbkfkdhnfjbjnkcbtbcckklhvgkljifu",
        public_uid + "ktvkekfgufndgbfvctgfrrkinergbtdj",
        public_uid + "jbefledlhkvjjcibvrdfcfetnjdjitrn",
        public_uid + "druecevifbfufgdegglttghghhvhjcbh",
        public_uid + "nvfnejvhkcililuvhntcrrulrfcrukll",
        public_uid + "kttkktdergcenthdredlvbkiulrkftuk",
        public_uid + "hutbgchjucnjnhlcnfijckbniegbglrt",
        public_uid + "vneienejjnedbfnjnnrfhhjudjgghckl",
        public_uid + "krgevltjnujcnuhtngjndbhbiiufbnki",
        public_uid + "kehbefcrnlfejedfdulubuldfbhdlicc",
        public_uid + "ljlhjbkejkctubnejrhuvljkvglvvlbk",
    ]
    for otp in valid_otps:
        access_granted, _ = validate.validate(
            user=self.user_name + "@" + self.realm_name, password=pin + otp
        )
        assert access_granted, (
            "OTP: "
            + pin
            + otp
            + " for user "
            + self.user_name
            + "@"
            + self.realm_name
            + " returned False"
        )
    # validate/check_yubikey
    password = pin + public_uid + "eihtnehtetluntirtirrvblfkttbjuih"
    cy_auth = HTTPDigestAuth(
        self.testcase.http_username, self.testcase.http_password
    )
    cy_validate_url = (
        self.testcase.http_protocol
        + "://"
        + url
        + "/validate/check_yubikey?"
    )
    response = requests.get(
        cy_validate_url,
        params={"pass": password},
        auth=cy_auth,
        verify=False,
    )
    assert response.status_code == 200, "Invalid response %r" % response
    return_json = response.json()
    assert return_json["result"]["status"], (
        "Invalid return value: %r" % return_json
    )
    assert return_json["result"]["value"], (
        "Invalid return value: %r" % return_json
    )
    assert return_json["detail"]["user"] == self.user_name, (
        "Invalid return value: %r" % return_json
    )
    assert return_json["detail"]["realm"] == self.realm_name, (
        "Invalid return value: %r" % return_json
    )
    # Repeat an old (therefore invalid) OTP value
    invalid_otp = public_uid + "fcniufvgvjturjgvinhebbbertjnihit"
    access_granted, _ = validate.validate(
        user=self.user_name + "@" + self.realm_name,
        password=pin + invalid_otp,
    )
    assert not access_granted, (
        "OTP: "
        + pin
        + invalid_otp
        + " for user "
        + self.user_name
        + "@"
        + self.realm_name
        + " should be rejected."
    )
    # Repeat an old (therefore invalid) OTP value with
    # validate/check_yubikey
    invalid_otp = pin + public_uid + "fcniufvgvjturjgvinhebbbertjnihit"
    response = requests.get(
        cy_validate_url,
        params={"pass": password},
        auth=cy_auth,
        verify=False,
    )
    assert response.status_code == 200, "Invalid response %r" % response
    return_json = response.json()
    assert return_json["result"]["status"], (
        "Invalid return value: %r" % return_json
    )
    assert not return_json["result"]["value"], (
        "Invalid return value: %r" % return_json
    )
    assert "user" not in return_json, (
        "Response should not contain user %r" % return_json
    )
    assert "realm" not in return_json, (
        "Response should not contain realm %r" % return_json
    )
    if "detail" in return_json:
        assert "user" not in return_json["detail"], (
            "Response should not contain detail.user %r" % return_json
        )
        assert "realm" not in return_json["detail"], (
            "Response should not contain detail.realm %r" % return_json
        )