Changes in ipmi/test_ipmi_fru_device.robot

Added Following Test Case

	- Read Fru Device configuration
	- Verify Get FRU Inventory Area Info
	- Verify Get FRU Inventory Area Info For Invalid Device Data
	- Verify Get FRU Inventory Area Info For Invalid Data Request
	- Verify IPMI Write FRU Data
	- Verify IPMI Write FRU Data With BMC Reboot

Functions required are defined under lib/bmc_dbus.robot, lib/ipmi_client.robot and lib/utils.py

Request data for fru data present in data/ipmi_raw_cmd_table.py.

Read Fru Device configuration - Validates each ipmi fru device data with corresponding dbus data.

Verify Get FRU Inventory Area Info - Validates fru inventory byte size with ipmi read fru count returned.

Verify Get FRU Inventory Area Info For Invalid Device Data - Validates the response of inventory fru area info command with invalid device id.

Verify Get FRU Inventory Area Info For Invalid Data Request - Validates the response of inventory fru area info command with invalid request data by giving extra bytes.

Verify IPMI Write FRU Data - Verify write fru data with the response returned with read fru data after data is written.

Verify IPMI Write FRU Data With BMC Reboot -  Verify the response of read fru data after the bmc is rebooted once the data is written to the fru device.

Signed-off-by: ganesanb <ganesanb@ami.com>
Change-Id: I2ea51ad51512ecbcc4036e2d2593cafaa40a2d3c
diff --git a/lib/utils.py b/lib/utils.py
index 40bcf83..901c6e0 100644
--- a/lib/utils.py
+++ b/lib/utils.py
@@ -452,3 +452,22 @@
     """
 
     return data.zfill(int(num))
+
+
+def get_subsequent_value_from_list(list, value):
+    r"""
+    returns first index of the element occurrence.
+    """
+
+    index = [list.index(i) for i in list if value in i]
+    return index
+
+
+def return_decoded_string(input):
+    r"""
+    returns decoded string of encoded byte.
+    """
+
+    encoded_string = input.encode('ascii', 'ignore')
+    decoded_string = encoded_string.decode()
+    return decoded_string