*** Settings *** Resource ${CURDIR}${/}..${/}..${/}..${/}..${/}resources/import.resource Suite Setup Start Mockoon ${MOCKOON_JSON} Suite Teardown Stop Mockoon Test Timeout 120s Test Setup Ctn Cleanup Cache *** Variables *** ${MOCKOON_JSON} ${CURDIR}${/}mockoon.json ${CMD} ${CENTREON_PLUGINS} --plugin=apps::vmware::vsphere8::vcenter::plugin ... --mode=list-datastores ... --password=C3POR2P2 ... --username=obi-wan ... --hostname=127.0.0.1 ... --proto=http ... --port=3000 *** Test Cases *** List-Datastores [Tags] apps api vmware vsphere8 vcenter ${command_curl} Catenate ${CMD} --http-backend=curl --disco-show # # # ${root}= Ctn Run Command And Return Parsed XML ${command_curl} ${nb_ds}= Get Element Count ${root} label # First check: are there 8 datastores as expected Should Be Equal As Integers ${nb_ds} 8 Number of datastores do not match # Get the list of datastore IDs @{elem_list}= Get Elements ${root} label @{found_ds}= Create List FOR ${item} IN @{elemList} ${ds_id}= Get Element Attribute ${item} datastore Append To List ${found_ds} ${ds_id} END # Here is what is expected @{expected_ds}= Create List datastore-14 datastore-25 datastore-31 datastore-38 datastore-39 datastore-40 datastore-45 datastore-46 # Compare obtained list with expected list Lists Should Be Equal ${found_ds} ${expected_ds}