Improved case 'Verify Get Channel Info via IPMI'

-The original way to verify this command was through the file
"/usr/share/ipmi-providers/channel_access.json".
However, this file may not exist for different projects.
Furthermore, the command "Set Channel Access" can changes the values but
it does not write to this file. Therefore, if the Channel Access setting
has changed and is different from this file, it will fail the test.

-The original way only validates attributes in 'volatile(active)_settings',
not 'Non-Volatile Settings'.

Signed-off-by: Tony Lee <tony.lee@quantatw.com>
Change-Id: I6dbf98e0fdffea98c39ca96708b71a93679e2579
diff --git a/lib/ipmi_utils.py b/lib/ipmi_utils.py
index d8c9be7..2a72fde 100644
--- a/lib/ipmi_utils.py
+++ b/lib/ipmi_utils.py
@@ -636,12 +636,12 @@
         [session_support]:                            multi-session
         [active_session_count]:                       0
         [protocol_vendor_id]:                         7154
-        [volatile(active)_settings]:
+      [volatile(active)_settings]:
         [alerting]:                                   enabled
         [per-message_auth]:                           enabled
         [user_level_auth]:                            enabled
         [access_mode]:                                always available
-        [non-volatile_settings]:
+      [non-volatile_settings]:
         [alerting]:                                   enabled
         [per-message_auth]:                           enabled
         [user_level_auth]:                            enabled
@@ -650,6 +650,10 @@
 
     status, ret_values = \
         grk.run_key_u("Run IPMI Standard Command  channel info " + str(channel_number))
-    result = vf.key_value_outbuf_to_dict(ret_values, process_indent=1)
-
+    key_var_list = list(filter(None, ret_values.split("\n")))
+    # To match the dict format, add a colon after 'Volatile(active) Settings' and 'Non-Volatile Settings'
+    # respectively.
+    key_var_list[6] = 'Volatile(active) Settings:'
+    key_var_list[11] = 'Non-Volatile Settings:'
+    result = vf.key_value_list_to_dict(key_var_list, process_indent=1)
     return result