Hot Plug Guide

Following are the steps to access Hot Plug:
  1. Login to EBF-TAS homepage/dashboard (find the URL from the administrator) through a web browser with your credentials.
    Username : <username>
    Password : <password>
  2. This would open the EBF-TAS home page. Select the ‘All Devices’ option from the ‘Devices’ drop-down list.
  3. The hostname(here rpi-demo is taken as reference) is selected from the ‘All Devices’ list.
  4. Click on the Assign button of the selected device (here rpi-demo is taken as reference) to allocate the device to the user.
  5. Select Launch console tag adjacent to action tag to Launch Console page.
  6. The following window will appear on the screen if the IO-CX board is connected.

    NOTE: If the IO-CX board is not connected, then the following screen appears on the screen and the user cannot access Hot-plug functionality.
  7. There are four Hot plugs available on the console namely Hot Plug 1, Hot Plug 2, Hot Plug 3, Hot Plug 4. All the Hot plugs are enabled as shown below:
  8. Select the Hot Plug button to toggle the state of Hotplug i.e. Hot-plug turns off

Example Setup for USB hotplugging

For testing USB hotplugging you require certain hardware and software installed in your BSP.

Hardware Requirements

  1. One USB drive.
  2. One Male to Male USB cable.

Software Requirements

  1. lsusb command in BSP.
  2. curl or wget tool installed in BSP.

Hardware connections.

  1. Needs to find out device ID of USB drive you are going to use for hotplug testing(use the lsusb command for finding device ID).
  2. Connect a USB drive to any side of USB hotplug port.
  3. Connect a USB Male-To-Male cable between another side of USB hotplug and USB port of DUT.
After successfully completing the hardware setup use the following steps to test hotplug.
  1. Create a User-defined-tests from EBF-TAS UI and paste the below sample script in it.
    If you don't know how to create a user-defined-tests please follow this Link
Sample USB Hotplg Testing script:
#!/bin/bash

EBF_TAS_IP=$1
BOARD_NAME=$2
HOTPLUG=$3
DEVICE_ID=$4

######## main() ###########
wget http://$EBF_TAS_IP/api/$BOARD_NAME/hotplug/$HOTPLUG/on/ > /dev/null 2>&1
lsusb|grep $DEVICE_ID
sleep 5
if [ $? -ne 0 ];then
echo "" 
echo "[FAIL] Couldn't ON the HotPlug port $HOTPLUG, please check the hardware connection and parameters" 
wget http://$EBF_TAS_IP/api/$BOARD_NAME/hotplug/$HOTPLUG/off/ > /dev/null 2>&1
exit
else
echo "" 
echo "*** Successfully ON the Hotplug physical port $HOTPLUG ***" 
fi

wget http://$EBF_TAS_IP/api/$BOARD_NAME/hotplug/$HOTPLUG/off/ > /dev/null 2>&1
lsusb|grep $DEVICE_ID
sleep 5
if [ $? -ne 0 ];then
echo "" 
echo "*** Successfully OFF the Hotplug port $HOTPLUG ***" 
else
echo "[FAIL] Couldn't off the HotPlug port $HOTPLUG" 
wget http://$EBF_TAS_IP/api/$BOARD_NAME/hotplug/$HOTPLUG/off/ > /dev/null 2>&1
exit
fi

wget http://$EBF_TAS_IP/api/$BOARD_NAME/hotplug/$HOTPLUG/on/ > /dev/null 2>&1
lsusb|grep $DEVICE_ID
sleep 5
if [ $? -ne 0 ];then
echo "" 
echo "[FAIL] Couldn't ON the HotPlug port $HOTPLUG" 
wget http://$EBF_TAS_IP/api/$BOARD_NAME/hotplug/$HOTPLUG/off/ > /dev/null 2>&1
exit
else
echo "*** [PASS] Successfully ON/OFF the Hotplug port $HOTPLUG ***" 
fi

