The following are the steps to access Hot Plug:

1 Login to the EBF homepage/Dashboard through a web browser with credentials.

  • Username : <username>

  • Password : <password>

2 This would open the EBF home page. Select the ‘All Devices’ option from the ‘Devices’ drop-down list.

_images/devices_all_1.png

3 The hostname(here, rpi-demo is taken as reference) is selected from the ‘All Devices’ list.

_images/all_device_3.png

4 Click on the Assign button of the selected device (here, rpi-demo is taken as reference) to allocate the device to the user.

_images/all_device1.png

5 Select the Launch console tag adjacent to the action tag to Launch the Console page.

_images/ebf_launchselected_6.png

6 The following window will appear on the screen if the IO-CX board is connected.

_images/hotplug_2_update.png

NOTE: If the IO-CX board is not connected, then the following screen appears, and the user cannot access Hot-plug functionality.

_images/noiocx_2_update.png

7 There are four Hot plugs available on the console, namely Hot Plug 1, Hot Plug 2, Hot Plug 3, and Hot Plug 4. All the Hot plugs are disabled as shown below:

_images/hotplug_on_2_update.png

8 Select the Hot Plug button to toggle the state of Hotplug, i.e., Hot-plug turns on

_images/hotplug_off_2_update.png

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 the device ID of the USB drive you are going to use for hotplug testing(use the lsusb command for finding the device ID).

2 Connect a USB drive to any side of the USB hotplug port.

3 Connect a USB Male-To-Male cable between the other side of the USB hotplug and the USB port of the DUT.

After completing the hardware setup, use the following steps to test hotplug.

1 Create a User-defined-tests from EBF 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”: tas_user_guide.html

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.

  1. EBF IP Address.

  2. Device name in EBF on which you want to test USB hotplug.

  3. Hotplug the number of IO-CX boxes (1 or 2) on which the USB device is connected.

  4. Device ID of the 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 ports 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 the Zombie private network and one of the Ethernet hotplug ports.

2 Connect the second Ethernet cable between the second Ethernet port of the DUT and the second Ethernet port of the IO-CX hotplug.

After completing the hardware setup, use the following steps to test hotplug.

1 Create a User-defined-tests from EBF 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”: tas_user_guide.html

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

**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.

  1. EBF IP Address.

  2. Device name in EBF on which you want to test USB hotplug.

  3. Hotplug the number of IO-CX boxes (3 or 4) on which Ethernet cables are connected.

  4. Name of the second Ethernet interface that you are going to use for hotplugging testing.

API Calls

Refer Hotplugs API