Modified Hardcoded channel Number as 1 to dynamic.

While Getting user info using "Get User Info" keyword by default
it will return channel numebr 1 user. we have to mention the channel
number to get the particular channel user info. So for Get User Info
keyword added ${CHANNEL_NUMBER} variable as argument.

And also while getting channel access we are hardcoding the channel
number as 1, there are removed 1 and added ${CHANNEL_NUMBER}.

Tested: Run robot ipmi/test_ipmi_user.robot
        Run robot ipmi/test_ipmi_payload.robot
        Run robot redfish/account_service/test_ipmi_redfish_user.robot

Change-Id: Id81b59e7880045b74e65195089e38d8653f66d7a
Signed-off-by: Nagarjun B  <nagarjunb@ami.com>
diff --git a/data/ipmi_raw_cmd_table.py b/data/ipmi_raw_cmd_table.py
index 4df9872..7f713b3 100644
--- a/data/ipmi_raw_cmd_table.py
+++ b/data/ipmi_raw_cmd_table.py
@@ -6,7 +6,6 @@
    - Define IPMI interface index, commands and expected output.
 
 """
-
 # The currently supported cipher list.
 # Refer:
 # openbmc/meta-openbmc-machines/meta-openpower/meta-ibm/meta-witherspoon/recipe
@@ -219,15 +218,15 @@
     "lan_parameters": {
         "get_ip": [
             # raw command
-            "0x0c 0x02 0x01 0x03 0 0"
+            "0x0c 0x02 0x01 0x03 0 0",
         ],
         "get_ip_src": [
             # raw command
-            "0x0c 0x02 0x01 0x04 0 0"
+            "0x0c 0x02 0x01 0x04 0 0",
         ],
         "get_dot1q": [
             # raw command
-            "0x0c 0x02 0x01 0x14 0 0"
+            "0x0c 0x02 0x01 0x14 0 0",
         ],
     },
     "SDR_Info": {
diff --git a/ipmi/test_ipmi_payload.robot b/ipmi/test_ipmi_payload.robot
index 6c93567..18b5e6c 100644
--- a/ipmi/test_ipmi_payload.robot
+++ b/ipmi/test_ipmi_payload.robot
@@ -417,7 +417,7 @@
     [Documentation]  Get random invalid user ID using "channel getaccess" IPMI standard command.
 
     # Python module:  get_user_info(userid, channel_number=1)
-    ${user_info}=  Get User Info  ${EMPTY}
+    ${user_info}=  Get User Info  ${EMPTY}  ${CHANNEL_NUMBER}
     ${user_info}=  Filter Struct  ${user_info}  [('user_name', None)]  invert=1
     ${empty_user_info}=  Filter Struct  ${user_info}  [('user_name', '')]
     @{invalid_userid_list}=  Create List
diff --git a/ipmi/test_ipmi_user.robot b/ipmi/test_ipmi_user.robot
index 5d6a593..9b020c8 100644
--- a/ipmi/test_ipmi_user.robot
+++ b/ipmi/test_ipmi_user.robot
@@ -245,7 +245,7 @@
     Set Test Variable  ${random_userid}
     # Delete IPMI User and verify
     Run IPMI Standard Command  user set name ${random_userid} ""
-    ${user_info}=  Get User Info  ${random_userid}
+    ${user_info}=  Get User Info  ${random_userid}  ${CHANNEL_NUMBER}
     Should Be Equal  ${user_info['user_name']}  ${EMPTY}
 
 
@@ -336,7 +336,7 @@
 
     # Disable IPMI user and verify.
     Run IPMI Standard Command  user disable ${random_userid}
-    ${user_info}=  Get User Info  ${random_userid}
+    ${user_info}=  Get User Info  ${random_userid}  ${CHANNEL_NUMBER}
     Should Be Equal  ${user_info['enable_status']}  disabled
 
     # Verify that disabled IPMI  user is unable to run IPMI command.
@@ -756,7 +756,7 @@
     Check Enabled User Count
     FOR    ${num}    IN RANGE    300
         ${random_userid}=  Evaluate  random.randint(1, ${expected_max_ids})  modules=random
-        ${access}=  Run IPMI Standard Command  channel getaccess 1 ${random_userid}
+        ${access}=  Run IPMI Standard Command  channel getaccess ${CHANNEL_NUMBER} ${random_userid}
 
         ${name_line}=  Get Lines Containing String  ${access}  User Name
         Log To Console  For ID ${random_userid}: ${name_line}
diff --git a/lib/ipmi_client.robot b/lib/ipmi_client.robot
index 136aa3d..285c330 100755
--- a/lib/ipmi_client.robot
+++ b/lib/ipmi_client.robot
@@ -410,7 +410,7 @@
 
     ${ipmi_cmd}=  Catenate  user set name ${userid} ${username}
     ${resp}=  Run IPMI Standard Command  ${ipmi_cmd}
-    ${user_info}=  Get User Info  ${userid}
+    ${user_info}=  Get User Info  ${userid}  ${CHANNEL_NUMBER}
     Should Be Equal  ${user_info['user_name']}  ${username}
 
 
@@ -422,7 +422,7 @@
     # userid   A numeric userid (e.g. "4").
 
     Run IPMI Standard Command  user enable ${userid}
-    ${user_info}=  Get User Info  ${userid}
+    ${user_info}=  Get User Info  ${userid}  ${CHANNEL_NUMBER}
     Valid Value  user_info['enable_status']  ['enabled']
 
 
@@ -466,7 +466,7 @@
     [Documentation]  Delete all non-root IPMI user.
 
     # Get complete list of user info records.
-    ${user_info}=  Get User Info  ${EMPTY}
+    ${user_info}=  Get User Info  ${EMPTY}  ${CHANNEL_NUMBER}
     # Remove header record.
     ${user_info}=  Filter Struct  ${user_info}  [('user_name', None)]  invert=1
     ${non_empty_user_info}=  Filter Struct  ${user_info}  [('user_name', '')]  invert=1
@@ -641,4 +641,4 @@
     # ${hex1} will contains the data to write for fru in list.
     # ${hex2} will contains the data to verify fru after write operation completed.
 
-    [Return]  ${hex1}  ${hex2}
\ No newline at end of file
+    [Return]  ${hex1}  ${hex2}
diff --git a/redfish/account_service/test_ipmi_redfish_user.robot b/redfish/account_service/test_ipmi_redfish_user.robot
index a7b06d5..ff11564 100644
--- a/redfish/account_service/test_ipmi_redfish_user.robot
+++ b/redfish/account_service/test_ipmi_redfish_user.robot
@@ -329,7 +329,7 @@
     FOR    ${jj}    IN RANGE    300
         # IPMI maximum users count (i.e. 15 users).
         ${random_userid}=  Evaluate  random.randint(1, ${ipmi_max_num_users})  modules=random
-        ${access}=  Run IPMI Standard Command  channel getaccess 1 ${random_userid}
+        ${access}=  Run IPMI Standard Command  channel getaccess ${CHANNEL_NUMBER} ${random_userid}
 
         ${name_line}=  Get Lines Containing String  ${access}  User Name
         Log To Console  For ID ${random_userid}: ${name_line}