[VOL-4615] Fixed DMI tests

Change-Id: Ie81360a3c90ac35ed7bdeea4a840100c92135a2e
diff --git a/libraries/dmi-basics.robot b/libraries/dmi-basics.robot
index 232af98..2f50c9c 100755
--- a/libraries/dmi-basics.robot
+++ b/libraries/dmi-basics.robot
@@ -26,10 +26,20 @@
     [Arguments]    ${lib_instance}
     ${name_active_olts}=    Create List
     ${response}=    Run Keyword   ${lib_instance}.Hw Management Service Get Managed Devices
-    ${size}=    Get Length  ${response}
-    Return From Keyword If   ${size} == ${0}   ${name_active_olts}
+    Log    ${response}
+    Check Dmi Status    ${response}    OK_STATUS
+    ${keys}=    Create List
+    ${keys}=    Get Dictionary Keys    ${response}
+    ${devices_key_found}=    Set Variable    False
+    ${length}=    Get Length    ${keys}
+    FOR    ${I}    IN RANGE    0    ${length}
+        ${value}=    Get From List    ${keys}    ${I}
+        ${devices_key_found}=    Set Variable If    '${value}'=='devices'    True    False
+        Exit For Loop If    ${devices_key_found}
+    END
+    Return From Keyword If    '${devices_key_found}'=='False'    ${name_active_olts}
     ${devices}=     Get From Dictionary     ${response}     devices
-    FOR     ${device}  IN  @{devices}
+    FOR    ${device}    IN    @{devices}
         ${name}=    Get From Dictionary    ${device}    name
         Append To List  ${name_active_olts}     ${name}
     END
@@ -90,5 +100,5 @@
 Check Dmi Status
     [Documentation]  check if the given state in the given result
     [Arguments]  ${result}  ${state}
-     ${state_in_result}=  Get From Dictionary  ${result}  status
+    ${state_in_result}=  Get From Dictionary  ${result}  status
     Should Be Equal  ${state}  ${state_in_result}
diff --git a/tests/data/dmi-components-bbsim.yaml b/tests/data/dmi-components-bbsim.yaml
index d43b0db..c5d42b9 100755
--- a/tests/data/dmi-components-bbsim.yaml
+++ b/tests/data/dmi-components-bbsim.yaml
@@ -15,6 +15,7 @@
 # limitations under the License.
 
 # Automated deployment configuration for systems running BBSim
+has_dataplane: false
 
 # connection parameter needed for device manager interface tests
 GIVEN_DM_IP: 127.0.0.1
diff --git a/tests/dmi-interface/dmi-hw-management.robot b/tests/dmi-interface/dmi-hw-management.robot
index 931c000..3196c49 100755
--- a/tests/dmi-interface/dmi-hw-management.robot
+++ b/tests/dmi-interface/dmi-hw-management.robot
@@ -32,6 +32,8 @@
 ${OLT_IP}         ${GIVEN_OLT_IP}
 ${OLT_NAME}    ${GIVEN_OLT_NAME}
 
+${has_dataplane}    True
+
 *** Test Cases ***
 Start and Stop Managing Device In Device Manager
     [Documentation]     add/remove device in device manager (testcase is done by Suite Setup and Suite Teardown)
@@ -69,8 +71,8 @@
         ${res_component}=  Get From Dictionary  ${hwComInfoRes}  component
         ${value_name}=  Get From Dictionary  ${res_component}  name
         Should be Equal  ${value_name}  ${component_name}
-        Set Component Inventory Info Unimplemented  ${suite_device_uuid}  ${component_uuid}  ${component_name}
-        ...    new-value
+        Run Keyword If    '${has_dataplane}'=='False'    Set Component Inventory Info Unimplemented
+        ...    ${suite_device_uuid}    ${component_uuid}    ${component_name}    new-value
     END
 
 Get Loggable Entities
@@ -96,6 +98,7 @@
     Should Be Equal  ${get_protocol}  ${defined_protocol}
     # remove logging endpoint
     ${defined_endpoint}=  Set Variable
+    ${defined_protocol}=  Set Variable
     Set Log Endpoint  dmi1  ${suite_device_uuid}  ${defined_endpoint}  ${defined_protocol}
 
 Set Get LogLevel