/**
 * @file utfw_test_main.c 
 *
 * @brief This file contains functions that provides demonstration of
 *        usage of UTFW
 *
 * @copyright Copyright 2023 Antaris, Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *        usage of TC TM Library APIs
 */
/*********************************************************************/

#if defined(TEST_LAYER)
#include "exo_tctm_ipc.h"
#include "utfw_test_main.h"
#include "exo_common.h"
#include "tc_tm_mngr_buffer.h"
#include "obc_main.h"
#include "exo_io_al_sos_timer.h"
#include "eps.h"
#include "comms_csw.h"
#include "comms_uhf_rf_cfg.h"
#include "adcs_bsk_sim.h"
#include "mcp9843_intf.h"
#include "ds620_interface.h"
#include "ina230_interface.h"
#include "adm1176_interface.h"
#include <stdio.h>
#include <unistd.h>

/** Header files */
/** Macros */
/** Global Variables */
/** Prototypes */
/** Functions */

/** comments */

#define PRIORITY_0            0
#define PRIORITY_1            1
#define PRIORITY_2            2
#define TEST_DATA             0xA5
#define STRESS_INST_CNT       270
#define WRAP_DSB              1
#define WRAP_ENB              0
#define ERROR_HDLR_HM_SIZE    41
#define INST_SIZE0           0
#define INST_SIZE3           3
#define INST_SIZE5           5
#define INST_CNT0            0
#define INST_CNT3            3
#define INST_CNT5            5
#define INVALID               0XFF

#define COMMS_SBAND_INST     270 
                                
/*with 400 instance of comms sband (156 bytes), we will have 62k TM data*/
#define MAX_TM_INST          400
/**
 * @brief This structure contains control variables
 * to handle test case response
 */
typedef struct
{
    uint32_t current_test_case_id;
    uint16_t queue_cnt;
    uint16_t inst_cnt;
    uint8_t queue_id;
    uint32_t inst_size;
    uint16_t succ_cntr;
    uint8_t wrap_dsb_enq_succ;
   uint8_t wrap_dsb_data_drop; 
   uint32_t test_layer_enq_succ;
}hm_ut_cb;

hm_ut_cb hm_control_var={0};


/**
 * @brief This structure contains control variables
 * to handle test case response
 */
typedef enum  
{
    BUFF_REQ_SINGLE_QUEUE=1,
    BUFF_REQ_MULTIPLE_QUEUE,
    ENQUEUE_REQ_SINGLE_QUEUE,
    ENQUEUE_REQ_MULTIPLE_QUEUE,
    BUFF_REQ_WITHOUT_PLD,
    BUFF_REQ_INVALID_QUEUE,
    ENQUEUE_REQ_WITHOUT_PLD,
    ENQUEUE_REQ_INVALID_QUEUE,
    ENQUEUE_REQ_INACTIVE_QUEUE,
    ENQUEUE_REQ_WRAP_DSB_DATA_DROP,
    ENQUEUE_REQ_QUEUE_FULL,
    BUFF_REQ_QUEUE_CREATE_FAIL,
    FLUSH_SUCC_VAL_MOD_QUEUE_PRI,
    FLUSH_FAIL_INVAL_MOD_QUEUE_PRI,
    FLUSH_SUCC_INVAL_MOD_QUEUE_VAL_PRI,
    FLUSH_FAIL_VAL_MOD_INVAL_QUEUE_PRI,
    FLUSH_SUCC_VAL_MOD_PRI_INVAL_QUEUE,
    FLUSH_FAIL_VAL_MOD_QUEUE_NOT_ACTIVE,
    CHNGE_QPRI_SUCC_INVAL_MOD_QUEUE_VAL_PRI,
    CHNGE_QPRI_FAIL_VAL_MOD_INVAL_QUEUE_PRI,
    CHNGE_QPRI_SUCC_VAL_MOD_INVALID_QUE,
    CHNGE_QPRI_FAIL_VAL_MOD_QUEUE_INACTIVE,
    CHNGE_QPRI_SUCC_VAL_MOD_QUEUE_ACTIVE,
    DEL_QUEUE_FAIL_INACTIVE_QUEUE,
    DEL_QUEUE_SUCC_ACTIVE_QUEUE,
    CHNGE_MOD_PRI_FAIL_INVAL_MOD,
    CHNGE_MOD_PRI_FAIL_VAL_MOD_PRI,
    CHNGE_MOD_PRI_SUCC_VAL_MOD_PRI,
    DL_REQ_FAIL_VAL_MOD_QUEUE_INACTIVE,
    DL_REQ_SUCC_VAL_MOD_QUEUE_ACTIVE,
    DL_REQ_FAIL_INVAL_MOD_QUEUE_PRI,
    DL_REQ_SUCC_INVAL_MOD_QUEUE_VAL_PRI,
    DL_REQ_FAIL_VAL_MOD_INVAL_QUEUE_PRI,
    DL_REQ_SUCC_VAL_MOD_PRI_INVAL_QUEUE,
    EPS_STRESS_TEST_SIMU,
    ADCS_STRESS_TEST_SIMU,
    COMMS_SBAND_STRESS_TEST_SIMU,
    COMMS_UHF_STRESS_TEST_SIMU,
    SENSORS_STRESS_TEST_SIMU,
    OBC_STRESS_TEST_SIMU,
    ERROR_HANDLER_STRESS_TEST_SIMU,
    ALL_MODULE_QUEUE_SIZE,
    MAX_TM_DOWNLOAD_CHECK_62K,
    TCTM_SEGMENTED_PKT_TEST,
 
        HM_TEST_CASE_MAX
}hm_test_cases;


/**
 * @brief This enum contains success response cnt
 * from HM layer
 */
typedef enum
{
    SUCC_CNT_1=1,
    SUCC_CNT_2,
    SUCC_CNT_3,
    SUCC_CNT_4,
    SUCC_CNT_5,
    SUCC_CNT_10=10,
    SUCC_CNT_11=11,
    SUCC_CNT_12=12,
    SUCC_CNT_13=13,
    SUCC_CNT_14=14,
    SUCC_CNT_15=15,
    SUCC_CNT_16=16,
    SUCC_CNT_90=90,
    SUCC_CNT_270=270,
    SUCC_CNT_540=540,
    SUCC_CNT_810=810,
    SUCC_CNT_1080=1080,
    SUCC_CNT_1350=1350,
    SUCC_CNT_1620=1620,
    SUCC_CNT_1890=1890,
    SUCC_CNT_2160=2160,
    SUCC_CNT_2430=2430,
    SUCC_CNT_2700=2700,
    SUCC_CNT_2970=2970,
    SUCC_CNT_3240=3240,
    SUCC_CNT_3510=3510,
    SUCC_CNT_3780=3780,
    SUCC_CNT_4050=4050,
    SUCC_CNT_4320=4320,

}hm_success_cnt;


/**
 * @brief This enum contains success or failure response
 * of the test case
 */
typedef enum
{
    TEST_CASE_SUCC,
    TEST_CASE_FAIL

}hm_test_resp;

/**
 * @brief This enum contains queue ID
 * for sending IPC message to HM layer
 */
typedef enum
{
    QUEUE_ID0,
    QUEUE_ID1,
    QUEUE_ID2,
    QUEUE_ID3,
    QUEUE_ID4,
    QUEUE_ID5,
    QUEUE_ID6,
    QUEUE_ID7,
    QUEUE_ID8,
    QUEUE_ID9,
    QUEUE_ID10,
    QUEUE_ID11,
    QUEUE_ID12,
    QUEUE_ID13,
    QUEUE_ID14,
    QUEUE_ID15,
    QUEUE_ID16,
    QUEUE_ID17,
    QUEUE_ID18,
    QUEUE_ID19,
    QUEUE_ID20,

    MAX_QUEUE_ID

}hm_queue_id;

static void test_layer_thread (void * params);

/**
 * @brief This API will initialize the test layer
 */
void test_task_init(void)
{
    /** All the test task init goes here */

    /** Start the test task */
    start_test_task();
}
/**
 * @brief This API will start the test task 
 */
os_status_t start_test_task(void)
{
    os_status_t os_sts;

    os_sts= os_thread_create(TEST_TASK, T_TEST_TASK_STACK_SIZE, P_TASK_TEST,"TASK_LAYER_TEST", \
            test_layer_thread, NULL, NULL, NULL);

    return os_sts;
}

/**
 * @brief This API will send enqueue request for stress test of EPS,ADCS and sensors 
 * with specified Queue ID, data and data len
 * */
void stress_test(uint8_t queue_id, uint8_t *data, uint16_t data_len, uint16_t no_instance)
{
     hm_enqueue_req enq_req={0};

    if(data)
    {
        os_memset(data, TEST_DATA, data_len);
    }
    else
    {
        //malloc error
    }
    for(int cntr_1 =1;cntr_1<=no_instance;cntr_1++)
    {
        enq_req.data=data;

        enq_req.mod_id=TEST_TASK;
        enq_req.q_id=queue_id;
        enq_req.inst_size=data_len;

        enqueue_req(enq_req);
#ifdef LINUX_TEMP_PORT
        //os_delay(1);    // ADCS and Sensors stress test not working without delay
        usleep(1000);
#else
        os_delay(1);    // ADCS and Sensors stress test not working without delay
#endif
    }
    os_free(data);
}

/**
 * @brief This API will send buffer request to HM Framework with
 * specified Instance size, No of instance, Queue ID and Priority
 */
void queue_req(hm_queue_req test_buff_req)
{
    os_itc_msg_handle_t test_layer_send_ipc_msg;
    s_tc_tm_buffer_req *buff_req = os_malloc(sizeof(s_tc_tm_buffer_req));
    if(buff_req)
    {
        os_memset(buff_req, 0, sizeof(s_tc_tm_buffer_req));

        buff_req->queue_id = test_buff_req.q_id;
        buff_req->instance_size = test_buff_req.inst_size;
        buff_req->num_instance = test_buff_req.inst_cnt;
        buff_req->wrap_dsb = test_buff_req.wrap;
        buff_req->priority = test_buff_req.pri;
        buff_req->strg_flag = 0;
        buff_req->thresh = 0;

        test_layer_send_ipc_msg.pld.pld_ptr = (void*)buff_req;
        test_layer_send_ipc_msg.src_entity = TEST_TASK;
        test_layer_send_ipc_msg.Msg_id = OBC_TC_TM_BUFFER_REQ;

        os_itc_msg_send(&test_layer_send_ipc_msg, HM_MANAGER_IPC_RECEIVE, os_send_itc_wait);
    }
}

/**
 * @brief This API will send enqueue request to HM Framework with
 * specified Instance size, Queue ID
 */
void enqueue_req(hm_enqueue_req test_enqueue_req)
{
    hm_control_var.test_layer_enq_succ++;
    os_itc_msg_handle_t test_layer_send_ipc_msg;
    test_layer_send_ipc_msg.pld.pld_ptr = os_malloc(test_enqueue_req.inst_size);
    if(NULL == test_enqueue_req.data)
    {
        os_memset(test_layer_send_ipc_msg.pld.pld_ptr, TEST_DATA, test_enqueue_req.inst_size);
    }
    else
    {
        os_memcpy(test_layer_send_ipc_msg.pld.pld_ptr, test_enqueue_req.data, test_enqueue_req.inst_size);
    }

    test_layer_send_ipc_msg.pld.pld_data = test_enqueue_req.q_id;
    test_layer_send_ipc_msg.src_entity = test_enqueue_req.mod_id;
    test_layer_send_ipc_msg.Msg_id = OBC_TC_TM_ENQUEUE_REQ;
    os_itc_msg_send(&test_layer_send_ipc_msg, HM_MANAGER_IPC_RECEIVE, os_wait_forever);

}

/**
 * @brief This API will flush the data in queue based on
 * specified Queue ID, Sub_mod ID and Priority
 */
void flush_req(hm_flush_req test_flush_req)
{
    os_itc_msg_handle_t test_layer_send_ipc_msg;
    s_tc_tm_flush_q_req *flush_req = os_malloc(sizeof(s_tc_tm_flush_q_req));
    if(flush_req)
    {
        os_memset(flush_req, 0, sizeof(s_tc_tm_buffer_req));
        flush_req->queue_id = test_flush_req.q_id;
        flush_req->submod_id = test_flush_req.mod_id;
        flush_req->priority = test_flush_req.pri;

        test_layer_send_ipc_msg.pld.pld_ptr = (void*)flush_req;
        test_layer_send_ipc_msg.src_entity = TEST_TASK;
        test_layer_send_ipc_msg.Msg_id = OBC_TC_TM_FLUSH_QUEUE_REQ;
        os_itc_msg_send(&test_layer_send_ipc_msg, HM_MANAGER_IPC_RECEIVE, os_send_itc_wait);
    }
}

/**
 * @brief This API will change priority of a queue based on
 * specified Queue ID, Sub_mod ID and Priority
 */
void change_queue_pri_req(hm_chng_queue_pri_req test_queue_pri_req)
{
    os_itc_msg_handle_t test_layer_send_ipc_msg;
    s_tc_tm_chng_q_priority *queue_pri_req = os_malloc(sizeof(s_tc_tm_chng_q_priority));
    if(queue_pri_req)
    {
        os_memset(queue_pri_req, 0, sizeof(s_tc_tm_chng_q_priority));
        queue_pri_req->queue_id = test_queue_pri_req.q_id;
        queue_pri_req->submod_id =test_queue_pri_req. mod_id;
        queue_pri_req->priority = test_queue_pri_req.pri;
        queue_pri_req->cur_priority = test_queue_pri_req.cur_pri;

        test_layer_send_ipc_msg.pld.pld_ptr = (void*)queue_pri_req;
        test_layer_send_ipc_msg.src_entity = TEST_TASK;
        test_layer_send_ipc_msg.Msg_id = OBC_TC_TM_CHNG_QUEUE_PRIORITY_REQ;
        os_itc_msg_send(&test_layer_send_ipc_msg, HM_MANAGER_IPC_RECEIVE, os_send_itc_wait);
    }
}

/**
 * @brief This API will DL a queue based on
 * specified Queue ID, Sub_mod ID and Priority
 */
void dl_request(hm_dl_req test_dl_req)
{

    os_itc_msg_handle_t test_layer_send_ipc_msg;
    s_tc_tm_dl_q_req *dl_req = os_malloc(sizeof(s_tc_tm_dl_q_req));
    if(dl_req)
    {
        os_memset(dl_req, 0, sizeof(s_tc_tm_dl_q_req));
        dl_req->queue_id = test_dl_req.q_id;
        dl_req->submod_id = test_dl_req.mod_id;
        dl_req->priority = test_dl_req.pri;

        test_layer_send_ipc_msg.pld.pld_ptr = (void*)dl_req;
        test_layer_send_ipc_msg.pld.pld_data = GS2_BACK_DOOR_SOC;
        if(test_dl_req.mod_id == INVALID)
        {
            test_layer_send_ipc_msg.src_entity = TEST_TASK;
        }
        else
        {
            test_layer_send_ipc_msg.src_entity = test_dl_req.mod_id;
        }
        test_layer_send_ipc_msg.Msg_id = OBC_TC_TM_DL_BUFFER_REQ;
        os_itc_msg_send(&test_layer_send_ipc_msg, HM_MANAGER_IPC_RECEIVE, os_send_itc_wait);
    }
}

/**
 * @brief This API will change priority of a module based on
 * specified Queue ID, Sub_mod ID and Priority
 */
void change_mod_pri_req(hm_chng_mod_pri_req test_mod_pri_req)
{
    os_itc_msg_handle_t test_layer_send_ipc_msg;
    s_tc_tm_chng_mod_priority *mod_pri_req = os_malloc(sizeof(s_tc_tm_chng_mod_priority));
    if(mod_pri_req)
    {
        os_memset(mod_pri_req, 0, sizeof(s_tc_tm_chng_mod_priority));
        mod_pri_req->submod_id = test_mod_pri_req.mod_id;
        mod_pri_req->priority = test_mod_pri_req.pri;
        mod_pri_req->cur_priority = test_mod_pri_req.cur_pri;

        test_layer_send_ipc_msg.pld.pld_ptr = (void*)mod_pri_req;
        test_layer_send_ipc_msg.src_entity = TEST_TASK;
        test_layer_send_ipc_msg.Msg_id = OBC_TC_TM_CHNG_SUB_MOD_PRIORITY_REQ;
        os_itc_msg_send(&test_layer_send_ipc_msg, HM_MANAGER_IPC_RECEIVE, os_send_itc_wait);
    }
}

/**
 * @brief This API will delete the queue with
 * specified Queue ID
 */
void delete_req(hm_del_req test_del_req)
{
    os_itc_msg_handle_t test_layer_send_ipc_msg;
    os_memset(&test_layer_send_ipc_msg, 0x00, sizeof(os_itc_msg_handle_t));
    test_layer_send_ipc_msg.pld.pld_data = test_del_req.q_id;
    test_layer_send_ipc_msg.src_entity = test_del_req.app_id;
    test_layer_send_ipc_msg.Msg_id = OBC_TC_TM_DEL_QUEUE_REQ;
    os_itc_msg_send(&test_layer_send_ipc_msg, HM_MANAGER_IPC_RECEIVE, os_send_itc_wait);
}

/**
 * @brief This API will send the test case response
 * to OBC
 */
void send_itc_test_case_resp(uint32 test_id,uint8 src_entity, uint16 Msg_id, uint32 pld_data, uint32 dst_id)
{
    //DEBUG_CPRINT(("TEST_LAYER: Sending test case response to OBC));
    os_itc_msg_handle_t rsp_ipc_msg;
    test_case_rsp test_ipc_rsp;

    test_ipc_rsp.test_id = test_id;
    test_ipc_rsp.test_rsp = pld_data;

    rsp_ipc_msg.src_entity = src_entity;
    rsp_ipc_msg.pld_info = Msg_id;
    rsp_ipc_msg.Msg_id = Msg_id;
    rsp_ipc_msg.Msg_len = sizeof(test_case_rsp);
    rsp_ipc_msg.pld.pld_ptr = os_malloc(rsp_ipc_msg.Msg_len);
    os_memcpy(rsp_ipc_msg.pld.pld_ptr, (uint8 *)&test_ipc_rsp, rsp_ipc_msg.Msg_len);
    os_itc_msg_send(&rsp_ipc_msg, dst_id, os_send_itc_wait);
}

/**
 * @brief This API listens for any TC from GS and 
 * post ITC to necessary layers
 */
