# Extensions list to use (list value)
#extensions = multicloud
+
+
+[sdc]
+
+#
+# From conductor
+#
+
+
+# Data Store table prefix. (string value)
+#table_prefix = sdc
+
+# Base URL for SDC, up to and not including the version, and without a
+# trailing slash. (string value)
+#server_url = https://controller:8443/sdc
+server_url = http://localhost:9595/sdc
+
+# Timeout for SDC Rest Call (string value)
+#sdc_rest_timeout = 30
+
+# Number of retry for SDC Rest Call (string value)
+#sdc_retries = 3
+
+# The version of A&AI in v# format. (string value)
+server_url_version = v1
+
+# SSL/TLS certificate file in pem format. This certificate must be registered
+# with the SDC endpoint. (string value)
+#certificate_file = certificate.pem
+certificate_file =
+
+# Private Certificate Key file in pem format. (string value)
+#certificate_key_file = certificate_key.pem
+certificate_key_file =
+
+# Certificate Authority Bundle file in pem format. Must contain the appropriate
+# trust chain for the Certificate file. (string value)
+#certificate_authority_bundle_file = certificate_authority_bundle.pem
+certificate_authority_bundle_file = /usr/local/bin/AAF_RootCA.cer
+
+# Username for SDC. (string value)
+#username =
+
+# Password for SDC. (string value)
+#password =
+
+temp_path = "/tmp/nsttemplates"
+
COND_CONF=/tmp/conductor/properties/conductor.conf
LOG_CONF=/tmp/conductor/properties/log.conf
IMAGE_NAME=nexus3.onap.org:10001/onap/optf-has
-IMAGE_VER=2.1.2-SNAPSHOT-latest
+IMAGE_VER=2.1.3-SNAPSHOT-latest
BUNDLE=/tmp/conductor/properties/AAF_RootCA.cer
mkdir -p /tmp/conductor/properties
# change AAI reference to the local instance
sed -i -e "s%localhost:8081/%${AAISIM_IP}:8081/%g" /tmp/conductor/properties/conductor.conf
+SDCSIM_IP=`docker inspect --format '{{ .NetworkSettings.Networks.bridge.IPAddress}}' sdcsim`
+echo "SDCSIM_IP=${SDCSIM_IP}"
+
+# change SDC reference to the local instance
+sed -i -e "s%localhost:9595/%${SDCSIM_IP}:9595/%g" /tmp/conductor/properties/conductor.conf
+
+
MULTICLOUDSIM_IP=`docker inspect --format '{{ .NetworkSettings.Networks.bridge.IPAddress}}' multicloudsim`
echo "MULTICLOUDSIM_IP=${MULTICLOUDSIM_IP}"
${WORKSPACE}/scripts/optf-has/has/wait_for_port.sh ${MULTICLOUDSIM_IP} 8082
+
+# prepare sdcsim
+cd ${WORK_DIR}/has/conductor/conductor/tests/functional/simulators/sdcsim/
+
+# check Dockerfile content
+cat ./Dockerfile
+
+# build multicloudsim
+docker build -t sdcsim .
+
+# run multicloudsim
+docker run -d --name sdcsim -p 9595:9595 sdcsim
+
+SDCSIM_IP=`docker inspect --format '{{ .NetworkSettings.Networks.bridge.IPAddress}}' sdcsim`
+echo "SDCSIM_IP=${SDCSIM_IP}"
+
+${WORKSPACE}/scripts/optf-has/has/wait_for_port.sh ${SDCSIM_IP} 9595
+
+
# prepare aafsim
echo "simulator_script: prepare aafsim "
cd ${WORK_DIR}/has/conductor/conductor/tests/functional/simulators/aafsim/
docker stop aaisim
docker stop multicloudsim
docker stop aafsim
+docker stop sdcsim
docker rm aaisim
docker rm multicloudsim
docker rm aafsim
+docker rm sdcsim
\ No newline at end of file
"get_param": "reliability"
},
"unit": ""
- },
- {
- "attribute": "coverage_area_ta_list",
- "operator": "eq",
- "threshold": {
- "get_param": "coverage_area_ta_list"
- },
- "unit": ""
}
]
},
"filtering_attributes": {
"service_profile": {
"latency": {"value": {"get_param": "latency"}, "operator": "lte"},
- "reliability": {"value": {"get_param": "reliability"}, "operator": "gte"},
- "coverage_area_ta_list": {"value": {"get_param": "coverage_area_ta_list"}, "operator": "eq"}
+ "reliability": {"value": {"get_param": "reliability"}, "operator": "gte"}
},
"subnets":{
"core": {
}
},
"ran": {
- "coverage_area_ta_list": {
- "values": [
- {
- "get_param": "coverage_area_ta_list"
- }
- ]
- },
"latency": {
"max": {
"get_param": "latency"
"parameters": {
"core_latency": 10,
"core_reliability": 99.9,
- "coverage_area_ta_list": "Chennai",
"latency": 30,
"ran_latency": 7,
"ran_reliability": 99.9,
"get_param": "reliability"
},
"unit": ""
- },
- {
- "attribute": "coverage_area_ta_list",
- "operator": "eq",
- "threshold": {
- "get_param": "coverage_area_ta_list"
- },
- "unit": ""
}
]
},
"filtering_attributes": {
"service_profile": {
"latency": {"value": {"get_param": "latency"}, "operator": "lte"},
- "reliability": {"value": {"get_param": "reliability"}, "operator": "gte"},
- "coverage_area_ta_list": {"value": {"get_param": "coverage_area_ta_list"}, "operator": "eq"}
+ "reliability": {"value": {"get_param": "reliability"}, "operator": "gte"}
},
"subnets":{
"core": {
}
},
"ran": {
- "coverage_area_ta_list": {
- "values": [
- {
- "get_param": "coverage_area_ta_list"
- }
- ]
- },
"latency": {
"max": {
"get_param": "latency"
"parameters": {
"core_latency": 10,
"core_reliability": 99.9,
- "coverage_area_ta_list": "Chennai",
"latency": 30,
"ran_latency": 7,
"ran_reliability": 99.9,
"get_param": "reliability"
},
"unit": ""
- },
- {
- "attribute": "coverage_area_ta_list",
- "operator": "eq",
- "threshold": {
- "get_param": "coverage_area_ta_list"
- },
- "unit": ""
}
]
},
"filtering_attributes": {
"service_profile": {
"latency": {"value": {"get_param": "latency"}, "operator": "lte"},
- "reliability": {"value": {"get_param": "reliability"}, "operator": "gte"},
- "coverage_area_ta_list": {"value": {"get_param": "coverage_area_ta_list"}, "operator": "eq"}
+ "reliability": {"value": {"get_param": "reliability"}, "operator": "gte"}
},
"subnets":{
"core": {
}
},
"ran": {
- "coverage_area_ta_list": {
- "values": [
- {
- "get_param": "coverage_area_ta_list"
- }
- ]
- },
+
"latency": {
"max": {
"get_param": "latency"
"parameters": {
"core_latency": 10,
"core_reliability": 99.9,
- "coverage_area_ta_list": "Chennai",
"latency": 30,
"ran_latency": 7,
"ran_reliability": 99.9,
"template": {
"homing_template_version": "2020-08-13",
"parameters": {
- "coverage_area_ta_list": "Chennai",
"latency": 30,
"reliability": 99.9
},
"get_param": "reliability"
},
"unit": ""
- },
- {
- "attribute": "coverage_area_ta_list",
- "operator": "eq",
- "threshold": {
- "get_param": "coverage_area_ta_list"
- },
- "unit": ""
}
]
},
"template": {
"homing_template_version": "2020-08-13",
"parameters": {
- "coverage_area_ta_list": "Chennai",
"latency": 5,
"reliability": 99.9
},
"get_param": "reliability"
},
"unit": ""
- },
- {
- "attribute": "coverage_area_ta_list",
- "operator": "eq",
- "threshold": {
- "get_param": "coverage_area_ta_list"
- },
- "unit": ""
}
+
]
},
"type": "threshold"
--- /dev/null
+{
+ "name":"urllc_sample",
+ "files":{
+
+ },
+ "limit":10,
+ "num_solution":"1",
+ "timeout":1200,
+ "template":{
+ "homing_template_version":"2020-08-13",
+ "demands":{
+ "nst_demand":[
+ {
+ "inventory_provider":"aai",
+ "inventory_type":"nst",
+ "unique":"true",
+ "region":"RegionOne",
+ "filtering_attributes":{
+ "model-role":"nst"
+ }
+ }
+ ]
+ },
+ "constraints":{
+ "nst_Threshold":{
+ "type":"threshold",
+ "demands":[
+ "nst_demand"
+ ],
+ "properties":{
+ "evaluate":[
+ {
+ "attribute":"latency",
+ "operator":"lte",
+ "threshold":30,
+ "unit":"ms"
+ }
+ ]
+ }
+ } },
+ "optimization":{
+ "goal": "minimize",
+ "operation_function": {
+ "operator": "sum",
+ "operands": [{
+ "function": "attribute",
+ "params": {
+ "demand": "nst_demand",
+ "attribute": "latency"
+ }
+ }]
+ }
+ }
+ }
+}
\ No newline at end of file
Should Be Equal As Integers ${resp.status_code} 200
Should Be Equal not found ${resultStatus}
+# NST selection template
+SendPlanWithNSTSelection
+ [Documentation] It sends a POST request to conductor
+ Create Session optf-cond ${COND_HOSTNAME}:${COND_PORT}
+ ${data}= Get Binary File ${CURDIR}${/}data${/}nst_selection_template.json
+ &{headers}= Create Dictionary Authorization=${HAS_Auth} Content-Type=application/json Accept=application/json
+ ${resp}= Post Request optf-cond /v1/plans data=${data} headers=${headers}
+ Log To Console *********************
+ Log To Console response = ${resp}
+ Log To Console body = ${resp.text}
+ ${response_json} json.loads ${resp.content}
+ ${generatedPlanId}= Convert To String ${response_json['id']}
+ Set Global Variable ${generatedPlanId}
+ Log To Console generatedPlanId = ${generatedPlanId}
+ Should Be Equal As Integers ${resp.status_code} 201
+ Sleep 60s Wait Plan Resolution
+
+GetPlanWithNsTSelection
+ [Documentation] It sends a REST GET request to capture recommendations
+ Create Session optf-cond ${COND_HOSTNAME}:${COND_PORT}
+ &{headers}= Create Dictionary Authorization=${HAS_Auth} Content-Type=application/json Accept=application/json
+ ${resp}= Get Request optf-cond /v1/plans/${generatedPlanId} headers=${headers}
+ Log To Console *********************
+ Log To Console response = ${resp}
+ ${response_json} json.loads ${resp.content}
+ ${resultStatus}= Convert To String ${response_json['plans'][0]['status']}
+ ${instance_name}= Convert To String ${response_json['plans'][0]['recommendations'][0]['nst_demand']['candidate']['model_name']}
+ Set Global Variable ${resultStatus}
+ Log To Console resultStatus = ${resultStatus}
+ Log To Console body = ${resp.text}
+ Should Be Equal As Integers ${resp.status_code} 200
+ Should Be Equal done ${resultStatus}
+ Should Be Equal EmbbNst ${instance_name}
+
*** Keywords ***