def METHOD_NAME(test_obj):
    """
    produce the expected error message
    :param test_obj: NumaTest object
    :return: str, error message to be checked
    """
    err_msg = test_obj.params.get('err_msg', '')
    if err_msg:
        numa_cells = eval(test_obj.params.get('numa_cells', '[]'))
        if numa_cells:
            test_obj.test.log.debug('numa_cells=%s', numa_cells)
            memaccess_invalid = numa_cells[0].get('memAccess') == 'invalid'
            attr_str = 'memAccess' if memaccess_invalid else 'discard'
            err_msg = err_msg % attr_str
    return err_msg