blob: 2ba640071458a6d05ff9e202cda14a5ce0f5cca6 [file] [log] [blame]
tragait42a41b32019-07-10 12:51:38 +00001*** Settings ***
2Library Collections
3Library RequestsLibrary
4Library OperatingSystem
5Library json
6Library String
7
8*** Variables ***
9${SDNC_KEYSTORE_CONFIG_PATH} /config/netconf-keystore:keystore
tragaitcd8b66c2020-02-05 17:02:20 +000010${SDNC_MOUNT_PATH} /config/network-topology:network-topology/topology/topology-netconf/node/pnf-simulator
11${PNFSIM_MOUNT_PATH} /config/network-topology:network-topology/topology/topology-netconf/node/pnf-simulator/yang-ext:mount/mynetconf:netconflist
tragait42a41b32019-07-10 12:51:38 +000012${BP_UPLOAD_URL} /api/v1/execution-service/upload
13${BP_PROCESS_URL} /api/v1/execution-service/process
14${BP_ARCHIVE_PATH} ${CURDIR}/data/blueprint_archive.zip
15
16
17 *** Test Cases ***
18 Test SDNC Keystore
19 [Documentation] Checking keystore after SDNC installation
20 Create Session sdnc http://localhost:8282/restconf
21 &{headers}= Create Dictionary Authorization=Basic YWRtaW46S3A4Yko0U1hzek0wV1hsaGFrM2VIbGNzZTJnQXc4NHZhb0dHbUp2VXkyVQ== Content-Type=application/json Accept=application/json
22 ${resp}= Get Request sdnc ${SDNC_KEYSTORE_CONFIG_PATH} headers=${headers}
23 Should Be Equal As Strings ${resp.status_code} 200
24 ${keystoreContent}= Convert To String ${resp.content}
25 Log to console *************************
26 Log to console ${resp.content}
27 Log to console *************************
28
29 Test BP-PROC upload blueprint archive
30 [Documentation] Upload Blueprint archive to BP processor
31 Create Session blueprint http://localhost:8000
32 ${bp_archive}= Get Binary File ${BP_ARCHIVE_PATH}
33 &{bp_file}= create Dictionary file ${bp_archive}
34 &{headers}= Create Dictionary Authorization=Basic Y2NzZGthcHBzOmNjc2RrYXBwcw==
35 ${resp}= Post Request blueprint ${BP_UPLOAD_URL} files=${bp_file} headers=${headers}
36 Should Be Equal As Strings ${resp.status_code} 200
37
38 Test BP-PROC CONFIG-ASSIGN
39 [Documentation] Send config-assign request to BP-Proc
40 Create Session blueprint http://localhost:8000
41 ${config-assign}= Get File ${CURDIR}${/}data${/}config-assign.json
42 Log to console ${config-assign}
43 &{headers}= Create Dictionary Authorization=Basic Y2NzZGthcHBzOmNjc2RrYXBwcw== Content-Type=application/json Accept=application/json
44 ${resp}= Post Request blueprint ${BP_PROCESS_URL} data=${config-assign} headers=${headers}
45 Should Be Equal As Strings ${resp.status_code} 200
46
47 Test BP-PROC CONFIG-DEPLOY
48 [Documentation] Send config-deploy request to BP-Proc
49 Create Session blueprint http://localhost:8000
50 ${config-deploy}= Get File ${CURDIR}${/}data${/}config-deploy.json
51 Log to console ${config-deploy}
52 &{headers}= Create Dictionary Authorization=Basic Y2NzZGthcHBzOmNjc2RrYXBwcw== Content-Type=application/json Accept=application/json
53 ${resp}= Post Request blueprint ${BP_PROCESS_URL} data=${config-deploy} headers=${headers}
54 Should Be Equal As Strings ${resp.status_code} 200
55
56 Test PNF Configuration update
57 [Documentation] Checking PNF configuration params
58 Create Session sdnc http://localhost:8282/restconf
59 ${mount}= Get File ${CURDIR}${/}data${/}mount.xml
60 Log to console ${mount}
61 &{headers}= Create Dictionary Authorization=Basic YWRtaW46S3A4Yko0U1hzek0wV1hsaGFrM2VIbGNzZTJnQXc4NHZhb0dHbUp2VXkyVQ== Content-Type=application/xml Accept=application/xml
62 ${resp}= Put Request sdnc ${SDNC_MOUNT_PATH} data=${mount} headers=${headers}
63 Should Be Equal As Strings ${resp.status_code} 201
64 Sleep 10
65 &{headers1}= Create Dictionary Authorization=Basic YWRtaW46S3A4Yko0U1hzek0wV1hsaGFrM2VIbGNzZTJnQXc4NHZhb0dHbUp2VXkyVQ== Content-Type=application/json Accept=application/json
66 ${resp1}= Get Request sdnc ${PNFSIM_MOUNT_PATH} headers=${headers1}
67 Should Be Equal As Strings ${resp1.status_code} 200
68 Log to console ${resp1.content}
69 Should Contain ${resp1.text} {"netconf-id":30,"netconf-param":3000}