wget http://$EBF_TAS_IP/api/$BOARD_NAME/hotplug/$HOTPLUG/off/ > /dev/null 2>&1

  1. This script requires four mandatory parameters listed below.
    a. EBF-TAS IP Address.
    b. Device name in EBF-TAS on which you want to test USB hotplug.
    c. Hotplug number of IO-CX box (1 or 2) on which USB device is connected.
    d. Device ID of USB drive you are going to use for hotplugging testing.

Example Setup for Ethernet hotplugging

For testing Ethernet hotplugging you require certain hardware and software installed in your BSP.

Hardware Requirements

  1. Two ethernet cables.
  2. Two ethernet port on the device you want to test.

Software Requirements

  1. ping command in BSP.
  2. curl or wget tool installed in BSP.

Hardware connections.

  1. Connect the first Ethernet cable between any ethernet port of Zombie private network and one of the ethernet hotplug port.
  2. Connect the second Ethernet cable between second ethernet port of DUT and the second ethernet port of IO-CX hotplug.
After successfully completing the hardware setup use the following steps to test hotplug.
  1. Create a User-defined-tests from EBF-TAS UI and paste the below sample script in it.
    If you don't know how to create a user-defined-tests please follow this link
Sample Ethernet Hotplug Testing script:
#!/bin/bash

EBF_TAS_IP=$1
BOARD_NAME=$2
HOTPLUG=$3
INTERFACE=$4

######## main() ###########
wget http://$EBF_TAS_IP/api/$BOARD_NAME/hotplug/$HOTPLUG/on/ > /dev/null 2>&1
sleep 20
ping -I $INTERFACE -c5 $EBF_TAS_IP
if [ $? -ne 0 ];then
echo "" 
echo "[FAIL] Couldn't ON the HotPlug port $HOTPLUG, please check the hardware connection and parameters" 
wget http://$EBF_TAS_IP/api/$BOARD_NAME/hotplug/$HOTPLUG/off/ > /dev/null 2>&1
exit 
else
echo "" 
echo "*** Successfully ON the Hotplug port $HOTPLUG ***" 
fi

h3. API Calls wget http://$EBF_TAS_IP/api/$BOARD_NAME/hotplug/$HOTPLUG/off/ > /dev/null 2>&1
sleep 5
ping -I $INTERFACE -c5 $EBF_TAS_IP
if [ $? -ne 0 ];then
echo "" 
echo "*** Successfully OFF the Hotplug port $HOTPLUG ***" 
else
echo "[FAIL] Couldn't off the HotPlug port $HOTPLUG" 
wget http://$EBF_TAS_IP/api/$BOARD_NAME/hotplug/$HOTPLUG/off/ > /dev/null 2>&1
exit
fi

wget http://$EBF_TAS_IP/api/$BOARD_NAME/hotplug/$HOTPLUG/on/ > /dev/null 2>&1
sleep 20
ping -I $INTERFACE -c5 $EBF_TAS_IP
if [ $? -ne 0 ];then
echo "" 
echo "[FAIL] Couldn't ON the HotPlug port $HOTPLUG" 
wget http://$EBF_TAS_IP/api/$BOARD_NAME/hotplug/$HOTPLUG/off/ > /dev/null 2>&1
exit
else
echo "*** [PASS] Successfully ON/OFF the Hotplug port $HOTPLUG ***" 
fi

wget http://$EBF_TAS_IP/api/$BOARD_NAME/hotplug/$HOTPLUG/off/ > /dev/null 2>&1

  1. This script requires four mandatory parameters listed below.
    a. EBF-TAS IP Address.
    b. Device name in EBF-TAS on which you want to test USB hotplug.
    c. Hotplug number of IO-CX box (3 or 4) on which ethernet cables are connected.
    d. Name of the second ethernet Interface which you are going to use for hotplugging testing.

API Calls

Refer Hotplugs API