#!/usr/bin/env python3
""""
 SPDX-FileCopyrightText: 2021-present Open Networking Foundation <info@opennetworking.org>

 SPDX-License-Identifier: Apache-2.0
"""

import check_cli

expected_headers = ['UeID', 'CellGlobalID', 'RrcState']

UE_ID_REGEX = r'^[0-9a-f]{4,6}$'
CELL_GLOBAL_ID_REGEX = r'^[0-9a-f]{15}$'
RRC_STATE_REGEX = r'^CONNECTED|IDLE$'

if __name__ == '__main__':
    success = int(0)
    failure = int(1)

    expected_regexes = [
        UE_ID_REGEX,
        CELL_GLOBAL_ID_REGEX,
        RRC_STATE_REGEX,
    ]
    check = 'MHO UEs'
    ok, output = check_cli.check_cli_output(check, expected_headers, expected_regexes)

    if not ok:
        print("Check " + check + " failed")
        exit(failure)

    print("Check " + check + " passed")

    exit(success)
