Created New script for IPMI Set/Get SEL Time

Pre-requisite Condition : Client Machine and BMC should be in Same TimeZone (example : UST).
Mismatch of Timezones result in miscalculation of SEL Time due to different Timezone in Client Machine.

IPMI Raw command variables are defined under ../data/ipmi_raw_cmd_table.py
Python basic functionalities are defined under lib/ipmi_client.robot, lib/ipmi_utils.py and lib/utils.py files.

Test the Set/Get SEL Time functionality and compare the result against BMC Native command (date).

Set the Time Sync Mode from NTP to Manual to Set SEL Time.
Time Sync Mode change performed via REDFISH URI.
Performs the change in Time Sync Mode with Test Setup and Teardown Execution with default NETWORK_TIMEOUT provided under ../lib/resource.robot

NETWORK_RESTART_TIME added for Set SEL Time and Add SEL Entry as the corresponding command takes approx 5 seconds for the operation to reflect.

Current SEL time identified via BMC Native command (date) and perform SEL Time operations.

Script Verifies SEL Time for various scenarios such as,
    - Get current time from BMC and add future year and compare against BMC native command (date),
    - Gets BMC Current Time and Adds 15 minutes and compare against BMC native command (date),
    - Gets BMC Current Time and subtracts 1 day and compare against BMC native command (date),
    - Add SEL Entry for all the above scenarios and compare against BMC native command (date).

Tested: Run robot ipmi/test_ipmi_sel_time.robot

Signed-off-by: chithrag <chithrag@ami.com>
Change-Id: Ied129b96e38351d59780326c71f875dc50ce33f5
diff --git a/lib/utils.py b/lib/utils.py
index 20dbef1..40bcf83 100644
--- a/lib/utils.py
+++ b/lib/utils.py
@@ -411,3 +411,44 @@
 
     stdout, stderr, rc = bsu.bmc_execute_command(option_string, **bsu_options)
     return stdout
+
+
+def split_string_with_index(stri, n):
+    r"""
+    To split every n characters and forms an element for every nth index
+
+    Example : Given ${stri} = "abcdef", then the function call,
+    ${data}=  Split List With Index  ${stri}  2
+    then, result will be data = ['ab', 'cd', 'ef']
+    """
+
+    n = int(n)
+    data = [stri[index: index + n] for index in range(0, len(stri), n)]
+    return data
+
+
+def remove_whitespace(instring):
+    r"""
+    Removes the white spaces around the string
+
+    Example: instring = "  xxx  ", then returns instring = "xxx"
+    """
+
+    return instring.strip()
+
+
+def zfill_data(data, num):
+    r"""
+    zfill() method adds zeros (0) at the beginning of the string, until it reaches the specified length.
+
+    Usage : ${anystr}=  Zfill Data  ${data}  num
+
+    Example : Binary of one Byte has 8 bits - xxxx xxxx
+
+    Consider ${binary} has only 3 bits after converting from Hexadecimal/decimal to Binary
+    Say ${binary} = 110 then,
+    ${binary}=  Zfill Data  ${binary}  8
+    Now ${binary} will be 0000 0110
+    """
+
+    return data.zfill(int(num))