Adding kind cluster registration test
[integration/csit.git] / tests / so / integration-cnfm-testing / cnf_kind_cluster_registration_tests.robot
1 *** Settings ***
2 Library     Collections
3 Library     RequestsLibrary
4 Library     OperatingSystem
5
6 *** Variables ***
7 ${CNFM_LCM_BASE_URL}=         /so/so-cnfm/v1/api/kube-config
8 ${CLOUD_OWNER_VALUE}=         CloudOwner
9 ${CLOUD_REGION_VALUE}=        EtsiCloudRegion
10 ${TENANT_ID_VALUE}=           693c7729b2364a26a3ca602e6f66187d
11 ${UPLOAD_KUBE_CONFIG_URL}=    ${CNFM_LCM_BASE_URL}/cloudOwner/${CLOUD_OWNER_VALUE}/cloudRegion/${CLOUD_REGION_VALUE}/tenantId/${TENANT_ID_VALUE}/upload
12
13 *** Test Cases ***
14
15 Register kind Cluster with CNFM
16     Create Session   cnfm_lcm_session  http://${REPO_IP}:9888
17     Run Keyword If    "${KIND_CLUSTER_KUBE_CONFIG_FILE}"!="${EMPTY}"   Log to Console    \nKIND_CLUSTER_KUBE_CONFIG_FILE :${KIND_CLUSTER_KUBE_CONFIG_FILE}
18     ...    ELSE    Fail    \nInvalid Kube-config path :${KIND_CLUSTER_KUBE_CONFIG_FILE} received
19
20     ${file}=  Get File For Streaming Upload  ${KIND_CLUSTER_KUBE_CONFIG_FILE}
21     ${files}=   Create Dictionary  file    ${file}
22     ${resp}=    Put On Session    cnfm_lcm_session    ${UPLOAD_KUBE_CONFIG_URL}     files=${files}
23     Should Be Equal As Strings    '${resp.status_code}'    '202'