Proper selection of variables has to be done according to each release.
There are specific directories containing different variables per release.
Some other minor fixes to reflect changes in the model have been included.
Change-Id: Ie2813a7ea2ebda720364c21789820f9ecd5c5ee0
Signed-off-by: Miguel Angel Munoz Gonzalez <miguel.angel.munoz.gonzalez@ericsson.com>
*** Settings ***
Documentation Test suite for SFC Service Function Chains, Operates Chains from Restconf APIs.
-Suite Setup Create Session session http://${ODL_SYSTEM_IP}:${RESTCONFPORT} auth=${AUTH} headers=${HEADERS}
+Suite Setup Init Suite
Suite Teardown Delete All Sessions
Library SSHLibrary
Library Collections
Variables ../../../variables/Variables.py
Resource ../../../libraries/Utils.robot
-*** Variables ***
-${SERVICE_CHAINS_URI} /restconf/config/service-function-chain:service-function-chains/
-${SERVICE_CHAINS_FILE} ../../../variables/sfc/service-function-chains.json
-${SERVICE_CHAIN100_URI} /restconf/config/service-function-chain:service-function-chains/service-function-chain/SFC100
-${SERVICE_CHAIN100_FILE} ../../../variables/sfc/sfc_chain_100.json
-${SERVICE_CHAIN100_SFIDS_URI} /restconf/config/service-function-chain:service-function-chains/service-function-chain/SFC100/sfc-service-function/ids-abstract100
-${SERVICE_CHAIN100_SFIDS_FILE} ../../../variables/sfc/sfc_chain_100_sfids.json
-
*** Test Cases ***
Put Service Function Chains
[Documentation] Add Service Function Chains from JSON file
[Documentation] Get one Service Function From Chain
Remove All Elements At URI ${SERVICE_CHAINS_URI}
Add Elements To URI From File ${SERVICE_CHAINS_URI} ${SERVICE_CHAINS_FILE}
- ${elements}= Create List dpi-abstract1 "order":0 service-function-type:dpi
+ ${elements}= Create List dpi-abstract1 "order":0 "type":"dpi"
Check For Elements At URI ${SERVICE_CHAINS_URI}service-function-chain/SFC1/sfc-service-function/dpi-abstract1 ${elements}
Get A Non-existing Service Function From Chain
Remove All Elements At URI ${SERVICE_CHAINS_URI}
Add Elements To URI From File ${SERVICE_CHAINS_URI} ${SERVICE_CHAINS_FILE}
Add Elements To URI From File ${SERVICE_CHAIN100_SFIDS_URI} ${SERVICE_CHAIN100_SFIDS_FILE}
- ${elements}= Create List ids-abstract100 "order":3 service-function-type:ids
+ ${elements}= Create List ids-abstract100 "order":3 "type":"ids"
Check For Elements At URI ${SERVICE_CHAIN100_SFIDS_URI} ${elements}
Check For Elements At URI ${SERVICE_CHAIN100_URI} ${elements}
Check For Elements At URI ${SERVICE_CHAINS_URI} ${elements}
Clean All Service Function Chains After Tests
[Documentation] Delete all Service Function Chains From Datastore After Tests
Remove All Elements At URI ${SERVICE_CHAINS_URI}
+
+*** keywords ***
+Init Suite
+ [Documentation] Initialize session and ODL version specific variables
+ Create Session session http://${ODL_SYSTEM_IP}:${RESTCONFPORT} auth=${AUTH} headers=${HEADERS}
+ log ${ODL_STREAM}
+ Run Keyword If '${ODL_STREAM}' == 'stable-lithium' Set Suite Variable ${VERSION_DIR} lithium
+ ... ELSE Set Suite Variable ${VERSION_DIR} master
+ Set Suite Variable ${SERVICE_CHAINS_URI} /restconf/config/service-function-chain:service-function-chains/
+ Set Suite Variable ${SERVICE_CHAINS_FILE} ${CURDIR}/../../../variables/sfc/${VERSION_DIR}/service-function-chains.json
+ Set Suite Variable ${SERVICE_CHAIN100_URI} /restconf/config/service-function-chain:service-function-chains/service-function-chain/SFC100
+ Set Suite Variable ${SERVICE_CHAIN100_FILE} ${CURDIR}/../../../variables/sfc/${VERSION_DIR}/sfc_chain_100.json
+ Set Suite Variable ${SERVICE_CHAIN100_SFIDS_URI} /restconf/config/service-function-chain:service-function-chains/service-function-chain/SFC100/sfc-service-function/ids-abstract100
+ Set Suite Variable ${SERVICE_CHAIN100_SFIDS_FILE} ${CURDIR}/../../../variables/sfc/${VERSION_DIR}/sfc_chain_100_sfids.json
+
+
*** Settings ***
Documentation Test suite for SFC Function Schedule Algorithm Types, Operates types from Restconf APIs.
-Suite Setup Create Session session http://${ODL_SYSTEM_IP}:${RESTCONFPORT} auth=${AUTH} headers=${HEADERS}
+Suite Setup Init Suite
Suite Teardown Delete All Sessions
Library SSHLibrary
Library Collections
Variables ../../../variables/Variables.py
Resource ../../../libraries/Utils.robot
-*** Variables ***
-${SERVICE_SCHED_TYPES_URI} /restconf/config/service-function-scheduler-type:service-function-scheduler-types/
-${SERVICE_SCHED_TYPES_FILE} ../../../variables/sfc/service-schedule-types.json
-${SERVICE_WSP_SCHED_TYPE_URI} /restconf/config/service-function-scheduler-type:service-function-scheduler-types/service-function-scheduler-type/service-function-scheduler-type:weighted-shortest-path
-${SERVICE_WSP_SCHED_TYPE_FILE} ../../../variables/sfc/service-wsp-schedule-type.json
-
*** Test Cases ***
Add Service Function Schedule Algorithm Types
[Documentation] Add Service Function Schedule Algorithm Types from JSON file
Clean Datastore After Tests
[Documentation] Delete All Service Function Schedule Algorithm Types From Datastore After Tests
Remove All Elements At URI ${SERVICE_SCHED_TYPES_URI}
+
+
+
+*** keywords ***
+Init Suite
+ [Documentation] Initialize session and ODL version specific variables
+ Create Session session http://${ODL_SYSTEM_IP}:${RESTCONFPORT} auth=${AUTH} headers=${HEADERS}
+ log ${ODL_STREAM}
+ Run Keyword If '${ODL_STREAM}' == 'stable-lithium' Set Suite Variable ${VERSION_DIR} lithium
+ ... ELSE Set Suite Variable ${VERSION_DIR} master
+ Set Suite Variable ${SERVICE_SCHED_TYPES_URI} /restconf/config/service-function-scheduler-type:service-function-scheduler-types/
+ Set Suite Variable ${SERVICE_SCHED_TYPES_FILE} ${CURDIR}/../../../variables/sfc/${VERSION_DIR}/service-schedule-types.json
+ Set Suite Variable ${SERVICE_WSP_SCHED_TYPE_URI} /restconf/config/service-function-scheduler-type:service-function-scheduler-types/service-function-scheduler-type/service-function-scheduler-type:weighted-shortest-path
+ Set Suite Variable ${SERVICE_WSP_SCHED_TYPE_FILE} ${CURDIR}/../../../variables/sfc/${VERSION_DIR}/service-wsp-schedule-type.json
+
+
*** Settings ***
Documentation Test suite for SFC Service Function Paths, Operates paths from Restconf APIs.
-Suite Setup Create Session session http://${ODL_SYSTEM_IP}:${RESTCONFPORT} auth=${AUTH} headers=${HEADERS}
+Suite Setup Init Suite
Suite Teardown Delete All Sessions
Library SSHLibrary
Library Collections
Variables ../../../variables/Variables.py
Resource ../../../libraries/Utils.robot
-*** Variables ***
-${SERVICE_FUNCTION_PATHS_URI} /restconf/config/service-function-path:service-function-paths/
-${SERVICE_FUNCTION_PATHS_FILE} ../../../variables/sfc/service-function-paths.json
-${SERVICE_FUNCTION_PATH400_URI} /restconf/config/service-function-path:service-function-paths/service-function-path/SFC1-400
-${SERVICE_FUNCTION_PATH400_FILE} ../../../variables/sfc/sfp_sfc1_path400.json
-
*** Test Cases ***
Add Service Function Paths
[Documentation] Add Service Function Paths from JSON file
Clean All Service Function Paths After Tests
[Documentation] Delete all Service Function Paths From Datastore After Tests
Remove All Elements At URI ${SERVICE_FUNCTION_PATHS_URI}
+
+*** keywords ***
+Init Suite
+ [Documentation] Initialize session and ODL version specific variables
+ Create Session session http://${ODL_SYSTEM_IP}:${RESTCONFPORT} auth=${AUTH} headers=${HEADERS}
+ log ${ODL_STREAM}
+ Run Keyword If '${ODL_STREAM}' == 'stable-lithium' Set Suite Variable ${VERSION_DIR} lithium
+ ... ELSE Set Suite Variable ${VERSION_DIR} master
+ Set Suite Variable ${SERVICE_FUNCTION_PATHS_URI} /restconf/config/service-function-path:service-function-paths/
+ Set Suite Variable ${SERVICE_FUNCTION_PATHS_FILE} ${CURDIR}/../../../variables/sfc/${VERSION_DIR}/service-function-paths.json
+ Set Suite Variable ${SERVICE_FUNCTION_PATH400_URI} /restconf/config/service-function-path:service-function-paths/service-function-path/SFC1-400
+ Set Suite Variable ${SERVICE_FUNCTION_PATH400_FILE} ${CURDIR}/../../../variables/sfc/${VERSION_DIR}/sfp_sfc1_path400.json
+
+