static void test_layer_thread (void * params)
{
    os_itc_msg_handle_t test_layer_rcv_ipc_msg;
    os_itc_msg_handle_t test_layer_send_ipc_msg;

    hm_queue_req buff_req={0};
    hm_enqueue_req enq_req={0};
    hm_flush_req test_flush_req={0};
    hm_chng_queue_pri_req chnge_queue_pri_req={0};
    hm_chng_mod_pri_req chnge_mod_pri_req={0};
    hm_dl_req dl_req={0};
    hm_del_req del_req={0};

    uint8 test_case_id = 0;
    uint8 *pld;
    //uint8 queue_num = 0;
    uint32 inst_size=0;
    uint16_t no_inst=0;
    uint16_t no_queue=0;
    hm_control_var.succ_cntr=0;

    DEBUG_CPRINT(("\n Test LAYER TASK STARTED\n"));

    /** Infinite loop */
    while(1)
    {
        /** - Waiting for message to receive */
        os_itc_msg_rcv(TEST_TASK, &test_layer_rcv_ipc_msg, os_wait_forever); //os_wait_forever

        /** - Check for source entity */
        switch(test_layer_rcv_ipc_msg.src_entity)
        {
            /**  - Source is GS */
            case TC_SRC_GS:
                {
                    DEBUG_CPRINT(("\nMessage received from GS\n"));

                    /**   - Switch for MSG_ID */
                    switch(test_layer_rcv_ipc_msg.Msg_id)
                    {
                        /**    - This is to test the Buffering FW */
                        case TC_HM_TEST_CASE_REQ:
                            {
                                DEBUG_CPRINT(("\nTest case For Buffering FW received in Test layer\n"));
                                pld = test_layer_rcv_ipc_msg.pld.pld_ptr;
                                test_case_id = pld[3];
                                hm_control_var.current_test_case_id = test_case_id;
                                switch(test_case_id)
                                {
                                    case BUFF_REQ_SINGLE_QUEUE:
                                        {
                                            memcpy(&buff_req.inst_size, &pld[4], sizeof(inst_size));
                                            memcpy(&buff_req.inst_cnt, &pld[8], sizeof(no_inst));
                                            buff_req.q_id=pld[10];
                                            buff_req.pri = PRIORITY_2;
                                            buff_req.wrap = WRAP_ENB;
                                            hm_control_var.queue_id= buff_req.q_id;
                                            /*Single queue create - with queue_id, instance size and number
                                             * of instance given as input from GS
                                             * Priority as 2
                                             */
                                         //   DEBUG_CPRINT(("Control_var_qid = %d, Gs_qid= %d \n", hm_control_var.queue_id,buff_req.q_id));
                                            queue_req(buff_req);

                                        }
                                        break;
                                    case BUFF_REQ_MULTIPLE_QUEUE:
                                        {
                                            memcpy(&buff_req.inst_size, &pld[4], sizeof(inst_size));
                                            memcpy(&buff_req.inst_cnt, &pld[8], sizeof(no_inst));
                                            memcpy(&no_queue, &pld[10], sizeof(no_queue));
                                            buff_req.pri =PRIORITY_2;
                                            buff_req.wrap =  WRAP_ENB;
                                            hm_control_var.queue_cnt=no_queue;
                                            /*Single queue create - instance size, number
                                             * of instance and number of queue
                                             * given as input from GS
                                             * Priority as 2, Queue ID 1 to 5
                                             */
                                            DEBUG_CPRINT(("\nTest case requesting buffer of instance size %d and depth %d No of queue %d\n",inst_size,no_inst,no_queue));
                                            for(int cntr=1; cntr <= no_queue ; cntr++)
                                            {
                                                buff_req.q_id=cntr;
                                                queue_req(buff_req);
                                            }
                                        }
                                        break;

                                    case ENQUEUE_REQ_SINGLE_QUEUE:
                                        {  
                                            /*Single enqueue request- Queue ID, no of instance
                                             * and instance size given as input from GS
                                             */

                                            memcpy(&buff_req.inst_size, &pld[4], sizeof(inst_size));
                                            memcpy(&buff_req.inst_cnt, &pld[8], sizeof(no_inst));
                                            buff_req.q_id=pld[10];
                                            buff_req.pri = PRIORITY_2;
                                            buff_req.wrap = WRAP_ENB;
                                            hm_control_var.queue_id= buff_req.q_id;
                                            hm_control_var.inst_cnt=buff_req.inst_cnt;
                                            hm_control_var.inst_size=buff_req.inst_size;

                                            queue_req(buff_req);


                                        }
                                        break;

                                    case ENQUEUE_REQ_MULTIPLE_QUEUE:
                                        {
                                            /*Single enqueue request- Instance size,
                                             *number of instance and number of queue
                                             * given as input from GS
                                             */
                                            memcpy(&buff_req.inst_size, &pld[4], sizeof(inst_size));
                                            memcpy(&buff_req.inst_cnt, &pld[8], sizeof(no_inst));
                                            buff_req.pri = PRIORITY_2;
                                            buff_req.wrap = WRAP_ENB;
                                            memcpy(&no_queue, &pld[10], sizeof(no_queue));
                                            hm_control_var.queue_cnt=no_queue;
                                            hm_control_var.inst_cnt=buff_req.inst_cnt;
                                            hm_control_var.inst_size = buff_req.inst_size;

                                            for(int cntr=1; cntr <= no_queue ; cntr++)
                                            {
                                                buff_req.q_id=cntr;
                                                queue_req(buff_req);
                                            }
                                        }
                                        break;

                                    case BUFF_REQ_WITHOUT_PLD:
                                        {
                                            /*Queue request without payload*/
                                            DEBUG_CPRINT(("\nTest case for buffer request without payload\n"));
                                            test_layer_send_ipc_msg.pld.pld_ptr = NULL;
                                            test_layer_send_ipc_msg.src_entity = TEST_TASK;
                                            test_layer_send_ipc_msg.Msg_id = OBC_TC_TM_BUFFER_REQ;
                                            os_itc_msg_send(&test_layer_send_ipc_msg, HM_MANAGER_IPC_RECEIVE, os_send_itc_wait);
                                        }
                                        break;

                                    case BUFF_REQ_INVALID_QUEUE:
                                        {
                                            /*Queue request with invalid queue ID*/
                                            DEBUG_CPRINT(("\nTest case requesting buffer with INVALID queue ID\n"));
                                            buff_req.q_id= INVALID;
                                            buff_req.inst_size = INST_SIZE5;
                                            buff_req.inst_cnt = INST_CNT5;
                                            buff_req.wrap = WRAP_ENB;
                                            buff_req.pri = PRIORITY_2;
                                            queue_req(buff_req);
                                        }
                                        break;

                                    case ENQUEUE_REQ_WITHOUT_PLD:
                                        {
                                            /*Enqueue request without payload*/
                                            DEBUG_CPRINT(("\nTest case for enqueue request without payload\n"));
                                            test_layer_send_ipc_msg.pld.pld_ptr = NULL;
                                            test_layer_send_ipc_msg.pld.pld_data = 0; 
                                            test_layer_send_ipc_msg.src_entity = TEST_TASK;
                                            test_layer_send_ipc_msg.Msg_id = OBC_TC_TM_ENQUEUE_REQ;
                                            os_itc_msg_send(&test_layer_send_ipc_msg, HM_MANAGER_IPC_RECEIVE, os_send_itc_wait);

                                        }
                                        break;

                                    case ENQUEUE_REQ_INVALID_QUEUE:
                                        {
                                            /*Enqueue request with Invalid Queue ID*/
                                            DEBUG_CPRINT(("\nTest case for enqueue request with Invalid queue ID \n"));
                                            enq_req.data=NULL;
                                            enq_req.mod_id=TEST_TASK;
                                            enq_req.q_id=INVALID;
                                            enq_req.inst_size=INST_SIZE5;

                                            enqueue_req(enq_req);
                                        }
                                        break;

                                    case ENQUEUE_REQ_INACTIVE_QUEUE:
                                        {

                                            /*Enqueue request with Inactive Queue*/

                                            enq_req.data=NULL;
                                            enq_req.mod_id=TEST_TASK;
                                            enq_req.q_id=QUEUE_ID1;
                                            enq_req.inst_size=INST_SIZE5;

                                            enqueue_req(enq_req);
                                        }
                                        break;
                                    case ENQUEUE_REQ_WRAP_DSB_DATA_DROP:
                                        {
                                            /*Buffer request - Queue ID:0, Instance size-5, No of instance - 3
                                             *Wrap - Disabled */

                                            DEBUG_CPRINT(("\nTese case requesting buffer of instance size 5 and depth 3, queue id 0\n"));

                                            buff_req.q_id= QUEUE_ID0;
                                            buff_req.inst_size = INST_SIZE5;
                                            buff_req.inst_cnt = INST_CNT3;
                                            buff_req.pri =PRIORITY_2;
                                            buff_req.wrap = WRAP_DSB;

                                            queue_req(buff_req);

                                            /*Enqueue done in queue request response*/
                                        }
                                        break;
                                    case ENQUEUE_REQ_QUEUE_FULL:
                                        {
                                            /*Buffer request - Queue ID:0, Instance size-5, No of instance - 3
                                             * Wrap - Enabled */

                                            DEBUG_CPRINT(("\nTese case requesting buffer of instance size 5 and depth 3, queue id 0\n"));

                                            buff_req.q_id=QUEUE_ID0;
                                            buff_req.inst_size = INST_SIZE5;
                                            buff_req.inst_cnt = INST_CNT3;
                                            buff_req.pri = PRIORITY_2;
                                            buff_req.wrap =WRAP_ENB ;
                                                           
                                            queue_req(buff_req);

                                            /*Enqueue done in queue request response*/
                                        }
                                        break;
                                    case BUFF_REQ_QUEUE_CREATE_FAIL:
                                        {
                                            /*Buffer request with 0 instance size and 0 no of instance
                                             * Queue create will fail in this case
                                             */
                                            buff_req.q_id=QUEUE_ID0;
                                            buff_req.inst_size = INST_SIZE0;
                                            buff_req.inst_cnt = INST_CNT0;
                                            buff_req.pri = PRIORITY_2;
                                            buff_req.wrap = WRAP_ENB ;

                                            queue_req(buff_req);
                                        }
                                        break;

                                    case FLUSH_SUCC_VAL_MOD_QUEUE_PRI:
                                        {
                                            /*Queue request of Queue ID-0, No of instance-5
                                             * Instance size-5, Priority-2
                                             */

                                            buff_req.q_id=QUEUE_ID0;
                                            buff_req.inst_size = INST_SIZE5;
                                            buff_req.inst_cnt = INST_CNT5;
                                            buff_req.pri = PRIORITY_2;
                                            buff_req.wrap = WRAP_ENB;

                                            queue_req(buff_req);
                                            /*Enqueue done in queue request response*/

                                        }
                                        break;

                                    case FLUSH_FAIL_INVAL_MOD_QUEUE_PRI:
                                        {

                                            /*Flush request of the created Queue*/

                                            test_flush_req.q_id=INVALID;
                                            test_flush_req.mod_id=INVALID;
                                            test_flush_req.pri=INVALID;

                                            flush_req(test_flush_req);
                                        }
                                        break;

                                    case FLUSH_SUCC_INVAL_MOD_QUEUE_VAL_PRI:
                                        {
                                            /*Flush request of the created Queue*/

                                            test_flush_req.q_id=INVALID;
                                            test_flush_req.mod_id=INVALID;
                                            test_flush_req.pri=PRIORITY_1;

                                            flush_req(test_flush_req);
                                        }
                                        break;
                                    case FLUSH_FAIL_VAL_MOD_INVAL_QUEUE_PRI:
                                        {
                                            /*Queue request of Queue ID-0, No of instance-5
                                             * Instance size-5, Priority-2
                                             */
                                            buff_req.q_id=QUEUE_ID0;
                                            buff_req.inst_size = INST_SIZE5;
                                            buff_req.inst_cnt = INST_CNT5;
                                            buff_req.pri = PRIORITY_2;
                                            buff_req.wrap = WRAP_ENB ;

                                            queue_req(buff_req);

                                            buff_req.q_id= QUEUE_ID1;

                                            queue_req(buff_req);

                                            /*Enqueue done in queue request response*/
                                        }
                                        break;
                                    case FLUSH_SUCC_VAL_MOD_PRI_INVAL_QUEUE:
                                        {
                                            /*Queue request of Queue ID-0, No of instance-5
                                             * Instance size-5, Priority-2
                                             */

                                            buff_req.q_id=QUEUE_ID0;
                                            buff_req.inst_size =INST_SIZE5;
                                            buff_req.inst_cnt = INST_CNT5;
                                            buff_req.pri = PRIORITY_2;
                                            buff_req.wrap = WRAP_ENB;

                                            queue_req(buff_req);

                                            buff_req.q_id= QUEUE_ID1;

                                            queue_req(buff_req);
                                        }
                                        break;
                                    case FLUSH_FAIL_VAL_MOD_QUEUE_NOT_ACTIVE:
                                        {
                                            /*Queue request of Queue ID-0, No of instance-5
                                             * Instance size-5, Priority-2
                                             */

                                            buff_req.q_id=QUEUE_ID0;
                                            buff_req.inst_size = INST_SIZE5;
                                            buff_req.inst_cnt = INST_CNT5;
                                            buff_req.pri = PRIORITY_2;
                                            buff_req.wrap = WRAP_ENB;

                                            queue_req(buff_req);
                                        }
                                        break;
                                    case CHNGE_QPRI_SUCC_INVAL_MOD_QUEUE_VAL_PRI:
                                        {
                                            /*Change priority request
                                             * Invalid submodule,Invalid queue, valid priority
                                             */
                                            chnge_queue_pri_req.q_id=INVALID;
                                            chnge_queue_pri_req.mod_id=INVALID;
                                            chnge_queue_pri_req.pri=PRIORITY_1;
                                            chnge_queue_pri_req.cur_pri=PRIORITY_2;
                                            change_queue_pri_req(chnge_queue_pri_req);

                                        }
                                        break;

                                    case CHNGE_QPRI_FAIL_VAL_MOD_INVAL_QUEUE_PRI:
                                        {

                                            /*Queue request of Queue ID-0, No of instance-5
                                             * Instance size-5, Priority-2
                                             */
                                            buff_req.q_id=QUEUE_ID0;
                                            buff_req.inst_size = INST_SIZE5;
                                            buff_req.inst_cnt = INST_CNT5;
                                            buff_req.pri = PRIORITY_2;
                                            buff_req.wrap =WRAP_ENB;

                                            queue_req(buff_req);

                                            buff_req.q_id= QUEUE_ID1;

                                            queue_req(buff_req);
                                        }
                                        break;

                                    case CHNGE_QPRI_SUCC_VAL_MOD_INVALID_QUE:
                                        {
                                            /*Queue request of Queue ID-0, No of instance-5
                                             * Instance size-5, Priority-2
                                             */
                                            buff_req.q_id=QUEUE_ID0;
                                            buff_req.inst_size = INST_SIZE5;
                                            buff_req.inst_cnt = INST_CNT5;
                                            buff_req.pri = PRIORITY_2;
                                            buff_req.wrap = WRAP_ENB;

                                            queue_req(buff_req);

                                            buff_req.q_id= QUEUE_ID1;

                                            queue_req(buff_req);
                                        }
                                        break;

                                    case CHNGE_QPRI_FAIL_VAL_MOD_QUEUE_INACTIVE:
                                        {
                                            /*Queue request of Queue ID-0, No of instance-5
                                             * Instance size-5, Priority-2
                                             */
                                            buff_req.q_id=QUEUE_ID0;
                                            buff_req.inst_size = INST_SIZE5;
                                            buff_req.inst_cnt = INST_CNT5;
                                            buff_req.pri = PRIORITY_2;
                                            buff_req.wrap = WRAP_ENB;

                                            queue_req(buff_req);
                                        }
                                        break;
                                    case CHNGE_QPRI_SUCC_VAL_MOD_QUEUE_ACTIVE:
                                        {
                                            /*Queue request of Queue ID-0, No of instance-5
                                             * Instance size-5, Priority-2
                                             */

                                            buff_req.q_id=QUEUE_ID0;
                                            buff_req.inst_size = INST_SIZE5;
                                            buff_req.inst_cnt = INST_CNT5;
                                            buff_req.pri = PRIORITY_2;
                                            buff_req.wrap = WRAP_ENB;

                                            queue_req(buff_req);
                                        }
                                        break;
                                    case DEL_QUEUE_FAIL_INACTIVE_QUEUE:
                                        {
                                            /*Delete queue*/
                                            del_req.q_id=QUEUE_ID1;
                                            del_req.app_id=TEST_TASK;

                                            delete_req(del_req);
                                        }
                                        break;
                                    case DEL_QUEUE_SUCC_ACTIVE_QUEUE:
                                        {
                                            /*Queue request of Queue ID-0, No of instance-5
                                             * Instance size-5, Priority-2
                                             */

                                            buff_req.q_id=QUEUE_ID0;
                                            buff_req.inst_size = INST_SIZE5;
                                            buff_req.inst_cnt = INST_CNT5;
                                            buff_req.pri = PRIORITY_2;
                                            buff_req.wrap = WRAP_ENB;

                                            queue_req(buff_req);
                                        }
                                        break;
                                    case CHNGE_MOD_PRI_FAIL_INVAL_MOD:
                                        {

                                            chnge_mod_pri_req.mod_id=INVALID;
                                            chnge_mod_pri_req.pri=PRIORITY_1;
                                            chnge_mod_pri_req.cur_pri=PRIORITY_2;
                                            change_mod_pri_req(chnge_mod_pri_req);
                                        }
                                        break;
                                    case CHNGE_MOD_PRI_FAIL_VAL_MOD_PRI:
                                        {
                                            chnge_mod_pri_req.mod_id=TEST_TASK;
                                            chnge_mod_pri_req.pri=INVALID;
                                            chnge_mod_pri_req.cur_pri=PRIORITY_2;

                                            change_mod_pri_req(chnge_mod_pri_req);
                                        }
                                        break;
                                    case CHNGE_MOD_PRI_SUCC_VAL_MOD_PRI:
                                        {
                                            chnge_mod_pri_req.mod_id=TEST_TASK;
                                            chnge_mod_pri_req.pri=PRIORITY_2;
                                            chnge_mod_pri_req.cur_pri=PRIORITY_1;

                                            change_mod_pri_req(chnge_mod_pri_req);
                                        }
                                        break;
                                    case DL_REQ_FAIL_VAL_MOD_QUEUE_INACTIVE:
                                        {
                                            /*Queue request of Queue ID-0, No of instance-5
                                             * Instance size-5, Priority-2
                                             */

                                            buff_req.q_id=QUEUE_ID0;
                                            buff_req.inst_size = INST_SIZE5;
                                            buff_req.inst_cnt = INST_CNT5;
                                            buff_req.pri = PRIORITY_2;
                                            buff_req.wrap = WRAP_ENB;

                                            queue_req(buff_req);
                                        }
                                        break;
                                    case DL_REQ_SUCC_VAL_MOD_QUEUE_ACTIVE:
                                        {
                                            /*Queue request of Queue ID-0, No of instance-5
                                             * Instance size-5, Priority-2
                                             */
                                            buff_req.q_id=QUEUE_ID0;
                                            buff_req.inst_size = INST_SIZE5;
                                            buff_req.inst_cnt = INST_CNT5;
                                            buff_req.pri = PRIORITY_2;
                                            buff_req.wrap = WRAP_ENB;

                                            queue_req(buff_req);
                                        }
                                        break;

                                    case DL_REQ_FAIL_INVAL_MOD_QUEUE_PRI:
                                        {
                                            dl_req.q_id=INVALID;
                                            dl_req.mod_id=INVALID;
                                            dl_req.pri=INVALID;
                                            dl_request(dl_req);
                                        }
                                        break;
                                    case DL_REQ_SUCC_INVAL_MOD_QUEUE_VAL_PRI:
                                        {
                                            dl_req.q_id=INVALID;
                                            dl_req.mod_id=INVALID;
                                            dl_req.pri=PRIORITY_2;

                                            dl_request(dl_req);
                                        }
                                        break;
                                    case DL_REQ_FAIL_VAL_MOD_INVAL_QUEUE_PRI:
                                        {
                                            dl_req.q_id=INVALID;
                                            dl_req.mod_id=TEST_TASK;
                                            dl_req.pri=INVALID;

                                            dl_request(dl_req);

                                        }
                                        break;
                                    case DL_REQ_SUCC_VAL_MOD_PRI_INVAL_QUEUE:
                                        {
                                            dl_req.q_id=INVALID;
                                            dl_req.mod_id=OBC_MAIN;
                                            dl_req.pri=PRIORITY_2;

                                            dl_request(dl_req);
                                        }
                                        break;
                                        /*This test case is not working since we give mod_id as OBC
                                         * in HM framwork response is sent to OBC instead of Test layer*/
                                        /*
                                    case DL_REQ_OBC_STRESS_TEST:
                                        {
                                            s_obc_health_info *obc_stress_health_data = os_malloc(sizeof(s_obc_health_info));
                                            obc_stress_health_data->timestamp = get_crnt_time_date_in_epoch();
                                            obc_stress_health_data->fsm_state      = 5;
                                            obc_stress_health_data->num_resets     = 5;
                                            obc_stress_health_data->io_err         = 5;
                                            obc_stress_health_data->sys_err        = 5;
                                            obc_stress_health_data->cpuUtil        = 5; 
                                            obc_stress_health_data->iram_rem_heap  = 5;
                                            obc_stress_health_data->eram_rem_heap  = 5;
                                            obc_stress_health_data->reset_cause    = 5;
                                            obc_stress_health_data->uptime         = 5;
                                            for(int cntr_1 =1;cntr_1<=STRESS_INST_CNT;cntr_1++)
                                            {
                                                enq_req.data=(uint8*)obc_stress_health_data;

                                                enq_req.mod_id=OBC_MAIN;
                                                enq_req.q_id=OBC_DATA_QUEUE_ID;
                                                enq_req.inst_size=sizeof(s_obc_health_info);

                                                enqueue_req(enq_req); 
                                            }
                                        }
                                        break;*/

                                            /* OBC STRESS TEST
                                             * Buffer request with 270 no of instance
                                             * Requires Max tm size - 10K
                                             * CSP buffer - 200
                                             * Queue depth - 200
                                             */
                                    case OBC_STRESS_TEST_SIMU:
                                        {
                                            /*Buffer request with 30 instance size and 270 no of instance
                                             * for OBC stress test simulation
                                             */
                                            buff_req.q_id= QUEUE_ID1;
                                            buff_req.inst_size = 30;
                                            buff_req.inst_cnt = STRESS_INST_CNT;
                                            buff_req.pri = PRIORITY_2;
                                            buff_req.wrap = WRAP_ENB;

                                            queue_req(buff_req);

                                        }
                                        break;

                                            /* EPS STRESS TEST
                                             * Buffer request with 270 no of instance
                                             * Requires Max tm size - 20K
                                             * CSP buffer - 200
                                             * Queue depth - 1000
                                             */
                                    case EPS_STRESS_TEST_SIMU:
                                        {
                                            buff_req.q_id= QUEUE_ID1;
                                            buff_req.inst_size = sizeof(eps_alert_flag_tmr_s);
                                            buff_req.inst_cnt = STRESS_INST_CNT;
                                            buff_req.pri = PRIORITY_2;
                                            buff_req.wrap = WRAP_ENB;

                                            queue_req(buff_req);

                                            buff_req.q_id= QUEUE_ID2;
                                            buff_req.inst_size = sizeof(eps_get_chnl_par_tmr_s);
                                            queue_req(buff_req);

                                            buff_req.q_id=QUEUE_ID3;
                                            buff_req.inst_size = sizeof(eps_get_btry_brd_tmr_s);
                                            queue_req(buff_req);

                                            buff_req.q_id= QUEUE_ID4;
                                            buff_req.inst_size = sizeof(eps_get_conv_brd_tmr_s);
                                            queue_req(buff_req);
                                        }
                                        break;

                                            /* ADCS STRESS TEST
                                             * Buffer request with 270 no of instance
                                             * No of queue 14
                                             * Requires Max tm size - 20K
                                             * CSP buffer - 200
                                             * Queue depth - 4000
                                             */

                                    case ADCS_STRESS_TEST_SIMU:
                                        {
                                            buff_req.q_id= QUEUE_ID1;
                                            buff_req.inst_size = sizeof(s_adcs_hm_sen_cur);
                                            buff_req.inst_cnt = STRESS_INST_CNT;
                                            buff_req.pri = PRIORITY_2;
                                            buff_req.wrap = WRAP_ENB;

                                            queue_req(buff_req);

                                            buff_req.q_id= QUEUE_ID2;
                                            buff_req.inst_size = sizeof(s_adcs_hm_cons_cur);
                                            queue_req(buff_req);

                                            buff_req.q_id= QUEUE_ID3;
                                            buff_req.inst_size = sizeof(s_adcs_hm_rw_cur);
                                            queue_req(buff_req);

                                            buff_req.q_id= QUEUE_ID4;
                                            buff_req.inst_size = sizeof(s_adcs_hm_css_vector);
                                            queue_req(buff_req);
                                            
                                            buff_req.q_id= QUEUE_ID5;
                                            buff_req.inst_size = sizeof(s_adcs_hm_est_att_angl);
                                            queue_req(buff_req);

                                            buff_req.q_id= QUEUE_ID6;
                                            buff_req.inst_size = sizeof(s_adcs_hm_raw_mag_measure);
                                            queue_req(buff_req);

                                            buff_req.q_id= QUEUE_ID7;
                                            buff_req.inst_size = sizeof(s_adcs_hm_raw_rates);
                                            queue_req(buff_req);

                                            buff_req.q_id= QUEUE_ID8;
                                            buff_req.inst_size = sizeof(s_adcs_hm_meas_rates);
                                            queue_req(buff_req);

                                            buff_req.q_id= QUEUE_ID9;
                                            buff_req.inst_size = sizeof(s_adcs_hm_fss_vec);
                                            queue_req(buff_req);

                                            buff_req.q_id= QUEUE_ID10;
                                            buff_req.inst_size = sizeof(s_adcs_hm_est_rates_sns);
                                            queue_req(buff_req);

                                            buff_req.q_id= QUEUE_ID11;
                                            buff_req.inst_size = sizeof(s_adcs_hm_misc_cur);
                                            queue_req(buff_req);

                                            buff_req.q_id= QUEUE_ID12;
                                            buff_req.inst_size = sizeof(s_adcs_hm_temp);
                                            queue_req(buff_req);

                                            buff_req.q_id= QUEUE_ID13;
                                            buff_req.inst_size = sizeof(s_adcs_hm_est_rate_sns_temp);
                                            queue_req(buff_req);

                                            buff_req.q_id= QUEUE_ID14;
                                            buff_req.inst_size = sizeof(s_adcs_hm_crnt_state);
                                            queue_req(buff_req);
                                        }
                                        break;

                                            /* SENSORS STRESS TEST-NOT WORKING
                                             * Buffer request with 270 no of instance
                                             * No of queue 16
                                             * Requires Max tm size - 10K
                                             * CSP buffer - 100
                                             * Queue depth - 5000
                                             */

                                    case SENSORS_STRESS_TEST_SIMU:
                                        {
                                            buff_req.q_id= QUEUE_ID1;
                                            buff_req.inst_size = sizeof(hsc_data_s);
                                            buff_req.inst_cnt = STRESS_INST_CNT;
                                            buff_req.pri = PRIORITY_2;
                                            buff_req.wrap = WRAP_ENB;

                                            queue_req(buff_req);

                                            buff_req.q_id= QUEUE_ID2;
                                            buff_req.inst_size = sizeof(hsc_data_s);
                                            queue_req(buff_req);

                                            buff_req.q_id= QUEUE_ID3;
                                            buff_req.inst_size = sizeof(hsc_data_s);
                                            queue_req(buff_req);

                                            buff_req.q_id= QUEUE_ID4;
                                            buff_req.inst_size = sizeof(dt_data_s);
                                            queue_req(buff_req);

                                            buff_req.q_id= QUEUE_ID5;
                                            buff_req.inst_size = sizeof(dt_data_s);
                                            queue_req(buff_req);

                                            buff_req.q_id= QUEUE_ID6;
                                            buff_req.inst_size = sizeof(psm_data_s);
                                            queue_req(buff_req);

                                            buff_req.q_id= QUEUE_ID7;
                                            buff_req.inst_size = sizeof(psm_data_s);
                                            queue_req(buff_req);

                                            buff_req.q_id= QUEUE_ID8;
                                            buff_req.inst_size = sizeof(temp_data_s);
                                            queue_req(buff_req);

                                            buff_req.q_id= QUEUE_ID9;
                                            buff_req.inst_size = sizeof(temp_data_s);
                                            queue_req(buff_req);

                                            buff_req.q_id= QUEUE_ID10;
                                            buff_req.inst_size = sizeof(temp_data_s);
                                            queue_req(buff_req);

                                            buff_req.q_id= QUEUE_ID11;
                                            buff_req.inst_size = sizeof(temp_data_s);
                                            queue_req(buff_req);

                                            buff_req.q_id= QUEUE_ID12;
                                            buff_req.inst_size = sizeof(temp_data_s);
                                            queue_req(buff_req);

                                            buff_req.q_id= QUEUE_ID13;
                                            buff_req.inst_size = sizeof(temp_data_s);
                                            queue_req(buff_req);

                                            buff_req.q_id= QUEUE_ID14;
                                            buff_req.inst_size = sizeof(temp_data_s);
                                            queue_req(buff_req);

                                            buff_req.q_id= QUEUE_ID15;
                                            buff_req.inst_size = sizeof(temp_data_s);
                                            queue_req(buff_req);

                                            buff_req.q_id= QUEUE_ID16;
                                            buff_req.inst_size = sizeof(temp_data_s);
                                            queue_req(buff_req);
                                        }
                                        break;
                                            /* COMMS SBAND STRESS TEST- NOT WORKING
                                             * EVEN AFTER KEEPING REQUIRED MAXIMUM VALUES
                                             * Buffer request with 270 no of instance
                                             * No of queue 1
                                             * Requires Max tm size - 153*270=42k
                                             * CSP buffer - 800
                                             * Queue depth - 500
                                             */

                                    case COMMS_SBAND_STRESS_TEST_SIMU:
                                        {
                                            buff_req.q_id= QUEUE_ID1;
                                            buff_req.inst_size = sizeof(s_sband_periodic_tm);
                                            buff_req.inst_cnt = COMMS_SBAND_INST;
                                            buff_req.pri = PRIORITY_2;
                                            buff_req.wrap = WRAP_ENB;

                                            queue_req(buff_req);

                                        }
                                        break;

                                            /* COMMS UHF STRESS TEST
                                             * Buffer request with 270 no of instance
                                             * No of queue 1
                                             * Requires Max tm size - 73*270=20k
                                             * CSP buffer - 200
                                             * Queue depth - 500
                                             */

                                    case COMMS_UHF_STRESS_TEST_SIMU:
                                        {
                                            buff_req.q_id= QUEUE_ID1;
                                            buff_req.inst_size = sizeof(s_comms_uhf_tm_prop);
                                            buff_req.inst_cnt = STRESS_INST_CNT;
                                            buff_req.pri = PRIORITY_2;
                                            buff_req.wrap = WRAP_ENB;

                                            queue_req(buff_req);

                                        }
                                        break;

                                            /* ERROR HANDLER STRESS TEST
                                             * Buffer request with 270 no of instance
                                             * No of queue 1
                                             * Requires Max tm size - 41*270=12k
                                             * CSP buffer - 200
                                             * Queue depth - 500
                                             */
                                    case ERROR_HANDLER_STRESS_TEST_SIMU:
                                        {

                                            buff_req.q_id= QUEUE_ID1;
                                            buff_req.inst_size = ERROR_HDLR_HM_SIZE;
                                            buff_req.inst_cnt = STRESS_INST_CNT;
                                            buff_req.pri = PRIORITY_2;
                                            buff_req.wrap = WRAP_ENB;

                                            queue_req(buff_req);


                                        }
                                        break;
                                    case ALL_MODULE_QUEUE_SIZE:
                                        {
/*
                                            DEBUG_CPRINT(("Size of EPS-eps_alert_flag_tmr_s : %d\n",(uint32_t)sizeof(eps_alert_flag_tmr_s)));
                                            DEBUG_CPRINT(("Size of EPS-eps_get_chnl_par_tmr_s : %d\n",(uint32_t) sizeof(eps_get_chnl_par_tmr_s)));
                                            DEBUG_CPRINT(("Size of EPS-eps_get_btry_brd_tmr_s : %d\n",(uint32_t) sizeof(eps_get_btry_brd_tmr_s)));
                                            DEBUG_CPRINT(("Size of EPS-eps_get_conv_brd_tmr_s : %d\n",(uint32_t) sizeof(eps_get_conv_brd_tmr_s)));

                                            DEBUG_CPRINT(("Size of ADCS-s_adcs_hm_sen_cur : %d\n", (uint32_t)sizeof(s_adcs_hm_sen_cur)));
                                            DEBUG_CPRINT(("Size of ADCS- s_adcs_hm_cons_cur: %d\n", (uint32_t)sizeof(s_adcs_hm_cons_cur)));
                                            DEBUG_CPRINT(("Size of ADCS-s_adcs_hm_rw_cur : %d\n", (uint32_t)sizeof(s_adcs_hm_rw_cur)));
                                            DEBUG_CPRINT(("Size of ADCS-s_adcs_hm_css_vector : %d\n", (uint32_t)sizeof(s_adcs_hm_css_vector)));
                                            DEBUG_CPRINT(("Size of ADCS- s_adcs_hm_est_att_angl: %d\n", (uint32_t)sizeof(s_adcs_hm_est_att_angl)));
                                            DEBUG_CPRINT(("Size of ADCS-s_adcs_hm_raw_mag_measure : %d\n", (uint32_t)sizeof(s_adcs_hm_raw_mag_measure)));
                                            DEBUG_CPRINT(("Size of ADCS-s_adcs_hm_raw_rates : %d\n", (uint32_t)sizeof(s_adcs_hm_raw_rates)));
                                            DEBUG_CPRINT(("Size of ADCS- s_adcs_hm_meas_rates: %d\n", (uint32_t)sizeof(s_adcs_hm_meas_rates)));
                                            DEBUG_CPRINT(("Size of ADCS- s_adcs_hm_fss_vec: %d\n", (uint32_t)sizeof(s_adcs_hm_fss_vec)));
                                            DEBUG_CPRINT(("Size of ADCS- s_adcs_hm_est_rates_sns: %d\n", (uint32_t)sizeof(s_adcs_hm_est_rates_sns)));
                                            DEBUG_CPRINT(("Size of ADCS-s_adcs_hm_temp : %d\n", (uint32_t)sizeof(s_adcs_hm_temp)));
                                            DEBUG_CPRINT(("Size of ADCS-s_adcs_hm_est_rate_sns_temp : %d\n", (uint32_t)sizeof(s_adcs_hm_est_rate_sns_temp)));
                                            DEBUG_CPRINT(("Size of ADCS-s_adcs_hm_crnt_state : %d\n", (uint32_t)sizeof(s_adcs_hm_crnt_state)));
                                            DEBUG_CPRINT(("Size of ADCS-s_adcs_hm_misc_cur : %d\n", (uint32_t)sizeof(s_adcs_hm_misc_cur)));

                                            DEBUG_CPRINT(("Size of SENOSRS-hsc_data_s : %d\n", (uint32_t)sizeof(hsc_data_s)));
                                            DEBUG_CPRINT(("Size of SENSORS-dt_data_s : %d\n", (uint32_t)sizeof(dt_data_s)));
                                            DEBUG_CPRINT(("Size of SENSORS-psm_data_s : %d\n", (uint32_t)sizeof(psm_data_s)));
                                            DEBUG_CPRINT(("Size of SENSORS-temp_data_s : %d\n", (uint32_t)sizeof(temp_data_s)));
                                            

                                            DEBUG_CPRINT(( "Size of SBAND s_sband_periodic_tm: %d\n", (uint32_t)sizeof(s_sband_periodic_tm)));
                                            DEBUG_CPRINT(("Size of UHF-s_comms_uhf_tm_prop : %d\n", (uint32_t)sizeof(s_comms_uhf_tm_prop)));
*/
                                        }
                                        break;

                                    case MAX_TM_DOWNLOAD_CHECK_62K:
                                        {
                                            buff_req.q_id= QUEUE_ID1;
                                            buff_req.inst_size = sizeof(s_sband_periodic_tm);
                                            buff_req.inst_cnt = MAX_TM_INST;
                                            buff_req.pri = PRIORITY_2;
                                            buff_req.wrap = WRAP_ENB;

                                            queue_req(buff_req);

                                        }
                                        break;
                                    case TCTM_SEGMENTED_PKT_TEST:
                                        {
                                            uint8 *dst = NULL;
                                            s_tc_frame *tc_orig = NULL;
                                            os_itc_msg_handle_t tc_seg_msg;
                                            tc_orig = (s_tc_frame *) os_malloc(sizeof(s_tc_frame));
                                            dst = (unsigned char *) os_malloc(1024);
                                            tc_orig->tc_data = os_malloc(50);
                                            memset(tc_orig->tc_data, 0,50);

                                            /* Initialize telecommand structure instance */
                                            tc_orig_init(tc_orig);
                                            /* Configure Start of Frame */
                                            tc_orig_cfg_sof(tc_orig, TC_TM_LIB_SOF1, TC_TM_LIB_SOF2);
                                            /* Enable encryption */
                                            tc_orig_cfg_tc_ctrl(tc_orig, 0x30);
                                            /* Configure source address */
                                            tc_orig_cfg_sa_id(tc_orig, TC_SRC_GS);
                                            /* Configure Radio Module ID */
                                            tc_orig_cfg_rm_id(tc_orig,4);
                                            /* Configure Telecommand ID */
                                            tc_orig_cfg_tc_id(tc_orig, 500);
                                            /* Configure Telecommand Length */
                                            tc_orig_cfg_tc_len(tc_orig, 50);

                                            tc_pack(dst, tc_orig);
                                            tc_seg_msg.src_entity = TEST_TASK;
                                            tc_seg_msg.Msg_len = 5;
                                            tc_seg_msg.pld.pld_ptr = dst;
                                            os_itc_msg_send(&tc_seg_msg,
                                                    TC_TM_MANAGER_IPC_RECEIVE,
                                                    os_send_itc_wait);
                                            if(dst != NULL)
                                            {
                                                os_free(dst);
                                                dst = NULL;
                                            }
                                            if(tc_orig != NULL)
                                            {
                                                os_free(tc_orig);
                                                tc_orig = NULL;
                                            }
                                        }
                                        break;

                                    default:
                                        {
                                            DEBUG_CPRINT(("\nInvalid Test case ID %d\n", test_case_id));
                                        }
                                        break;
                                }
                            }
                            break;
                        default:
                            {
                                DEBUG_CPRINT(("\nInvalid test case in Test layer %d\n",test_layer_rcv_ipc_msg.Msg_id));
                            }
                            break;
                    }
                }
                break;
                /**  - Source is TC_TM_MANAGER_IPC_SEND */
            case HM_MANAGER_IPC_RECEIVE:
                {
                    switch(test_layer_rcv_ipc_msg.Msg_id)
                    {
                        case OBC_TC_TM_BUFFER_RSP:
                            {
                                switch(hm_control_var.current_test_case_id)
                                {
                                    case BUFF_REQ_SINGLE_QUEUE:
                                        {
                                            /*Test Case : Single queue create 
                                             * Delete the queue once queue is created successfully*/
                                            if(test_layer_rcv_ipc_msg.pld.pld_data == TC_TM_BUFFER_SUCC)
                                            {
                                                del_req.q_id=hm_control_var.queue_id;
                                                del_req.app_id=TEST_TASK;
                                                delete_req(del_req);
                                            }
                                        }
                                        break;
                                    case BUFF_REQ_MULTIPLE_QUEUE:
                                        {
                                            /*Test case: multiple queue create
                                             * cntr_1 increments for every successful queue create*/
                                            if(test_layer_rcv_ipc_msg.pld.pld_data == TC_TM_BUFFER_SUCC)
                                            {
                                                hm_control_var.succ_cntr++;
                                                if( hm_control_var.succ_cntr == hm_control_var.queue_cnt)
                                                {
                                                    for(int cntr=1; cntr <= hm_control_var.queue_cnt ; cntr++)
                                                    {
                                                        del_req.q_id=cntr;
                                                        del_req.app_id=TEST_TASK;
                                                        delete_req(del_req);
                                                    }
                                                    hm_control_var.succ_cntr=0;
                                                }
                                            }
                                        }
                                        break;

                                    case ENQUEUE_REQ_SINGLE_QUEUE:
                                        {
                                            /*Test Case : Single enqueue create 
                                             * Enqueu data once queue is created successfully*/
                                            if(test_layer_rcv_ipc_msg.pld.pld_data == TC_TM_BUFFER_SUCC)
                                            {
                                                /*Enqueue request for 5instance - Buffer requested for 3instance*/
                                                for(int cntr_2 =1; cntr_2<=hm_control_var.inst_cnt; cntr_2++)
                                                {
                                                    enq_req.data=NULL;
                                                    enq_req.mod_id=TEST_TASK;
                                                    enq_req.q_id=hm_control_var.queue_id;
                                                    enq_req.inst_size=hm_control_var.inst_size;

                                                    enqueue_req(enq_req);
                                                }
                                            }
                                        }
                                        break;

                                    case ENQUEUE_REQ_MULTIPLE_QUEUE:
                                        {
                                            if(test_layer_rcv_ipc_msg.pld.pld_data == TC_TM_BUFFER_SUCC)
                                            {
                                                hm_control_var.succ_cntr++;
                                                if(hm_control_var.succ_cntr == hm_control_var.queue_cnt)
                                                {

                                                    for(int cntr_2=1; cntr_2 <= hm_control_var.queue_cnt ; cntr_2++)
                                                    {
                                                        for(int cntr_3=1; cntr_3 <= hm_control_var.inst_cnt ; cntr_3++)
                                                        {
                                                            enq_req.data=NULL;
                                                            enq_req.mod_id=TEST_TASK;
                                                            enq_req.q_id=cntr_2;
                                                            enq_req.inst_size=hm_control_var.inst_size;

                                                            enqueue_req(enq_req);
                                                        }
                                                    }
                                                    hm_control_var.succ_cntr=0;
                                                }
                                            }
                                        }

                                        break;
                                    case BUFF_REQ_WITHOUT_PLD:
                                        {
                                            if(test_layer_rcv_ipc_msg.pld.pld_data ==TC_TM_BUFFER_FAIL)
                                            {
                                            send_itc_test_case_resp(BUFF_REQ_WITHOUT_PLD,TEST_TASK,OBC_HM_TEST_CASE_RSP,TEST_CASE_SUCC,OBC_MAIN);
                                            }
                                            else
                                            {
                                                send_itc_test_case_resp(BUFF_REQ_WITHOUT_PLD,TEST_TASK,OBC_HM_TEST_CASE_RSP,TEST_CASE_FAIL,OBC_MAIN);
                                            }

                                        }
                                        break;
                                    case BUFF_REQ_INVALID_QUEUE:
                                        {
                                            if(test_layer_rcv_ipc_msg.pld.pld_data ==TC_TM_BUFFER_QUEUE_NOT_VALID)
                                            {
                                            send_itc_test_case_resp(BUFF_REQ_INVALID_QUEUE,TEST_TASK,OBC_HM_TEST_CASE_RSP,TEST_CASE_SUCC,OBC_MAIN);
                                            }
                                            else
                                            {
                                                send_itc_test_case_resp(BUFF_REQ_INVALID_QUEUE,TEST_TASK,OBC_HM_TEST_CASE_RSP,TEST_CASE_FAIL,OBC_MAIN);
                                            }
                                        }
                                        break;
                                    case ENQUEUE_REQ_WRAP_DSB_DATA_DROP:
                                        {
                                            /*If queue create response is success*/
                                            if(test_layer_rcv_ipc_msg.pld.pld_data == TC_TM_BUFFER_SUCC)
                                            {
                                                /*Enqueue request for 5instance - Buffer requested for 3instance*/
                                                for(int cntr_2 =1; cntr_2<=5; cntr_2++)
                                                {
                                                    enq_req.data=NULL;
                                                    enq_req.mod_id=TEST_TASK;
                                                    enq_req.q_id=QUEUE_ID0;
                                                    enq_req.inst_size=INST_SIZE5;

                                                    enqueue_req(enq_req);
                                                    DEBUG_CPRINT((" WRAP DISABLE TEST : ENQUEUE REQUEST %d sent\n" , cntr_2));
                                                }
                                            }
                                        }
                                        break;
                                    case ENQUEUE_REQ_QUEUE_FULL:
                                        {
                                            /*If queue create response is success*/
                                            if(test_layer_rcv_ipc_msg.pld.pld_data == TC_TM_BUFFER_SUCC)
                                            {
                                                /*Enqueue request for 5instance - Buffer requested for 3instance*/
                                                for(int cntr_2 =1; cntr_2<=5; cntr_2++)
                                                {
                                                    enq_req.data=NULL;
                                                    enq_req.mod_id=TEST_TASK;
                                                    enq_req.q_id=QUEUE_ID0;
                                                    enq_req.inst_size=INST_SIZE5;

                                                    enqueue_req(enq_req);
                                                    DEBUG_CPRINT((" WRAP DISABLE TEST : ENQUEUE REQUEST %d sent\n" , cntr_2));
                                                }
                                            }
                                        }
                                        break;
                                    case BUFF_REQ_QUEUE_CREATE_FAIL:
                                        {
                                            if(test_layer_rcv_ipc_msg.pld.pld_data ==TC_TM_BUFFER_QUEUE_ERROR)
                                            {
                                            send_itc_test_case_resp(BUFF_REQ_QUEUE_CREATE_FAIL,TEST_TASK,OBC_HM_TEST_CASE_RSP,TEST_CASE_SUCC,OBC_MAIN);
                                            }
                                            else
                                            {
                                            send_itc_test_case_resp(BUFF_REQ_QUEUE_CREATE_FAIL,TEST_TASK,OBC_HM_TEST_CASE_RSP,TEST_CASE_FAIL,OBC_MAIN);
                                            }
                                        }
                                        break;
                                    case FLUSH_SUCC_VAL_MOD_QUEUE_PRI:
                                        {
                                            /*If queue create response is success*/
                                            if(test_layer_rcv_ipc_msg.pld.pld_data == TC_TM_BUFFER_SUCC)
                                            {
                                                /*Enqueue request for 5instance - Buffer requested for 3instance*/
                                                for(int cntr_2 =1; cntr_2<=5; cntr_2++)
                                                {
                                                    enq_req.data=NULL;
                                                    enq_req.mod_id=TEST_TASK;
                                                    enq_req.q_id=QUEUE_ID0;
                                                    enq_req.inst_size=INST_SIZE5;

                                                    enqueue_req(enq_req);
                                                }
                                            }

                                        }
                                        break;
                                    case FLUSH_FAIL_VAL_MOD_INVAL_QUEUE_PRI:
                                        {
                                            /*If queue create response is success*/
                                            if(test_layer_rcv_ipc_msg.pld.pld_data == TC_TM_BUFFER_SUCC)
                                            {
                                                hm_control_var.succ_cntr++;
                                                if(hm_control_var.succ_cntr == SUCC_CNT_2)
                                                {
                                                    /*Enqueue request for 5instance - Buffer requested for 3instance*/
                                                    for(int cntr_2 =1; cntr_2<=5; cntr_2++)
                                                    {
                                                        enq_req.data=NULL;
                                                        enq_req.mod_id=TEST_TASK;
                                                        enq_req.q_id=QUEUE_ID0;
                                                        enq_req.inst_size=INST_SIZE5;

                                                        enqueue_req(enq_req);

                                                        enq_req.q_id=QUEUE_ID1;
                                                        enqueue_req(enq_req);
                                                    }
                                                    hm_control_var.succ_cntr=0;
                                                }
                                            }

                                        }
                                        break;
                                    case FLUSH_SUCC_VAL_MOD_PRI_INVAL_QUEUE:
                                        {
                                            /*If queue create response is success*/
                                            if(test_layer_rcv_ipc_msg.pld.pld_data == TC_TM_BUFFER_SUCC)
                                            {
                                                hm_control_var.succ_cntr++;
                                                if(hm_control_var.succ_cntr == SUCC_CNT_2)
                                                {
                                                    /*Enqueue request for 5instance - Buffer requested for 3instance*/
                                                    for(int cntr_2 =1; cntr_2<=5; cntr_2++)
                                                    {
                                                        enq_req.data=NULL;
                                                        enq_req.mod_id=TEST_TASK;
                                                        enq_req.q_id=QUEUE_ID0;
                                                        enq_req.inst_size=INST_SIZE5;

                                                        enqueue_req(enq_req);

                                                        enq_req.q_id=QUEUE_ID1;
                                                        enqueue_req(enq_req);
                                                        hm_control_var.succ_cntr=0;
                                                    }
                                                }
                                            }

                                        }
                                        break;
                                    case FLUSH_FAIL_VAL_MOD_QUEUE_NOT_ACTIVE:
                                        {
                                            /*If queue create response is success*/
                                            if(test_layer_rcv_ipc_msg.pld.pld_data == TC_TM_BUFFER_SUCC)
                                            {
                                                /*Enqueue request for 5instance - Buffer requested for 3instance*/
                                                for(int cntr_2 =1; cntr_2<=5; cntr_2++)
                                                {
                                                    enq_req.data=NULL;
                                                    enq_req.mod_id=TEST_TASK;
                                                    enq_req.q_id=QUEUE_ID0;
                                                    enq_req.inst_size=INST_SIZE5;

                                                    enqueue_req(enq_req);
                                                }
                                            }

                                        }
                                        break;
                                    case CHNGE_QPRI_FAIL_VAL_MOD_INVAL_QUEUE_PRI:
                                        {
                                            /*If queue create response is success*/
                                            if(test_layer_rcv_ipc_msg.pld.pld_data == TC_TM_BUFFER_SUCC)
                                            {
                                                hm_control_var.succ_cntr++;
                                                if(hm_control_var.succ_cntr == SUCC_CNT_2)
                                                {
                                                    /*Enqueue request for 5instance - Buffer requested for 3instance*/
                                                    for(int cntr_2 =1; cntr_2<=5; cntr_2++)
                                                    {
                                                        enq_req.data=NULL;
                                                        enq_req.mod_id=TEST_TASK;
                                                        enq_req.q_id=QUEUE_ID0;
                                                        enq_req.inst_size=INST_SIZE5;

                                                        enqueue_req(enq_req);

                                                        enq_req.q_id=QUEUE_ID1;
                                                        enqueue_req(enq_req);
                                                        hm_control_var.succ_cntr=0;
                                                    }
                                                }
                                            }

                                        }
                                        break;

                                    case CHNGE_QPRI_SUCC_VAL_MOD_INVALID_QUE:
                                        {
                                            /*If queue create response is success*/
                                            if(test_layer_rcv_ipc_msg.pld.pld_data == TC_TM_BUFFER_SUCC)
                                            {
                                                hm_control_var.succ_cntr++;
                                                if(hm_control_var.succ_cntr == SUCC_CNT_2)
                                                {
                                                    /*Enqueue request for 5instance - Buffer requested for 3instance*/
                                                    for(int cntr_2 =1; cntr_2<=5; cntr_2++)
                                                    {
                                                        enq_req.data=NULL;
                                                        enq_req.mod_id=TEST_TASK;
                                                        enq_req.q_id=QUEUE_ID0;
                                                        enq_req.inst_size=INST_SIZE5;

                                                        enqueue_req(enq_req);

                                                        enq_req.q_id=QUEUE_ID1;
                                                        enqueue_req(enq_req);
                                                        hm_control_var.succ_cntr=0;
                                                    }
                                                }
                                            }

                                        }
                                        break;
                                    case CHNGE_QPRI_FAIL_VAL_MOD_QUEUE_INACTIVE:
                                        {
                                            /*If queue create response is success*/
                                            if(test_layer_rcv_ipc_msg.pld.pld_data == TC_TM_BUFFER_SUCC)
                                            {
                                                /*Enqueue request for 5instance */
                                                for(int cntr_2 =1; cntr_2<=5; cntr_2++)
                                                {
                                                    enq_req.data=NULL;
                                                    enq_req.mod_id=TEST_TASK;
                                                    enq_req.q_id=QUEUE_ID0;
                                                    enq_req.inst_size=INST_SIZE5;

                                                    enqueue_req(enq_req);
                                                }
                                            }

                                        }
                                        break;
                                    case CHNGE_QPRI_SUCC_VAL_MOD_QUEUE_ACTIVE:
                                        {
                                            /*If queue create response is success*/
                                            if(test_layer_rcv_ipc_msg.pld.pld_data == TC_TM_BUFFER_SUCC)
                                            {
                                                /*Enqueue request for 5instance*/
                                                for(int cntr_2 =1; cntr_2<=5; cntr_2++)
                                                {
                                                    enq_req.data=NULL;
                                                    enq_req.mod_id=TEST_TASK;
                                                    enq_req.q_id=QUEUE_ID0;
                                                    enq_req.inst_size=INST_SIZE5;

                                                    enqueue_req(enq_req);
                                                }
                                            }

                                        }
                                        break;
                                    case DEL_QUEUE_SUCC_ACTIVE_QUEUE:
                                        {
                                            /*If queue create response is success*/
                                            if(test_layer_rcv_ipc_msg.pld.pld_data == TC_TM_BUFFER_SUCC)
                                            {
                                                /*Enqueue request for 5instance*/
                                                for(int cntr_2 =1; cntr_2<=5; cntr_2++)
                                                {
                                                    enq_req.data=NULL;
                                                    enq_req.mod_id=TEST_TASK;
                                                    enq_req.q_id=QUEUE_ID0;
                                                    enq_req.inst_size=INST_SIZE5;

                                                    enqueue_req(enq_req);
                                                }
                                            }

                                        }
                                        break;
                                    case DL_REQ_FAIL_VAL_MOD_QUEUE_INACTIVE:
                                        {
                                            /*If queue create response is success*/
                                            if(test_layer_rcv_ipc_msg.pld.pld_data == TC_TM_BUFFER_SUCC)
                                            {
                                                /*Enqueue request for 5instance*/
                                                for(int cntr_2 =1; cntr_2<=5; cntr_2++)
                                                {
                                                    enq_req.data=NULL;
                                                    enq_req.mod_id=TEST_TASK;
                                                    enq_req.q_id=QUEUE_ID0;
                                                    enq_req.inst_size=INST_SIZE5;

                                                    enqueue_req(enq_req);
                                                }
                                            }

                                        }
                                        break;
                                    case DL_REQ_SUCC_VAL_MOD_QUEUE_ACTIVE:
                                        {
                                            /*If queue create response is success*/
                                            if(test_layer_rcv_ipc_msg.pld.pld_data == TC_TM_BUFFER_SUCC)
                                            {
                                                /*Enqueue request for 5instance*/
                                                for(int cntr_2 =1; cntr_2<=5; cntr_2++)
                                                {
                                                    enq_req.data=NULL;
                                                    enq_req.mod_id=TEST_TASK;
                                                    enq_req.q_id=QUEUE_ID0;
                                                    enq_req.inst_size=INST_SIZE5;

                                                    enqueue_req(enq_req);
                                                }
                                            }

                                        }
                                        break;
                                    case OBC_STRESS_TEST_SIMU:
                                        {
                                            if(test_layer_rcv_ipc_msg.pld.pld_data == TC_TM_BUFFER_SUCC)
                                            {
                                                s_obc_health_info *obc_stress_health_data = os_malloc(sizeof(s_obc_health_info));
                                                if(obc_stress_health_data)
                                                {
                                                    os_memset(obc_stress_health_data, TEST_DATA, sizeof(s_obc_health_info));
                                                }
                                                else
                                                {
                                                    //malloc error
                                                }
                                                for(int cntr_1 =1;cntr_1<=STRESS_INST_CNT;cntr_1++)
                                                {
                                                    enq_req.data=(uint8*)obc_stress_health_data;

                                                    enq_req.mod_id=TEST_TASK;
                                                    enq_req.q_id=QUEUE_ID1;
                                                    enq_req.inst_size=sizeof(s_obc_health_info);

                                                    enqueue_req(enq_req);
                                                }
                                                if(obc_stress_health_data)
                                                {
                                                    os_free(obc_stress_health_data);
                                                }
                                            }
                                        }
                                        break;

                                    case ADCS_STRESS_TEST_SIMU:
                                        {
                                            if(test_layer_rcv_ipc_msg.pld.pld_data == TC_TM_BUFFER_SUCC)
                                            {
                                               hm_control_var.succ_cntr++;
                                               if(hm_control_var.succ_cntr == SUCC_CNT_14)
                                               {

                                                   s_adcs_hm_sen_cur  *stress_test_adcs_q1 = os_malloc(sizeof(s_adcs_hm_sen_cur));
                                                   stress_test(QUEUE_ID1,(uint8_t*)stress_test_adcs_q1,sizeof(s_adcs_hm_sen_cur),STRESS_INST_CNT);
                                                   hm_control_var.succ_cntr = 0;
                                               
                                               }
                                            }
                                        }
                                        break;
                                    case SENSORS_STRESS_TEST_SIMU:
                                        {
                                            if(test_layer_rcv_ipc_msg.pld.pld_data == TC_TM_BUFFER_SUCC)
                                            {
                                               hm_control_var.succ_cntr++;
                                               if(hm_control_var.succ_cntr == SUCC_CNT_16)
                                               {

                                                   hsc_data_s *stress_test_sensors_q1 = os_malloc(sizeof(hsc_data_s));
                                                   stress_test(QUEUE_ID1,(uint8_t*)stress_test_sensors_q1,sizeof(hsc_data_s),STRESS_INST_CNT);

                                                   hm_control_var.succ_cntr = 0;

                                               }
                                            }
                                        }
                                        break;

                                     case EPS_STRESS_TEST_SIMU:
                                        {
                                            if(test_layer_rcv_ipc_msg.pld.pld_data == TC_TM_BUFFER_SUCC)
                                            {
                                               hm_control_var.succ_cntr++;
                                               if(hm_control_var.succ_cntr == SUCC_CNT_4)
                                               {
                                                   eps_alert_flag_tmr_s  *stress_test_eps_alert_flag = os_malloc(sizeof(eps_alert_flag_tmr_s));
                                                   stress_test(QUEUE_ID1,(uint8_t*)stress_test_eps_alert_flag,sizeof(eps_alert_flag_tmr_s),STRESS_INST_CNT);
                                                   hm_control_var.succ_cntr = 0;

                                               }
                                            }
                                        }
                                        break;

                                      case COMMS_UHF_STRESS_TEST_SIMU:
                                        {
                                            if(test_layer_rcv_ipc_msg.pld.pld_data == TC_TM_BUFFER_SUCC)
                                            {

                                                      s_comms_uhf_tm_prop *stress_test_comms_uhf = os_malloc(sizeof(s_comms_uhf_tm_prop));

                                                   stress_test(QUEUE_ID1,(uint8_t*)stress_test_comms_uhf,sizeof(s_comms_uhf_tm_prop),STRESS_INST_CNT);
                                            }

                                        }
                                        break;

                                        
                                      case COMMS_SBAND_STRESS_TEST_SIMU:
                                        {
                                            if(test_layer_rcv_ipc_msg.pld.pld_data == TC_TM_BUFFER_SUCC)
                                            {

                                                    s_sband_periodic_tm *stress_test_comms_sband = os_malloc(sizeof(s_sband_periodic_tm));

                                                   stress_test(QUEUE_ID1,(uint8_t*)stress_test_comms_sband,sizeof(s_sband_periodic_tm),COMMS_SBAND_INST);
                                            }

                                        }
                                        break;
                                      case MAX_TM_DOWNLOAD_CHECK_62K:
                                        {
                                            if(test_layer_rcv_ipc_msg.pld.pld_data == TC_TM_BUFFER_SUCC)
                                            {

                                                    s_sband_periodic_tm *stress_test_comms_sband = os_malloc(sizeof(s_sband_periodic_tm));

                                                   stress_test(QUEUE_ID1,(uint8_t*)stress_test_comms_sband,sizeof(s_sband_periodic_tm),MAX_TM_INST);
                                            }

                                        }
                                        break;

                                    case ERROR_HANDLER_STRESS_TEST_SIMU:
                                        {
                                            //Error handler health info data size=41

                                            uint8_t* err_hdlr_enqueue_health_data = os_malloc(ERROR_HDLR_HM_SIZE);

                                            if(err_hdlr_enqueue_health_data)
                                            {
                                                os_memset(err_hdlr_enqueue_health_data, TEST_DATA, ERROR_HDLR_HM_SIZE);
                                            }
                                            else
                                            {
                                                //malloc error
                                            }
                                            for(int cntr_1 =1;cntr_1<=STRESS_INST_CNT;cntr_1++)
                                            {
                                                enq_req.data=err_hdlr_enqueue_health_data;

                                                enq_req.mod_id=TEST_TASK;
                                                enq_req.q_id=QUEUE_ID1;
                                                enq_req.inst_size=ERROR_HDLR_HM_SIZE;

                                                enqueue_req(enq_req);
                                            }
                                        }
                                        break;

                                }
                            }
                            break;
                        case OBC_TC_TM_ENQUEUE_RSP:
                            {
                                switch(hm_control_var.current_test_case_id)
                                {
                                    case ENQUEUE_REQ_SINGLE_QUEUE:
                                        {
                                            if(test_layer_rcv_ipc_msg.pld.pld_data == TC_TM_BUFFER_SUCC)
                                            {
                                                hm_control_var.succ_cntr++;
                                                if(hm_control_var.succ_cntr == hm_control_var.inst_cnt)
                                                {
                                                    /*Delete queue Id 0*/
                                                    del_req.q_id=hm_control_var.queue_id;
                                                    del_req.app_id=TEST_TASK;

                                                    delete_req(del_req);
                                                    hm_control_var.succ_cntr=0;
                                                }
                                            }
                                        }
                                        break;
                                    case ENQUEUE_REQ_MULTIPLE_QUEUE:
                                        {
                                            if(test_layer_rcv_ipc_msg.pld.pld_data == TC_TM_BUFFER_SUCC)
                                            {
                                                hm_control_var.succ_cntr++;
                                                if(hm_control_var.succ_cntr == (hm_control_var.queue_cnt) * (hm_control_var.inst_cnt))
                                                {
                                                    for(int cntr=1; cntr <= hm_control_var.queue_cnt ; cntr++)
                                                    {
                                                        del_req.q_id=cntr;
                                                        del_req.app_id=TEST_TASK;

                                                        delete_req(del_req);
                                                    }
                                                    hm_control_var.succ_cntr=0;
                                                }
                                            }

                                        }
                                        break;
                                    case ENQUEUE_REQ_WITHOUT_PLD:
                                        {
                                            if(test_layer_rcv_ipc_msg.pld.pld_data == TC_TM_BUFFER_FAIL)
                                            {
                                            send_itc_test_case_resp(ENQUEUE_REQ_WITHOUT_PLD,TEST_TASK,OBC_HM_TEST_CASE_RSP,TEST_CASE_SUCC,OBC_MAIN);
                                            }
                                            else
                                            {
                                                send_itc_test_case_resp(ENQUEUE_REQ_WITHOUT_PLD,TEST_TASK,OBC_HM_TEST_CASE_RSP,TEST_CASE_FAIL,OBC_MAIN);
                                            }
                                        }
                                        break;
                                    case ENQUEUE_REQ_INVALID_QUEUE:
                                        {
                                            if(test_layer_rcv_ipc_msg.pld.pld_data == TC_TM_BUFFER_QUEUE_NOT_VALID)
                                            {
                                            send_itc_test_case_resp(ENQUEUE_REQ_INVALID_QUEUE,TEST_TASK,OBC_HM_TEST_CASE_RSP,TEST_CASE_SUCC,OBC_MAIN);
                                            }
                                            else
                                            {
                                            send_itc_test_case_resp(ENQUEUE_REQ_INVALID_QUEUE,TEST_TASK,OBC_HM_TEST_CASE_RSP,TEST_CASE_FAIL,OBC_MAIN);
                                            }
                                        }
                                        break;
                                    case ENQUEUE_REQ_INACTIVE_QUEUE:
                                        {
                                            if(test_layer_rcv_ipc_msg.pld.pld_data ==TC_TM_BUFFER_QUEUE_NOT_ACTIVE)
                                            {
                                            send_itc_test_case_resp(ENQUEUE_REQ_INACTIVE_QUEUE,TEST_TASK,OBC_HM_TEST_CASE_RSP,TEST_CASE_SUCC,OBC_MAIN);
                                            }
                                            else
                                            {
                                            send_itc_test_case_resp(ENQUEUE_REQ_INACTIVE_QUEUE,TEST_TASK,OBC_HM_TEST_CASE_RSP,TEST_CASE_FAIL,OBC_MAIN);
                                            }
                                        }
                                        break;
                                    case ENQUEUE_REQ_WRAP_DSB_DATA_DROP:
                                        {
                                            if(test_layer_rcv_ipc_msg.pld.pld_data == TC_TM_BUFFER_SUCC)
                                            {
                                                hm_control_var.wrap_dsb_enq_succ++;
                                                hm_control_var.succ_cntr++;
                                            }
                                            else if(test_layer_rcv_ipc_msg.pld.pld_data == TC_TM_BUFFER_DATA_DROPPED)
                                            {
                                                hm_control_var.wrap_dsb_data_drop++;
                                                hm_control_var.succ_cntr++;
                                            }
                                            if(hm_control_var.succ_cntr==SUCC_CNT_5)
                                            {
                                                /*Delete queue Id 0*/
                                                del_req.q_id=QUEUE_ID0;
                                                del_req.app_id=TEST_TASK;

                                                delete_req(del_req);
                                                hm_control_var.succ_cntr=0;
                                            }
                                        }
                                        break;
                                    case ENQUEUE_REQ_QUEUE_FULL:
                                        {
                                            hm_control_var.succ_cntr++;
                                            if(hm_control_var.succ_cntr == SUCC_CNT_5)
                                            {
                                                /*Delete queue Id 0*/
                                                del_req.q_id=QUEUE_ID0;
                                                del_req.app_id=TEST_TASK;

                                                delete_req(del_req);
                                                hm_control_var.succ_cntr=0;
                                            }
                                        }
                                        break;
                                    case FLUSH_SUCC_VAL_MOD_QUEUE_PRI:
                                        {
                                            /*If enqueue response is success*/
                                            if(test_layer_rcv_ipc_msg.pld.pld_data == TC_TM_BUFFER_SUCC)
                                            {
                                                hm_control_var.succ_cntr++;
                                                if(hm_control_var.succ_cntr == SUCC_CNT_5)
                                                {
                                                    /*Flush request of the created Queue*/
                                                    test_flush_req.q_id=QUEUE_ID0;
                                                    test_flush_req.mod_id=TEST_TASK;
                                                    test_flush_req.pri=PRIORITY_2;
                                                    flush_req(test_flush_req);
                                                    hm_control_var.succ_cntr=0;
                                                }
                                            }
                                        }
                                        break;
                                    case FLUSH_FAIL_VAL_MOD_INVAL_QUEUE_PRI:
                                        {
                                            /*If enqueue response is success*/
                                            if(test_layer_rcv_ipc_msg.pld.pld_data == TC_TM_BUFFER_SUCC)
                                            {
                                                hm_control_var.succ_cntr++;
                                                if(hm_control_var.succ_cntr == SUCC_CNT_10)
                                                {
                                                    /*Flush request of the created Queue*/
                                                    test_flush_req.q_id=INVALID;
                                                    test_flush_req.mod_id=TEST_TASK;
                                                    test_flush_req.pri=INVALID;

                                                    flush_req(test_flush_req);
                                                    hm_control_var.succ_cntr=0;
                                                }
                                            }
                                        }
                                        break;
                                    case FLUSH_SUCC_VAL_MOD_PRI_INVAL_QUEUE:
                                        {
                                            /*If enqueue response is success*/
                                            if(test_layer_rcv_ipc_msg.pld.pld_data == TC_TM_BUFFER_SUCC)
                                            {
                                                hm_control_var.succ_cntr++;
                                                if(hm_control_var.succ_cntr == SUCC_CNT_10)
                                                {
                                                    /*Flush request of the created Queue*/
                                                    test_flush_req.q_id=INVALID;
                                                    test_flush_req.mod_id=TEST_TASK;
                                                    test_flush_req.pri=PRIORITY_1;

                                                    flush_req(test_flush_req);
                                                    hm_control_var.succ_cntr=0;
                                                }
                                            }
                                        }
                                        break;
                                    case FLUSH_FAIL_VAL_MOD_QUEUE_NOT_ACTIVE:
                                        {
                                            /*If enqueue response is success*/
                                            if(test_layer_rcv_ipc_msg.pld.pld_data == TC_TM_BUFFER_SUCC)
                                            {
                                                hm_control_var.succ_cntr++;
                                                if(hm_control_var.succ_cntr == SUCC_CNT_5)
                                                {
                                                    /*Flush request of the created Queue*/
                                                    test_flush_req.q_id=QUEUE_ID1;
                                                    test_flush_req.mod_id=TEST_TASK;
                                                    test_flush_req.pri=PRIORITY_2;

                                                    flush_req(test_flush_req);
                                                    hm_control_var.succ_cntr=0;
                                                }
                                            }
                                        }
                                        break;

                                    case CHNGE_QPRI_FAIL_VAL_MOD_INVAL_QUEUE_PRI:
                                        {
                                            /*If enqueue response is success*/
                                            if(test_layer_rcv_ipc_msg.pld.pld_data == TC_TM_BUFFER_SUCC)
                                            {
                                                hm_control_var.succ_cntr++;
                                                if(hm_control_var.succ_cntr == SUCC_CNT_10)
                                                {
                                                    /*Change priority of the queue*/
                                                    chnge_queue_pri_req.q_id=INVALID;
                                                    chnge_queue_pri_req.mod_id=TEST_TASK;
                                                    chnge_queue_pri_req.pri=INVALID;
                                                    chnge_queue_pri_req.cur_pri=PRIORITY_2;

                                                    change_queue_pri_req(chnge_queue_pri_req);
                                                    hm_control_var.succ_cntr=0;
                                                }
                                            }
                                        }
                                        break;

                                    case CHNGE_QPRI_SUCC_VAL_MOD_INVALID_QUE:
                                        {
                                            /*If enqueue response is success*/
                                            if(test_layer_rcv_ipc_msg.pld.pld_data == TC_TM_BUFFER_SUCC)
                                            {
                                                hm_control_var.succ_cntr++;
                                                if(hm_control_var.succ_cntr == SUCC_CNT_10)
                                                {
                                                    /*Change priority of the queue*/
                                                    chnge_queue_pri_req.q_id=INVALID;
                                                    chnge_queue_pri_req.mod_id=TEST_TASK;
                                                    chnge_queue_pri_req.pri=PRIORITY_1;
                                                    chnge_queue_pri_req.cur_pri=PRIORITY_2;

                                                    change_queue_pri_req(chnge_queue_pri_req);
                                                    hm_control_var.succ_cntr=0;
                                                }
                                            }
                                        }
                                        break;
                                    case CHNGE_QPRI_FAIL_VAL_MOD_QUEUE_INACTIVE:
                                        {
                                            /*If enqueue response is success*/
                                            if(test_layer_rcv_ipc_msg.pld.pld_data == TC_TM_BUFFER_SUCC)
                                            {
                                                hm_control_var.succ_cntr++;
                                                if(hm_control_var.succ_cntr == SUCC_CNT_5)
                                                {
                                                    /*Change priority of the queue*/
                                                    chnge_queue_pri_req.q_id=QUEUE_ID1;
                                                    chnge_queue_pri_req.mod_id=TEST_TASK;
                                                    chnge_queue_pri_req.pri=PRIORITY_1;
                                                    chnge_queue_pri_req.cur_pri=PRIORITY_2;

                                                    change_queue_pri_req(chnge_queue_pri_req);
                                                    hm_control_var.succ_cntr=0;
                                                }
                                            }
                                        }
                                        break;
                                    case CHNGE_QPRI_SUCC_VAL_MOD_QUEUE_ACTIVE:
                                        {
                                            /*If enqueue response is success*/
                                            if(test_layer_rcv_ipc_msg.pld.pld_data == TC_TM_BUFFER_SUCC)
                                            {
                                                hm_control_var.succ_cntr++;
                                                if(hm_control_var.succ_cntr == SUCC_CNT_5)
                                                {
                                                    /*Change priority of the queue*/
                                                    chnge_queue_pri_req.q_id=QUEUE_ID0;
                                                    chnge_queue_pri_req.mod_id=TEST_TASK;
                                                    chnge_queue_pri_req.pri=PRIORITY_1;
                                                    chnge_queue_pri_req.cur_pri=PRIORITY_2;

                                                    change_queue_pri_req(chnge_queue_pri_req);
                                                    hm_control_var.succ_cntr=0;
                                                }
                                            }
                                        }
                                        break;
                                    case DEL_QUEUE_SUCC_ACTIVE_QUEUE:
                                        {
                                            /*If enqueue response is success*/
                                            if(test_layer_rcv_ipc_msg.pld.pld_data == TC_TM_BUFFER_SUCC)
                                            {
                                                hm_control_var.succ_cntr++;
                                                if(hm_control_var.succ_cntr == SUCC_CNT_5)
                                                {
                                                    /*Delete queue*/
                                                    del_req.q_id=QUEUE_ID0;
                                                    del_req.app_id=TEST_TASK;

                                                    delete_req(del_req);
                                                    hm_control_var.succ_cntr=0;
                                                }
                                            }
                                        }
                                        break;
                                    case DL_REQ_FAIL_VAL_MOD_QUEUE_INACTIVE:
                                        {
                                            if(test_layer_rcv_ipc_msg.pld.pld_data == TC_TM_BUFFER_SUCC)
                                            {
                                                hm_control_var.succ_cntr++;
                                                if(hm_control_var.succ_cntr == SUCC_CNT_5)
                                                {
                                                    dl_req.q_id=QUEUE_ID1;
                                                    dl_req.mod_id=TEST_TASK;
                                                    dl_req.pri=PRIORITY_2;
                                                    dl_request(dl_req);
                                                    hm_control_var.succ_cntr=0;
                                                }
                                            }
                                        }
                                        break;
                                    case DL_REQ_SUCC_VAL_MOD_QUEUE_ACTIVE:
                                        {
                                            if(test_layer_rcv_ipc_msg.pld.pld_data == TC_TM_BUFFER_SUCC)
                                            {
                                                hm_control_var.succ_cntr++;
                                                if(hm_control_var.succ_cntr == SUCC_CNT_5)
                                                {
                                                    dl_req.q_id=QUEUE_ID0;
                                                    dl_req.mod_id=TEST_TASK;
                                                    dl_req.pri=PRIORITY_2;

                                                    dl_request(dl_req);
                                                    hm_control_var.succ_cntr = 0;
                                                }
                                            }
                                        }
                                        
                                        break;

                                    case OBC_STRESS_TEST_SIMU:
                                        {
                                            if(test_layer_rcv_ipc_msg.pld.pld_data == TC_TM_BUFFER_SUCC)
                                            {
                                                hm_control_var.succ_cntr++;
                                                if(hm_control_var.succ_cntr == SUCC_CNT_270)
                                                {

                                                    dl_req.q_id=QUEUE_ID1;
                                                    dl_req.mod_id=TEST_TASK;
                                                    dl_req.pri=PRIORITY_2;

                                                    dl_request(dl_req);
                                                    hm_control_var.succ_cntr=0;
                                                }

                                            }
                                            else
                                            {
                                                DEBUG_CPRINT(("OBC_STRESS_TEST :ENQUEUE FAILURE\n"));
                                            }

                                        }
                                        break;
                                    case ADCS_STRESS_TEST_SIMU:
                                        {
                                            if(test_layer_rcv_ipc_msg.pld.pld_data == TC_TM_BUFFER_SUCC)
                                            {
                                                hm_control_var.succ_cntr++;

                                                if(hm_control_var.succ_cntr == SUCC_CNT_270)
                                                {
                                                   s_adcs_hm_cons_cur *stress_test_adcs_q2 = os_malloc(sizeof(s_adcs_hm_cons_cur));
                                                   stress_test(QUEUE_ID2,(uint8_t*)stress_test_adcs_q2,sizeof(s_adcs_hm_cons_cur),STRESS_INST_CNT);
                                                }
                                                else if(hm_control_var.succ_cntr == SUCC_CNT_540)
                                                {
                                                   s_adcs_hm_rw_cur *stress_test_adcs_q3 = os_malloc(sizeof(s_adcs_hm_rw_cur));
                                                   stress_test(QUEUE_ID3,(uint8_t*)stress_test_adcs_q3,sizeof(s_adcs_hm_rw_cur),STRESS_INST_CNT);
                                                }
                                                else if(hm_control_var.succ_cntr == SUCC_CNT_810)
                                                {
                                                   s_adcs_hm_css_vector  *stress_test_adcs_q4 = os_malloc(sizeof(s_adcs_hm_css_vector));
                                                   stress_test(QUEUE_ID4,(uint8_t*)stress_test_adcs_q4,sizeof(s_adcs_hm_css_vector),STRESS_INST_CNT);
                                                }
                                                else if(hm_control_var.succ_cntr == SUCC_CNT_1080)
                                                {
                                                   s_adcs_hm_est_att_angl *stress_test_adcs_q5 = os_malloc(sizeof(s_adcs_hm_est_att_angl));
                                                   stress_test(QUEUE_ID5,(uint8_t*)stress_test_adcs_q5,sizeof(s_adcs_hm_est_att_angl),STRESS_INST_CNT);
                                                }
                                                else if(hm_control_var.succ_cntr == SUCC_CNT_1350)
                                                {

                                                   s_adcs_hm_raw_mag_measure *stress_test_adcs_q6 = os_malloc(sizeof(s_adcs_hm_raw_mag_measure));
                                                   stress_test(QUEUE_ID6,(uint8_t*)stress_test_adcs_q6,sizeof(s_adcs_hm_raw_mag_measure),STRESS_INST_CNT);
                                                }
                                                else if(hm_control_var.succ_cntr == SUCC_CNT_1620)
                                                {
                                                   s_adcs_hm_raw_rates *stress_test_adcs_q7 = os_malloc(sizeof(s_adcs_hm_raw_rates));
                                                   stress_test(QUEUE_ID7,(uint8_t*)stress_test_adcs_q7,sizeof(s_adcs_hm_raw_rates),STRESS_INST_CNT);
                                                }
                                                else if(hm_control_var.succ_cntr == SUCC_CNT_1890)
                                                {
                                                   s_adcs_hm_meas_rates *stress_test_adcs_q8 = os_malloc(sizeof(s_adcs_hm_meas_rates));
                                                   stress_test(QUEUE_ID8,(uint8_t*)stress_test_adcs_q8,sizeof(s_adcs_hm_meas_rates),STRESS_INST_CNT);
                                                }
                                                else if(hm_control_var.succ_cntr == SUCC_CNT_2160)
                                                {
                                                   s_adcs_hm_fss_vec *stress_test_adcs_q9 = os_malloc(sizeof(s_adcs_hm_fss_vec));
                                                   stress_test(QUEUE_ID9,(uint8_t*)stress_test_adcs_q9,sizeof(s_adcs_hm_fss_vec),STRESS_INST_CNT);
                                                }
                                                else if(hm_control_var.succ_cntr == SUCC_CNT_2430)
                                                {
                                                   s_adcs_hm_est_rates_sns *stress_test_adcs_q10 = os_malloc(sizeof(s_adcs_hm_est_rates_sns));
                                                   stress_test(QUEUE_ID10,(uint8_t*)stress_test_adcs_q10,sizeof(s_adcs_hm_est_rates_sns),STRESS_INST_CNT);
                                                }
                                                else if(hm_control_var.succ_cntr == SUCC_CNT_2700)
                                                {

                                                   s_adcs_hm_misc_cur *stress_test_adcs_q11 = os_malloc(sizeof(s_adcs_hm_misc_cur));
                                                   stress_test(QUEUE_ID11,(uint8_t*)stress_test_adcs_q11,sizeof(s_adcs_hm_misc_cur),STRESS_INST_CNT);
                                                }
                                                else if(hm_control_var.succ_cntr == SUCC_CNT_2970)
                                                {
                                                   s_adcs_hm_temp *stress_test_adcs_q12 = os_malloc(sizeof(s_adcs_hm_temp));
                                                   stress_test(QUEUE_ID12,(uint8_t*)stress_test_adcs_q12,sizeof(s_adcs_hm_temp),STRESS_INST_CNT);
                                                }
                                                else if(hm_control_var.succ_cntr == SUCC_CNT_3240)
                                                {
                                                   s_adcs_hm_est_rate_sns_temp *stress_test_adcs_q13=os_malloc(sizeof(s_adcs_hm_est_rate_sns_temp));
                                                   stress_test(QUEUE_ID13,(uint8_t*)stress_test_adcs_q13,sizeof(s_adcs_hm_est_rate_sns_temp),STRESS_INST_CNT);
                                                }
                                                else if(hm_control_var.succ_cntr == SUCC_CNT_3510)
                                                {

                                                   s_adcs_hm_crnt_state *stress_test_adcs_q14 = os_malloc(sizeof(s_adcs_hm_crnt_state));
                                                   stress_test(QUEUE_ID14,(uint8_t*)stress_test_adcs_q14,sizeof(s_adcs_hm_crnt_state),STRESS_INST_CNT);
                                                }
                                                else if(hm_control_var.succ_cntr ==  SUCC_CNT_3780)
                                                {

                                                    dl_req.q_id=QUEUE_ID1;
                                                    dl_req.mod_id=TEST_TASK;
                                                    dl_req.pri=PRIORITY_2;

                                                    dl_request(dl_req);

                                                    dl_req.q_id=QUEUE_ID2;
                                                    dl_request(dl_req);

                                                    dl_req.q_id=QUEUE_ID3;
                                                    dl_request(dl_req);

                                                    dl_req.q_id=QUEUE_ID4;
                                                    dl_request(dl_req);

                                                    dl_req.q_id=QUEUE_ID5;
                                                    dl_request(dl_req);

                                                    dl_req.q_id=QUEUE_ID6;
                                                    dl_request(dl_req);

                                                    dl_req.q_id=QUEUE_ID7;
                                                    dl_request(dl_req);

                                                    dl_req.q_id=QUEUE_ID8;
                                                    dl_request(dl_req);

                                                    dl_req.q_id=QUEUE_ID9;
                                                    dl_request(dl_req);

                                                    dl_req.q_id=QUEUE_ID10;
                                                    dl_request(dl_req);

                                                    dl_req.q_id=QUEUE_ID11;
                                                    dl_request(dl_req);

                                                    dl_req.q_id=QUEUE_ID12;
                                                    dl_request(dl_req);

                                                    dl_req.q_id=QUEUE_ID13;
                                                    dl_request(dl_req);

                                                    dl_req.q_id=QUEUE_ID14;
                                                    dl_request(dl_req);

                                                    hm_control_var.succ_cntr=0;
                                                }

                                            }
                                            else
                                            {
                                                DEBUG_CPRINT(("ADCS_STRESS_TEST :ENQUEUE FAILURE\n"));
                                            }

                                        }
                                        break;

                                     case SENSORS_STRESS_TEST_SIMU:
                                        {
                                            if(test_layer_rcv_ipc_msg.pld.pld_data == TC_TM_BUFFER_SUCC)
                                            {
                                                hm_control_var.succ_cntr++;

                                                if(hm_control_var.succ_cntr == SUCC_CNT_270)
                                                {
                                                   hsc_data_s *stress_test_sensors_q2 = os_malloc(sizeof(hsc_data_s));
                                                   stress_test(QUEUE_ID2,(uint8_t*)stress_test_sensors_q2,sizeof(hsc_data_s),STRESS_INST_CNT);
                                                }
                                                else if(hm_control_var.succ_cntr == SUCC_CNT_540)
                                                {
                                                   hsc_data_s *stress_test_sensors_q3 = os_malloc(sizeof(hsc_data_s));
                                                   stress_test(QUEUE_ID3,(uint8_t*)stress_test_sensors_q3,sizeof(hsc_data_s),STRESS_INST_CNT);
                                                }
                                                else if(hm_control_var.succ_cntr == SUCC_CNT_810)
                                                {
                                                   dt_data_s *stress_test_sensors_q4 = os_malloc(sizeof(dt_data_s));
                                                   stress_test(QUEUE_ID4,(uint8_t*)stress_test_sensors_q4,sizeof(dt_data_s),STRESS_INST_CNT);
                                                }
                                                else if(hm_control_var.succ_cntr == SUCC_CNT_1080)
                                                {
                                                   dt_data_s *stress_test_sensors_q5 = os_malloc(sizeof(dt_data_s));
                                                   stress_test(QUEUE_ID5,(uint8_t*)stress_test_sensors_q5,sizeof(dt_data_s),STRESS_INST_CNT);
                                                }
                                                else if(hm_control_var.succ_cntr == SUCC_CNT_1350)
                                                {
                                                   psm_data_s *stress_test_sensors_q6 = os_malloc(sizeof(psm_data_s));
                                                   stress_test(QUEUE_ID6,(uint8_t*)stress_test_sensors_q6,sizeof(psm_data_s),STRESS_INST_CNT);
                                                }
                                                else if(hm_control_var.succ_cntr == SUCC_CNT_1620)
                                                {
                                                   psm_data_s *stress_test_sensors_q7 = os_malloc(sizeof(psm_data_s));
                                                   stress_test(QUEUE_ID7,(uint8_t*)stress_test_sensors_q7,sizeof(psm_data_s),STRESS_INST_CNT);
                                                }
                                                else if(hm_control_var.succ_cntr == SUCC_CNT_1890)
                                                {
                                                   temp_data_s *stress_test_sensors_q8 = os_malloc(sizeof(temp_data_s));
                                                   stress_test(QUEUE_ID8,(uint8_t*)stress_test_sensors_q8,sizeof(temp_data_s),STRESS_INST_CNT);
                                                }
                                                else if(hm_control_var.succ_cntr == SUCC_CNT_2160)
                                                {
                                                   temp_data_s *stress_test_sensors_q9 = os_malloc(sizeof(temp_data_s));
                                                   stress_test(QUEUE_ID9,(uint8_t*)stress_test_sensors_q9,sizeof(temp_data_s),STRESS_INST_CNT);
                                                }
                                                else if(hm_control_var.succ_cntr == SUCC_CNT_2430)
                                                {
                                                   temp_data_s *stress_test_sensors_q10 = os_malloc(sizeof(temp_data_s));
                                                   stress_test(QUEUE_ID10,(uint8_t*)stress_test_sensors_q10,sizeof(temp_data_s),STRESS_INST_CNT);
                                                }
                                                else if(hm_control_var.succ_cntr == SUCC_CNT_2700)
                                                {
                                                   temp_data_s *stress_test_sensors_q11=os_malloc(sizeof(temp_data_s));
                                                   stress_test(QUEUE_ID11,(uint8_t*)stress_test_sensors_q11,sizeof(temp_data_s),STRESS_INST_CNT);
                                                }
                                                else if(hm_control_var.succ_cntr == SUCC_CNT_2970)
                                                {
                                                   temp_data_s *stress_test_sensors_q12 = os_malloc(sizeof(temp_data_s));
                                                   stress_test(QUEUE_ID12,(uint8_t*)stress_test_sensors_q12,sizeof(temp_data_s),STRESS_INST_CNT);
                                                }
                                                else if(hm_control_var.succ_cntr == SUCC_CNT_3240)
                                                {
                                                   temp_data_s *stress_test_sensors_q13 = os_malloc(sizeof(temp_data_s));
                                                   stress_test(QUEUE_ID13,(uint8_t*)stress_test_sensors_q13,sizeof(temp_data_s),STRESS_INST_CNT);
                                                }
                                                else if(hm_control_var.succ_cntr == SUCC_CNT_3510)
                                                {
                                                   temp_data_s *stress_test_sensors_q14 = os_malloc(sizeof(temp_data_s));
                                                   stress_test(QUEUE_ID14,(uint8_t*)stress_test_sensors_q14,sizeof(temp_data_s),STRESS_INST_CNT);
                                                }
                                                else if(hm_control_var.succ_cntr == SUCC_CNT_3780)
                                                {
                                                   temp_data_s *stress_test_sensors_q15 = os_malloc(sizeof(temp_data_s));
                                                   stress_test(QUEUE_ID15,(uint8_t*)stress_test_sensors_q15,sizeof(temp_data_s),STRESS_INST_CNT);
                                                }
                                                else if(hm_control_var.succ_cntr == SUCC_CNT_4050)
                                                {
                                                   temp_data_s *stress_test_sensors_q16 = os_malloc(sizeof(temp_data_s));
                                                   stress_test(QUEUE_ID16,(uint8_t*)stress_test_sensors_q16,sizeof(temp_data_s),STRESS_INST_CNT);
                                                }
                                                else if(hm_control_var.succ_cntr == SUCC_CNT_4320)
                                                {

                                                    dl_req.q_id=QUEUE_ID1;
                                                    dl_req.mod_id=TEST_TASK;
                                                    dl_req.pri=PRIORITY_2;

                                                    dl_request(dl_req);

                                                    dl_req.q_id=QUEUE_ID2;
                                                    dl_request(dl_req);

                                                    dl_req.q_id=QUEUE_ID3;
                                                    dl_request(dl_req);

                                                    dl_req.q_id=QUEUE_ID4;
                                                    dl_request(dl_req);

                                                    dl_req.q_id=QUEUE_ID5;
                                                    dl_request(dl_req);

                                                    dl_req.q_id=QUEUE_ID6;
                                                    dl_request(dl_req);

                                                    dl_req.q_id=QUEUE_ID7;
                                                    dl_request(dl_req);

                                                    dl_req.q_id=QUEUE_ID8;
                                                    dl_request(dl_req);

                                                    dl_req.q_id=QUEUE_ID9;
                                                    dl_request(dl_req);

                                                    dl_req.q_id=QUEUE_ID10;
                                                    dl_request(dl_req);

                                                    dl_req.q_id=QUEUE_ID11;
                                                    dl_request(dl_req);

                                                    dl_req.q_id=QUEUE_ID12;
                                                    dl_request(dl_req);

                                                    dl_req.q_id=QUEUE_ID13;
                                                    dl_request(dl_req);

                                                    dl_req.q_id=QUEUE_ID14;
                                                    dl_request(dl_req);
                                                    
                                                    dl_req.q_id=QUEUE_ID15;
                                                    dl_request(dl_req);

                                                    dl_req.q_id=QUEUE_ID16;
                                                    dl_request(dl_req);

                                                    hm_control_var.succ_cntr=0;
                                                }

                                            }
                                            else
                                            {
                                                DEBUG_CPRINT(("SENSORS_STRESS_TEST :ENQUEUE FAILURE\n"));
                                            }

                                        }
                                        break;


                                    case EPS_STRESS_TEST_SIMU:
                                        {
                                            if(test_layer_rcv_ipc_msg.pld.pld_data == TC_TM_BUFFER_SUCC)
                                            {
                                                hm_control_var.succ_cntr++;
                                                if(hm_control_var.succ_cntr == SUCC_CNT_270)
                                                {
                                                   eps_get_chnl_par_tmr_s *stress_test_eps_get_chnl = os_malloc(sizeof(eps_get_chnl_par_tmr_s));
                                                   stress_test(QUEUE_ID2,(uint8_t*)stress_test_eps_get_chnl,sizeof(eps_get_chnl_par_tmr_s),STRESS_INST_CNT);
                                                }
                                                else if(hm_control_var.succ_cntr == SUCC_CNT_540)
                                                {
                                                   eps_get_btry_brd_tmr_s  *stress_test_eps_get_btry_board = os_malloc(sizeof(eps_get_btry_brd_tmr_s));
                                                   stress_test(QUEUE_ID3,(uint8_t*)stress_test_eps_get_btry_board,sizeof(eps_get_btry_brd_tmr_s),STRESS_INST_CNT);
                                                }
                                                else if(hm_control_var.succ_cntr == SUCC_CNT_810)
                                                {
                                                   eps_get_conv_brd_tmr_s  *stress_test_eps_get_conv_brd = os_malloc(sizeof(eps_get_conv_brd_tmr_s));
                                                   stress_test(QUEUE_ID4,(uint8_t*)stress_test_eps_get_conv_brd,sizeof(eps_get_conv_brd_tmr_s),STRESS_INST_CNT);
                                                }
                                                else if(hm_control_var.succ_cntr == SUCC_CNT_1080)
                                                {

                                                    dl_req.q_id=QUEUE_ID1;
                                                    dl_req.mod_id=TEST_TASK;
                                                    dl_req.pri=PRIORITY_2;

                                                    dl_request(dl_req);

                                                    dl_req.q_id=QUEUE_ID2;
                                                    dl_request(dl_req);

                                                    dl_req.q_id=QUEUE_ID3;
                                                    dl_request(dl_req);

                                                    dl_req.q_id=QUEUE_ID4;
                                                    dl_request(dl_req);

                                                    hm_control_var.succ_cntr=0;
                                                }

                                            }
                                            else
                                            {
                                                DEBUG_CPRINT(("EPS_STRESS_TEST :ENQUEUE FAILURE\n"));
                                            }

                                        }
                                        break;
                                    case COMMS_SBAND_STRESS_TEST_SIMU:
                                        {
                                            if(test_layer_rcv_ipc_msg.pld.pld_data == TC_TM_BUFFER_SUCC)
                                            {
                                                hm_control_var.succ_cntr++;
                                                if(hm_control_var.succ_cntr == COMMS_SBAND_INST)
                                                {

                                                    dl_req.q_id=QUEUE_ID1;
                                                    dl_req.mod_id=TEST_TASK;
                                                    dl_req.pri=PRIORITY_2;

                                                    dl_request(dl_req);
                                                    hm_control_var.succ_cntr=0;
                                                }

                                            }
                                            else
                                            {
                                                DEBUG_CPRINT(("COMMS_SBAND_STRESS_TEST :ENQUEUE FAILURE\n"));
                                            }

                                        }
                                        break;
                                    case COMMS_UHF_STRESS_TEST_SIMU:
                                        {
                                            if(test_layer_rcv_ipc_msg.pld.pld_data == TC_TM_BUFFER_SUCC)
                                            {
                                                hm_control_var.succ_cntr++;
                                                if(hm_control_var.succ_cntr == SUCC_CNT_270)
                                                {

                                                    dl_req.q_id=QUEUE_ID1;
                                                    dl_req.mod_id=TEST_TASK;
                                                    dl_req.pri=PRIORITY_2;

                                                    dl_request(dl_req);
                                                    hm_control_var.succ_cntr=0;
                                                }

                                            }
                                            else
                                            {
                                                DEBUG_CPRINT(("COMMS_UHF_STRESS_TEST :ENQUEUE FAILURE\n"));
                                            }

                                        }
                                        break;

                                    case ERROR_HANDLER_STRESS_TEST_SIMU:
                                        {
                                            if(test_layer_rcv_ipc_msg.pld.pld_data == TC_TM_BUFFER_SUCC)
                                            {
                                                hm_control_var.succ_cntr++;
                                                if(hm_control_var.succ_cntr == SUCC_CNT_270)
                                                {

                                                    dl_req.q_id=QUEUE_ID1;
                                                    dl_req.mod_id=TEST_TASK;
                                                    dl_req.pri=PRIORITY_2;

                                                    dl_request(dl_req);
                                                    hm_control_var.succ_cntr=0;
                                                }

                                            }
                                            else
                                            {
                                                DEBUG_CPRINT(("ERROR_HANDLER_STRESS_TEST :ENQUEUE FAILURE\n"));
                                            }

                                        }
                                        break;
                                    case MAX_TM_DOWNLOAD_CHECK_62K:
                                        {
                                            if(test_layer_rcv_ipc_msg.pld.pld_data == TC_TM_BUFFER_SUCC)
                                            {
                                                hm_control_var.succ_cntr++;
                                                if(hm_control_var.succ_cntr == MAX_TM_INST)
                                                {

                                                    dl_req.q_id=QUEUE_ID1;
                                                    dl_req.mod_id=TEST_TASK;
                                                    dl_req.pri=PRIORITY_2;

                                                    dl_request(dl_req);
                                                    hm_control_var.succ_cntr=0;
                                                }

                                            }
                                            else
                                            {
                                                DEBUG_CPRINT(("COMMS_SBAND_STRESS_TEST :ENQUEUE FAILURE\n"));
                                            }

                                        }
                                        break;

                                }   
                            }
                            break;
                        case OBC_TC_TM_FLUSH_QUEUE_RSP:
                            {
                                switch(hm_control_var.current_test_case_id)
                                {
                                    case FLUSH_SUCC_VAL_MOD_QUEUE_PRI:
                                        {
                                            if(test_layer_rcv_ipc_msg.pld.pld_data == TC_TM_BUFFER_SUCC)
                                            {
                                                /*Delete queue Id 0*/
                                                del_req.q_id=QUEUE_ID0;
                                                del_req.app_id=TEST_TASK;

                                                delete_req(del_req);
                                                hm_control_var.succ_cntr=0;
                                            }
                                        }
                                        break; 
                                     case FLUSH_FAIL_INVAL_MOD_QUEUE_PRI:
                                        {
                                            if(test_layer_rcv_ipc_msg.pld.pld_data == TC_TM_BUFFER_INVLD_PRIORITY)
                                            {
                                                send_itc_test_case_resp(FLUSH_FAIL_INVAL_MOD_QUEUE_PRI,TEST_TASK,OBC_HM_TEST_CASE_RSP,TEST_CASE_SUCC,OBC_MAIN);
                                            }
                                            else
                                            {
                                                send_itc_test_case_resp(FLUSH_FAIL_INVAL_MOD_QUEUE_PRI,TEST_TASK,OBC_HM_TEST_CASE_RSP,TEST_CASE_FAIL,OBC_MAIN);
                                            }
                                        }
                                        break;

                                     case FLUSH_SUCC_INVAL_MOD_QUEUE_VAL_PRI:
                                        {
                                            if(test_layer_rcv_ipc_msg.pld.pld_data == TC_TM_BUFFER_SUCC)
                                            {
                                                send_itc_test_case_resp(FLUSH_SUCC_INVAL_MOD_QUEUE_VAL_PRI,TEST_TASK,OBC_HM_TEST_CASE_RSP,TEST_CASE_SUCC,OBC_MAIN);
                                            }
                                            else
                                            {
                                                send_itc_test_case_resp(FLUSH_SUCC_INVAL_MOD_QUEUE_VAL_PRI,TEST_TASK,OBC_HM_TEST_CASE_RSP,TEST_CASE_FAIL,OBC_MAIN);
                                            }
                                        }
                                        break;

                                     case FLUSH_FAIL_VAL_MOD_INVAL_QUEUE_PRI:
                                        {
                                            if(test_layer_rcv_ipc_msg.pld.pld_data ==TC_TM_BUFFER_INVLD_PRIORITY)
                                            {
                                                 /*Delete queue Id 0*/
                                                del_req.q_id=QUEUE_ID0;
                                                del_req.app_id=TEST_TASK;

                                                delete_req(del_req);
                                                del_req.q_id=QUEUE_ID1;

                                                delete_req(del_req);
                                                hm_control_var.succ_cntr=0;

                                            }
                                        }
                                        break;
                                     case FLUSH_SUCC_VAL_MOD_PRI_INVAL_QUEUE:
                                        {
                                            if(test_layer_rcv_ipc_msg.pld.pld_data ==TC_TM_BUFFER_SUCC)
                                            {
                                                 /*Delete queue Id 0*/
                                                del_req.q_id=QUEUE_ID1;
                                                del_req.app_id=TEST_TASK;

                                                delete_req(del_req);
                                                del_req.q_id=QUEUE_ID0;

                                                delete_req(del_req);
                                                hm_control_var.succ_cntr=0;

                                            }
                                        }
                                        break;

                                     case FLUSH_FAIL_VAL_MOD_QUEUE_NOT_ACTIVE:
                                        {
                                            if(test_layer_rcv_ipc_msg.pld.pld_data ==TC_TM_BUFFER_QUEUE_NOT_ACTIVE)
                                            {
                                                 /*Delete queue Id 0*/
                                                del_req.q_id=QUEUE_ID0;
                                                del_req.app_id=TEST_TASK;

                                                delete_req(del_req);
                                                hm_control_var.succ_cntr=0;

                                            }
                                        }
                                        break;

                                    default:
                                        {

                                        }
                                        break;
                                }
                            }
                            break;
                        case OBC_TC_TM_DL_BUFFER_RSP:
                            {
                                switch(hm_control_var.current_test_case_id)
                                {
                                    case DL_REQ_FAIL_VAL_MOD_QUEUE_INACTIVE:
                                        {
                                            if(test_layer_rcv_ipc_msg.pld.pld_data == TC_TM_BUFFER_QUEUE_NOT_ACTIVE)
                                            {
                                                /*Delete queue*/
                                                del_req.q_id=QUEUE_ID0;
                                                del_req.app_id=TEST_TASK;

                                                delete_req(del_req);
                                            }
                                        }
                                        break;
                                    case DL_REQ_SUCC_VAL_MOD_QUEUE_ACTIVE:
                                        {
                                            if(test_layer_rcv_ipc_msg.pld.pld_data == TC_TM_BUFFER_SUCC)
                                            {
                                                /*Delete queue*/
                                                del_req.q_id=QUEUE_ID0;
                                                del_req.app_id=TEST_TASK;

                                                delete_req(del_req);
                                            }
                                        }
                                        break;
                                    case DL_REQ_FAIL_INVAL_MOD_QUEUE_PRI:
                                        {
                                            if(test_layer_rcv_ipc_msg.pld.pld_data == TC_TM_BUFFER_INVLD_PRIORITY)
                                            {
                                                send_itc_test_case_resp(DL_REQ_FAIL_INVAL_MOD_QUEUE_PRI,TEST_TASK,OBC_HM_TEST_CASE_RSP,TEST_CASE_SUCC,OBC_MAIN);
                                            }
                                            else
                                            {
                                                send_itc_test_case_resp(DL_REQ_FAIL_INVAL_MOD_QUEUE_PRI,TEST_TASK,OBC_HM_TEST_CASE_RSP,TEST_CASE_FAIL,OBC_MAIN);
                                            }
                                        }
                                        break;
                                    case DL_REQ_SUCC_INVAL_MOD_QUEUE_VAL_PRI:
                                        {
                                            if(test_layer_rcv_ipc_msg.pld.pld_data == TC_TM_BUFFER_SUCC)
                                            {
                                                send_itc_test_case_resp(DL_REQ_SUCC_INVAL_MOD_QUEUE_VAL_PRI,TEST_TASK,OBC_HM_TEST_CASE_RSP,TEST_CASE_SUCC,OBC_MAIN);
                                            }
                                            else
                                            {
                                                send_itc_test_case_resp(DL_REQ_SUCC_INVAL_MOD_QUEUE_VAL_PRI,TEST_TASK,OBC_HM_TEST_CASE_RSP,TEST_CASE_FAIL,OBC_MAIN);
                                            }
                                        }
                                        break;
                                    case DL_REQ_FAIL_VAL_MOD_INVAL_QUEUE_PRI:
                                        {
                                            if(test_layer_rcv_ipc_msg.pld.pld_data == TC_TM_BUFFER_INVLD_PRIORITY)
                                            {
                                                send_itc_test_case_resp(DL_REQ_FAIL_VAL_MOD_INVAL_QUEUE_PRI,TEST_TASK,OBC_HM_TEST_CASE_RSP,TEST_CASE_SUCC,OBC_MAIN);
                                            }
                                            else
                                            {
                                                send_itc_test_case_resp(DL_REQ_FAIL_VAL_MOD_INVAL_QUEUE_PRI,TEST_TASK,OBC_HM_TEST_CASE_RSP,TEST_CASE_FAIL,OBC_MAIN);
                                            }
                                        }
                                        break;
                                    case DL_REQ_SUCC_VAL_MOD_PRI_INVAL_QUEUE:
                                        {
                                            if(test_layer_rcv_ipc_msg.pld.pld_data ==TC_TM_BUFFER_SUCC)
                                            {
                                                send_itc_test_case_resp(DL_REQ_SUCC_VAL_MOD_PRI_INVAL_QUEUE,TEST_TASK,OBC_HM_TEST_CASE_RSP,TEST_CASE_SUCC,OBC_MAIN);
                                            }
                                            else
                                            {
                                                send_itc_test_case_resp(DL_REQ_SUCC_VAL_MOD_PRI_INVAL_QUEUE,TEST_TASK,OBC_HM_TEST_CASE_RSP,TEST_CASE_FAIL,OBC_MAIN);
                                            }
                                        }
                                        break;
                                    case OBC_STRESS_TEST_SIMU:
                                        {
                                            if(test_layer_rcv_ipc_msg.pld.pld_data == TC_TM_BUFFER_SUCC)
                                            {
                                                /*Delete queue*/
                                                del_req.q_id=QUEUE_ID1;
                                                del_req.app_id=TEST_TASK;

                                                delete_req(del_req);
                                            }
                                        }
                                        break;
                                    case ADCS_STRESS_TEST_SIMU:
                                        {
                                            if(test_layer_rcv_ipc_msg.pld.pld_data == TC_TM_BUFFER_SUCC)
                                            {
                                                hm_control_var.succ_cntr++;
                                                if(hm_control_var.succ_cntr == SUCC_CNT_14)
                                                {
                                                /*Delete queue*/
                                                del_req.q_id=QUEUE_ID1;
                                                del_req.app_id=TEST_TASK;

                                                delete_req(del_req);

                                                del_req.q_id=QUEUE_ID2;
                                                delete_req(del_req);

                                                del_req.q_id=QUEUE_ID3;
                                                delete_req(del_req);

                                                del_req.q_id=QUEUE_ID4;
                                                delete_req(del_req);

                                                del_req.q_id=QUEUE_ID5;
                                                delete_req(del_req);

                                                del_req.q_id=QUEUE_ID6;
                                                delete_req(del_req);

                                                del_req.q_id=QUEUE_ID7;
                                                delete_req(del_req);

                                                del_req.q_id=QUEUE_ID8;
                                                delete_req(del_req);
                                                
                                                del_req.q_id=QUEUE_ID9;
                                                delete_req(del_req);

                                                del_req.q_id=QUEUE_ID10;
                                                delete_req(del_req);

                                                del_req.q_id=QUEUE_ID11;
                                                delete_req(del_req);

                                                del_req.q_id=QUEUE_ID12;
                                                delete_req(del_req);

                                                del_req.q_id=QUEUE_ID13;
                                                delete_req(del_req);

                                                del_req.q_id=QUEUE_ID14;
                                                delete_req(del_req);

                                                hm_control_var.succ_cntr=0;
                                                }
                                            }
                                        }
                                        break;
                                     case SENSORS_STRESS_TEST_SIMU:
                                        {
                                            if(test_layer_rcv_ipc_msg.pld.pld_data == TC_TM_BUFFER_SUCC)
                                            {
                                                hm_control_var.succ_cntr++;
                                                if(hm_control_var.succ_cntr == SUCC_CNT_16)
                                                {
                                                /*Delete queue*/
                                                del_req.q_id=QUEUE_ID1;
                                                del_req.app_id=TEST_TASK;

                                                delete_req(del_req);

                                                del_req.q_id=QUEUE_ID2;
                                                delete_req(del_req);

                                                del_req.q_id=QUEUE_ID3;
                                                delete_req(del_req);

                                                del_req.q_id=QUEUE_ID4;
                                                delete_req(del_req);

                                                del_req.q_id=QUEUE_ID5;
                                                delete_req(del_req);

                                                del_req.q_id=QUEUE_ID6;
                                                delete_req(del_req);

                                                del_req.q_id=QUEUE_ID7;
                                                delete_req(del_req);

                                                del_req.q_id=QUEUE_ID8;
                                                delete_req(del_req);

                                                del_req.q_id=QUEUE_ID9;
                                                delete_req(del_req);
                                                
                                                del_req.q_id=QUEUE_ID10;
                                                delete_req(del_req);

                                                del_req.q_id=QUEUE_ID11;
                                                delete_req(del_req);

                                                del_req.q_id=QUEUE_ID12;
                                                delete_req(del_req);

                                                del_req.q_id=QUEUE_ID13;
                                                delete_req(del_req);

                                                del_req.q_id=QUEUE_ID14;
                                                delete_req(del_req);

                                                del_req.q_id=QUEUE_ID15;
                                                delete_req(del_req);

                                                del_req.q_id=QUEUE_ID16;
                                                delete_req(del_req);
                                                
                                                hm_control_var.succ_cntr=0;
                                                }
                                            }
                                        }
                                        break;


                                    case EPS_STRESS_TEST_SIMU:
                                        {
                                            if(test_layer_rcv_ipc_msg.pld.pld_data == TC_TM_BUFFER_SUCC)
                                            {
                                                hm_control_var.succ_cntr++;
                                                if(hm_control_var.succ_cntr == SUCC_CNT_4)
                                                {
                                                /*Delete queue*/
                                                del_req.q_id=QUEUE_ID1;
                                                del_req.app_id=TEST_TASK;

                                                delete_req(del_req);

                                                del_req.q_id=QUEUE_ID2;
                                                delete_req(del_req);

                                                del_req.q_id=QUEUE_ID3;
                                                delete_req(del_req);

                                                del_req.q_id=QUEUE_ID4;
                                                delete_req(del_req);
                                                
                                                hm_control_var.succ_cntr=0;
                                                }
                                            }
                                        }
                                        break;
                                    case COMMS_SBAND_STRESS_TEST_SIMU:
                                        {
                                            if(test_layer_rcv_ipc_msg.pld.pld_data == TC_TM_BUFFER_SUCC)
                                            {
                                                /*Delete queue*/
                                                del_req.q_id=QUEUE_ID1;
                                                del_req.app_id=TEST_TASK;

                                                delete_req(del_req);
                                            }
                                        }
                                        break;
                                    case COMMS_UHF_STRESS_TEST_SIMU:
                                        {
                                            if(test_layer_rcv_ipc_msg.pld.pld_data == TC_TM_BUFFER_SUCC)
                                            {
                                                /*Delete queue*/
                                                del_req.q_id=QUEUE_ID1;
                                                del_req.app_id=TEST_TASK;

                                                delete_req(del_req);
                                            }
                                        }
                                        break;

                                    case ERROR_HANDLER_STRESS_TEST_SIMU:
                                        {
                                            if(test_layer_rcv_ipc_msg.pld.pld_data == TC_TM_BUFFER_SUCC)
                                            {
                                                /*Delete queue*/
                                                del_req.q_id=QUEUE_ID1;
                                                del_req.app_id=TEST_TASK;

                                                delete_req(del_req);
                                            }
                                        }
                                        break;
                                    case MAX_TM_DOWNLOAD_CHECK_62K:
                                        {
                                            if(test_layer_rcv_ipc_msg.pld.pld_data == TC_TM_BUFFER_SUCC)
                                            {
                                                /*Delete queue*/
                                                del_req.q_id=QUEUE_ID1;
                                                del_req.app_id=TEST_TASK;

                                                delete_req(del_req);
                                            }
                                        }
                                        break;

                                }
                            }
                            break;
                        case OBC_TC_TM_DEL_QUEUE_RSP:
                            {
                                switch(hm_control_var.current_test_case_id)
                                {

                                    case BUFF_REQ_SINGLE_QUEUE:
                                        {
                                            /*Sending Success response for the test case - Single queue create*/
                                            if(test_layer_rcv_ipc_msg.pld.pld_data == TC_TM_BUFFER_SUCC)
                                            {
                                                send_itc_test_case_resp(BUFF_REQ_SINGLE_QUEUE,TEST_TASK,OBC_HM_TEST_CASE_RSP,TEST_CASE_SUCC,OBC_MAIN);
                                            }
                                        }
                                        break;

                                    case BUFF_REQ_MULTIPLE_QUEUE:
                                        {
                                            /*If enqueue response is success*/
                                            if(test_layer_rcv_ipc_msg.pld.pld_data == TC_TM_BUFFER_SUCC)
                                            {
                                                hm_control_var.succ_cntr++;
                                                if(hm_control_var.succ_cntr == hm_control_var.queue_cnt)
                                                {
                                                    send_itc_test_case_resp(BUFF_REQ_MULTIPLE_QUEUE,TEST_TASK,OBC_HM_TEST_CASE_RSP,TEST_CASE_SUCC,OBC_MAIN);
                                                    hm_control_var.succ_cntr=0;
                                                }
                                            }

                                        }
                                        break;

                                    case ENQUEUE_REQ_SINGLE_QUEUE:
                                        {
                                            /*Sending Success response for the test case - Single queue create*/
                                            if(test_layer_rcv_ipc_msg.pld.pld_data == TC_TM_BUFFER_SUCC)
                                            {
                                                send_itc_test_case_resp(ENQUEUE_REQ_SINGLE_QUEUE,TEST_TASK,OBC_HM_TEST_CASE_RSP,test_layer_rcv_ipc_msg.pld.pld_data,OBC_MAIN);
                                            }
                                        }
                                        break;
                                    case ENQUEUE_REQ_MULTIPLE_QUEUE:
                                        {
                                            /*If enqueue response is success*/
                                            if(test_layer_rcv_ipc_msg.pld.pld_data == TC_TM_BUFFER_SUCC)
                                            {
                                                hm_control_var.succ_cntr++;
                                                if(hm_control_var.succ_cntr == hm_control_var.queue_cnt)
                                                {
                                                    send_itc_test_case_resp(ENQUEUE_REQ_MULTIPLE_QUEUE,TEST_TASK,OBC_HM_TEST_CASE_RSP,TEST_CASE_SUCC,OBC_MAIN);
                                                    hm_control_var.succ_cntr=0;
                                                }
                                            }

                                        }
                                        break;
                                    case ENQUEUE_REQ_WRAP_DSB_DATA_DROP:
                                        {
                                            if((test_layer_rcv_ipc_msg.pld.pld_data == TC_TM_BUFFER_SUCC)&&(hm_control_var.wrap_dsb_enq_succ==SUCC_CNT_3)&&(hm_control_var.wrap_dsb_data_drop==SUCC_CNT_2))
                                            {
                                                send_itc_test_case_resp(ENQUEUE_REQ_WRAP_DSB_DATA_DROP,TEST_TASK,OBC_HM_TEST_CASE_RSP,TEST_CASE_SUCC,OBC_MAIN);
                                                hm_control_var.wrap_dsb_enq_succ=0;
                                                hm_control_var.wrap_dsb_data_drop=0;
                                            }
                                            else
                                            {
                                                send_itc_test_case_resp(ENQUEUE_REQ_WRAP_DSB_DATA_DROP,TEST_TASK,OBC_HM_TEST_CASE_RSP,TEST_CASE_FAIL,OBC_MAIN);
                                            }
                                        }
                                        break;
                                    case ENQUEUE_REQ_QUEUE_FULL:
                                        {
                                            if(test_layer_rcv_ipc_msg.pld.pld_data == TC_TM_BUFFER_SUCC)
                                            {
                                                send_itc_test_case_resp(ENQUEUE_REQ_QUEUE_FULL,TEST_TASK,OBC_HM_TEST_CASE_RSP,TEST_CASE_SUCC,OBC_MAIN);
                                            }
                                            else
                                            {
                                                send_itc_test_case_resp(ENQUEUE_REQ_QUEUE_FULL,TEST_TASK,OBC_HM_TEST_CASE_RSP,TEST_CASE_FAIL,OBC_MAIN);
                                            }
                                        }
                                        break;

                                    case FLUSH_SUCC_VAL_MOD_QUEUE_PRI:
                                        {
                                            if(test_layer_rcv_ipc_msg.pld.pld_data == TC_TM_BUFFER_SUCC)
                                            {
                                                send_itc_test_case_resp(FLUSH_SUCC_VAL_MOD_QUEUE_PRI,TEST_TASK,OBC_HM_TEST_CASE_RSP,TEST_CASE_SUCC,OBC_MAIN);
                                            }
                                            else
                                            {
                                                send_itc_test_case_resp(FLUSH_SUCC_VAL_MOD_QUEUE_PRI,TEST_TASK,OBC_HM_TEST_CASE_RSP,TEST_CASE_FAIL,OBC_MAIN);
                                            }
                                        }
                                        break;
                                    case FLUSH_FAIL_VAL_MOD_INVAL_QUEUE_PRI:
                                        {
                                            /*If delete response is success*/
                                            if(test_layer_rcv_ipc_msg.pld.pld_data == TC_TM_BUFFER_SUCC)
                                            {
                                                hm_control_var.succ_cntr++;
                                                if(hm_control_var.succ_cntr == SUCC_CNT_2)
                                                {
                                                    send_itc_test_case_resp(FLUSH_FAIL_VAL_MOD_INVAL_QUEUE_PRI,TEST_TASK,OBC_HM_TEST_CASE_RSP,test_layer_rcv_ipc_msg.pld.pld_data,OBC_MAIN);
                                                    hm_control_var.succ_cntr=0;
                                                }
                                            }
                                        }
                                        break;
                                    case FLUSH_SUCC_VAL_MOD_PRI_INVAL_QUEUE:
                                        {
                                            /*If delete response is success*/
                                            if(test_layer_rcv_ipc_msg.pld.pld_data == TC_TM_BUFFER_SUCC)
                                            {
                                                hm_control_var.succ_cntr++;
                                                if(hm_control_var.succ_cntr == SUCC_CNT_2)
                                                {
                                                    send_itc_test_case_resp(FLUSH_SUCC_VAL_MOD_PRI_INVAL_QUEUE,TEST_TASK,OBC_HM_TEST_CASE_RSP,TEST_CASE_SUCC,OBC_MAIN);
                                                    hm_control_var.succ_cntr=0;
                                                }
                                            }

                                        }
                                        break;
                                    case FLUSH_FAIL_VAL_MOD_QUEUE_NOT_ACTIVE:
                                        {
                                            if(test_layer_rcv_ipc_msg.pld.pld_data == TC_TM_BUFFER_SUCC)
                                            {
                                            send_itc_test_case_resp(FLUSH_FAIL_VAL_MOD_QUEUE_NOT_ACTIVE,TEST_TASK,OBC_HM_TEST_CASE_RSP,TEST_CASE_SUCC,OBC_MAIN);
                                            }
                                            else
                                            {
                                            send_itc_test_case_resp(FLUSH_FAIL_VAL_MOD_QUEUE_NOT_ACTIVE,TEST_TASK,OBC_HM_TEST_CASE_RSP,TEST_CASE_FAIL,OBC_MAIN);
                                            }
                                        }
                                        break;
                                    case CHNGE_QPRI_FAIL_VAL_MOD_INVAL_QUEUE_PRI:
                                        {
                                            /*If delete response is success*/
                                            if(test_layer_rcv_ipc_msg.pld.pld_data == TC_TM_BUFFER_SUCC)
                                            {
                                                hm_control_var.succ_cntr++;
                                                if(hm_control_var.succ_cntr == SUCC_CNT_2)
                                                {
                                                    send_itc_test_case_resp(CHNGE_QPRI_FAIL_VAL_MOD_INVAL_QUEUE_PRI,TEST_TASK,OBC_HM_TEST_CASE_RSP,TEST_CASE_SUCC,OBC_MAIN);
                                                    hm_control_var.succ_cntr=0;
                                                }
                                            }
                                        }
                                        break;
                                    case CHNGE_QPRI_SUCC_VAL_MOD_INVALID_QUE:
                                        {
                                            /*If delete response is success*/
                                            if(test_layer_rcv_ipc_msg.pld.pld_data == TC_TM_BUFFER_SUCC)
                                            {
                                                hm_control_var.succ_cntr++;
                                                if(hm_control_var.succ_cntr == SUCC_CNT_2)
                                                {
                                                    send_itc_test_case_resp(CHNGE_QPRI_SUCC_VAL_MOD_INVALID_QUE,TEST_TASK,OBC_HM_TEST_CASE_RSP,TEST_CASE_SUCC,OBC_MAIN);
                                                    hm_control_var.succ_cntr=0;
                                                }
                                            }
                                        }
                                        break;
                                    case CHNGE_QPRI_FAIL_VAL_MOD_QUEUE_INACTIVE:
                                        {
                                            /*If delete response is success*/
                                            if(test_layer_rcv_ipc_msg.pld.pld_data == TC_TM_BUFFER_SUCC)
                                            {
                                                send_itc_test_case_resp(CHNGE_QPRI_FAIL_VAL_MOD_QUEUE_INACTIVE,TEST_TASK,OBC_HM_TEST_CASE_RSP,test_layer_rcv_ipc_msg.pld.pld_data,OBC_MAIN);
                                            }
                                        }
                                        break;
                                    case CHNGE_QPRI_SUCC_VAL_MOD_QUEUE_ACTIVE:
                                        {
                                            /*If delete response is success*/
                                            if(test_layer_rcv_ipc_msg.pld.pld_data == TC_TM_BUFFER_SUCC)
                                            {
                                                send_itc_test_case_resp(CHNGE_QPRI_SUCC_VAL_MOD_QUEUE_ACTIVE,TEST_TASK,OBC_HM_TEST_CASE_RSP,test_layer_rcv_ipc_msg.pld.pld_data,OBC_MAIN);
                                            }
                                        }
                                        break;


                                    case DEL_QUEUE_SUCC_ACTIVE_QUEUE:
                                        {
                                            /*If delete response is success*/
                                            if(test_layer_rcv_ipc_msg.pld.pld_data == TC_TM_BUFFER_SUCC)
                                            {
                                            send_itc_test_case_resp(DEL_QUEUE_SUCC_ACTIVE_QUEUE,TEST_TASK,OBC_HM_TEST_CASE_RSP,TEST_CASE_SUCC,OBC_MAIN);
                                            }
                                            else
                                            {
                                            send_itc_test_case_resp(DEL_QUEUE_SUCC_ACTIVE_QUEUE,TEST_TASK,OBC_HM_TEST_CASE_RSP,TEST_CASE_FAIL,OBC_MAIN);
                                            }
                                        }
                                        break;
                                    case DEL_QUEUE_FAIL_INACTIVE_QUEUE:
                                        {
                                            /*If delete response is success*/
                                            if(test_layer_rcv_ipc_msg.pld.pld_data == TC_TM_BUFFER_DELETE_QUEUE_FAIL)
                                            {
                                            send_itc_test_case_resp(DEL_QUEUE_FAIL_INACTIVE_QUEUE,TEST_TASK,OBC_HM_TEST_CASE_RSP,TEST_CASE_SUCC,OBC_MAIN);
                                            }
                                            else
                                            {
                                            send_itc_test_case_resp(DEL_QUEUE_FAIL_INACTIVE_QUEUE,TEST_TASK,OBC_HM_TEST_CASE_RSP,TEST_CASE_FAIL,OBC_MAIN);
                                            }
                                        }
                                        break;
                                    case OBC_STRESS_TEST_SIMU:
                                        {
                                            /*If delete response is success*/
                                            if(test_layer_rcv_ipc_msg.pld.pld_data == TC_TM_BUFFER_SUCC)
                                            {
                                                 send_itc_test_case_resp(OBC_STRESS_TEST_SIMU,TEST_TASK,OBC_HM_TEST_CASE_RSP,test_layer_rcv_ipc_msg.pld.pld_data,OBC_MAIN);
                                            }
                                        }
                                        break;
                                     case ADCS_STRESS_TEST_SIMU:
                                        {
                                            /*If delete response is success*/
                                            if(test_layer_rcv_ipc_msg.pld.pld_data == TC_TM_BUFFER_SUCC)
                                            {
                                                hm_control_var.succ_cntr++;
                                                if(hm_control_var.succ_cntr == SUCC_CNT_14)
                                                {
                                                    send_itc_test_case_resp(ADCS_STRESS_TEST_SIMU,TEST_TASK,OBC_HM_TEST_CASE_RSP,test_layer_rcv_ipc_msg.pld.pld_data,OBC_MAIN);
                                                 hm_control_var.succ_cntr = 0;
                                                }
                                            }
                                        }
                                        break;
                                     case SENSORS_STRESS_TEST_SIMU:
                                        {
                                            /*If delete response is success*/
                                            if(test_layer_rcv_ipc_msg.pld.pld_data == TC_TM_BUFFER_SUCC)
                                            {
                                                hm_control_var.succ_cntr++;
                                                if(hm_control_var.succ_cntr ==SUCC_CNT_16)
                                                {
                                                 send_itc_test_case_resp(SENSORS_STRESS_TEST_SIMU,TEST_TASK,OBC_HM_TEST_CASE_RSP,test_layer_rcv_ipc_msg.pld.pld_data,OBC_MAIN);
                                                 hm_control_var.succ_cntr = 0;
                                                }
                                            }
                                        }
                                        break;
                                    case EPS_STRESS_TEST_SIMU:
                                        {
                                            /*If delete response is success*/
                                            if(test_layer_rcv_ipc_msg.pld.pld_data == TC_TM_BUFFER_SUCC)
                                            {
                                                hm_control_var.succ_cntr++;
                                                if(hm_control_var.succ_cntr == SUCC_CNT_4)
                                                {
                                                 send_itc_test_case_resp(EPS_STRESS_TEST_SIMU,TEST_TASK,OBC_HM_TEST_CASE_RSP,test_layer_rcv_ipc_msg.pld.pld_data,OBC_MAIN);
                                                 hm_control_var.succ_cntr = 0;
                                                }
                                            }
                                        }
                                        break;
                                    case COMMS_SBAND_STRESS_TEST_SIMU:
                                        {
                                            /*If delete response is success*/
                                            if(test_layer_rcv_ipc_msg.pld.pld_data == TC_TM_BUFFER_SUCC)
                                            {
                                                send_itc_test_case_resp(COMMS_SBAND_STRESS_TEST_SIMU,TEST_TASK,OBC_HM_TEST_CASE_RSP,test_layer_rcv_ipc_msg.pld.pld_data,OBC_MAIN);
                                            }
                                        }
                                        break;
                                     case COMMS_UHF_STRESS_TEST_SIMU:
                                        {
                                            /*If delete response is success*/
                                            if(test_layer_rcv_ipc_msg.pld.pld_data == TC_TM_BUFFER_SUCC)
                                            {
                                                send_itc_test_case_resp(COMMS_UHF_STRESS_TEST_SIMU,TEST_TASK,OBC_HM_TEST_CASE_RSP,test_layer_rcv_ipc_msg.pld.pld_data,OBC_MAIN);
                                            }
                                        }
                                        break;


                                    case ERROR_HANDLER_STRESS_TEST_SIMU:
                                        {
                                            /*If delete response is success*/
                                            if(test_layer_rcv_ipc_msg.pld.pld_data == TC_TM_BUFFER_SUCC)
                                            {
                                                send_itc_test_case_resp(ERROR_HANDLER_STRESS_TEST_SIMU,TEST_TASK,OBC_HM_TEST_CASE_RSP,test_layer_rcv_ipc_msg.pld.pld_data,OBC_MAIN);
                                            }
                                        }
                                        break;
                                    case MAX_TM_DOWNLOAD_CHECK_62K:
                                        {
                                            /*If delete response is success*/
                                            if(test_layer_rcv_ipc_msg.pld.pld_data == TC_TM_BUFFER_SUCC)
                                            {
                                                send_itc_test_case_resp(MAX_TM_DOWNLOAD_CHECK_62K,TEST_TASK,OBC_HM_TEST_CASE_RSP,test_layer_rcv_ipc_msg.pld.pld_data,OBC_MAIN);
                                            }
                                        }
                                        break;

                                    case DL_REQ_FAIL_VAL_MOD_QUEUE_INACTIVE:
                                    {
                                        /*If delete response is success*/
                                        if(test_layer_rcv_ipc_msg.pld.pld_data == TC_TM_BUFFER_SUCC)
                                        {
                                            send_itc_test_case_resp(DL_REQ_FAIL_VAL_MOD_QUEUE_INACTIVE,TEST_TASK,OBC_HM_TEST_CASE_RSP,TEST_CASE_SUCC,OBC_MAIN);
                                        }
                                    }
                                    break;

                                    case DL_REQ_SUCC_VAL_MOD_QUEUE_ACTIVE:
                                    {
                                        /*If delete response is success*/
                                        if(test_layer_rcv_ipc_msg.pld.pld_data == TC_TM_BUFFER_SUCC)
                                        {
                                            send_itc_test_case_resp(DL_REQ_SUCC_VAL_MOD_QUEUE_ACTIVE,TEST_TASK,OBC_HM_TEST_CASE_RSP,TEST_CASE_SUCC,OBC_MAIN);
                                        }

                                    }
                                    break;

                                }
                            }
                            break;


                        case OBC_TC_TM_CHNG_QUEUE_PRIORITY_RSP:
                            {
                                switch(hm_control_var.current_test_case_id)
                                {
                                    case CHNGE_QPRI_SUCC_INVAL_MOD_QUEUE_VAL_PRI:
                                        {
                                            if(test_layer_rcv_ipc_msg.pld.pld_data ==TC_TM_BUFFER_SUCC)
                                            {
                                                send_itc_test_case_resp(CHNGE_QPRI_SUCC_INVAL_MOD_QUEUE_VAL_PRI,TEST_TASK,OBC_HM_TEST_CASE_RSP,TEST_CASE_SUCC,OBC_MAIN);
                                            }
                                            else
                                            {
                                                send_itc_test_case_resp(CHNGE_QPRI_SUCC_INVAL_MOD_QUEUE_VAL_PRI,TEST_TASK,OBC_HM_TEST_CASE_RSP,TEST_CASE_FAIL,OBC_MAIN);
                                            }
                                        }
                                        break;
                                    case CHNGE_QPRI_FAIL_VAL_MOD_INVAL_QUEUE_PRI:
                                        {
                                            if(test_layer_rcv_ipc_msg.pld.pld_data == TC_TM_BUFFER_INVLD_PRIORITY)
                                            {
                                                /*Delete queue*/
                                                del_req.q_id=QUEUE_ID1;
                                                del_req.app_id=TEST_TASK;

                                                delete_req(del_req);

                                                del_req.q_id=QUEUE_ID0;
                                                delete_req(del_req);
                                            }
                                        }
                                        break;
                                    case CHNGE_QPRI_SUCC_VAL_MOD_INVALID_QUE:
                                        {
                                            if (test_layer_rcv_ipc_msg.pld.pld_data == TC_TM_BUFFER_SUCC)
                                            {
                                                /*Delete queue*/
                                                del_req.q_id=QUEUE_ID1;
                                                del_req.app_id=TEST_TASK;

                                                delete_req(del_req);

                                                del_req.q_id=QUEUE_ID0;
                                                delete_req(del_req);
                                            }
                                        }
                                        break;
                                    case CHNGE_QPRI_FAIL_VAL_MOD_QUEUE_INACTIVE:
                                        {
                                            if (test_layer_rcv_ipc_msg.pld.pld_data == TC_TM_BUFFER_QUEUE_NOT_ACTIVE)
                                            {
                                                del_req.q_id=QUEUE_ID0;
                                                del_req.app_id=TEST_TASK;

                                                delete_req(del_req);
                                            }
                                        }
                                        break;
                                    case CHNGE_QPRI_SUCC_VAL_MOD_QUEUE_ACTIVE:
                                        {

                                            if (test_layer_rcv_ipc_msg.pld.pld_data == TC_TM_BUFFER_SUCC)
                                            {
                                                /*Delete queue*/
                                                del_req.q_id=QUEUE_ID0;
                                                del_req.app_id=TEST_TASK;

                                                delete_req(del_req);
                                            }
                                        }
                                        break;

                                }
                            }
                            break;
                        case OBC_TC_TM_CHNG_SUB_MOD_PRIORITY_RSP:
                            {
                                switch(hm_control_var.current_test_case_id)
                                {
                                    case CHNGE_MOD_PRI_FAIL_INVAL_MOD:
                                        {
                                            if (test_layer_rcv_ipc_msg.pld.pld_data ==TC_TM_BUFFER_INVLD_MODULE)
                                            {
                                                send_itc_test_case_resp(CHNGE_MOD_PRI_FAIL_INVAL_MOD,TEST_TASK,OBC_HM_TEST_CASE_RSP,TEST_CASE_SUCC,OBC_MAIN);
                                            }
                                            else
                                            {
                                                send_itc_test_case_resp(CHNGE_MOD_PRI_FAIL_INVAL_MOD,TEST_TASK,OBC_HM_TEST_CASE_RSP,TEST_CASE_FAIL,OBC_MAIN);
                                            }

                                        }
                                        break;
                                    case CHNGE_MOD_PRI_FAIL_VAL_MOD_PRI:
                                        {
                                            if (test_layer_rcv_ipc_msg.pld.pld_data == TC_TM_BUFFER_INVLD_PRIORITY)
                                            {
                                                send_itc_test_case_resp(CHNGE_MOD_PRI_FAIL_VAL_MOD_PRI,TEST_TASK,OBC_HM_TEST_CASE_RSP,TEST_CASE_SUCC,OBC_MAIN);
                                            }
                                            else
                                            {
                                                send_itc_test_case_resp(CHNGE_MOD_PRI_FAIL_VAL_MOD_PRI,TEST_TASK,OBC_HM_TEST_CASE_RSP,TEST_CASE_FAIL,OBC_MAIN);
                                            }
                                        }
                                        break;
                                    case CHNGE_MOD_PRI_SUCC_VAL_MOD_PRI:
                                        {
                                            if (test_layer_rcv_ipc_msg.pld.pld_data == TC_TM_BUFFER_SUCC)
                                            {
                                                send_itc_test_case_resp(CHNGE_MOD_PRI_SUCC_VAL_MOD_PRI,TEST_TASK,OBC_HM_TEST_CASE_RSP,TEST_CASE_SUCC,OBC_MAIN);
                                            }
                                            else
                                            {
                                                send_itc_test_case_resp(CHNGE_MOD_PRI_SUCC_VAL_MOD_PRI,TEST_TASK,OBC_HM_TEST_CASE_RSP,TEST_CASE_FAIL,OBC_MAIN);
                                            }

                                        }
                                        break;
                                }

                            }
                            break;

                        default:
                            {
                                DEBUG_CPRINT(("\nInvalid test case in Test layer %d\n",test_layer_rcv_ipc_msg.Msg_id));
                            }
                            break;
                    }
                break;
                }
            default:
                {
                }
                break;
                
        }
        if(test_layer_rcv_ipc_msg.pld.pld_ptr && test_layer_rcv_ipc_msg.src_entity != TC_SRC_GS)
        {
            os_free(test_layer_rcv_ipc_msg.pld.pld_ptr);
        }
            
    }        
}
#endif

