aboutsummaryrefslogtreecommitdiffstats
path: root/ms/neng/src
diff options
context:
space:
mode:
Diffstat (limited to 'ms/neng/src')
-rw-r--r--ms/neng/src/main/resources/db/changelog/scripts/rel_18_10/create_base_tables.sql6
-rw-r--r--ms/neng/src/test/resources/application-test.properties2
-rwxr-xr-xms/neng/src/test/sanity/add-policy-decision-format.sh48
-rwxr-xr-x[-rw-r--r--]ms/neng/src/test/sanity/add-policy-vnf-2.sh0
-rwxr-xr-x[-rw-r--r--]ms/neng/src/test/sanity/add-policy-vnf-ts-2.sh0
-rwxr-xr-x[-rw-r--r--]ms/neng/src/test/sanity/add-policy-vnf-ts.sh0
-rwxr-xr-x[-rw-r--r--]ms/neng/src/test/sanity/add-policy-vnf-uuid.sh0
-rwxr-xr-x[-rw-r--r--]ms/neng/src/test/sanity/add-policy-vnf.sh0
-rwxr-xr-x[-rw-r--r--]ms/neng/src/test/sanity/add-policy.sh0
-rwxr-xr-x[-rw-r--r--]ms/neng/src/test/sanity/env.sh0
-rwxr-xr-xms/neng/src/test/sanity/gen-name-decision-format.sh59
-rwxr-xr-x[-rw-r--r--]ms/neng/src/test/sanity/gen-name-vnf-2.sh0
-rwxr-xr-x[-rw-r--r--]ms/neng/src/test/sanity/gen-name-vnf-ts-2-update.sh0
-rwxr-xr-x[-rw-r--r--]ms/neng/src/test/sanity/gen-name-vnf-ts-2.sh0
-rwxr-xr-x[-rw-r--r--]ms/neng/src/test/sanity/gen-name-vnf-ts.sh0
-rwxr-xr-x[-rw-r--r--]ms/neng/src/test/sanity/gen-name-vnf-uuid.sh0
-rwxr-xr-x[-rw-r--r--]ms/neng/src/test/sanity/gen-name-vnf.sh0
-rwxr-xr-x[-rw-r--r--]ms/neng/src/test/sanity/gen-name.sh0
-rwxr-xr-x[-rw-r--r--]ms/neng/src/test/sanity/get-policy.sh0
-rwxr-xr-x[-rw-r--r--]ms/neng/src/test/sanity/hello.sh0
-rw-r--r--ms/neng/src/test/sanity/policy-decision-api.json97
-rwxr-xr-x[-rw-r--r--]ms/neng/src/test/sanity/release-name.sh0
-rwxr-xr-x[-rw-r--r--]ms/neng/src/test/sanity/suite.sh2
23 files changed, 210 insertions, 4 deletions
diff --git a/ms/neng/src/main/resources/db/changelog/scripts/rel_18_10/create_base_tables.sql b/ms/neng/src/main/resources/db/changelog/scripts/rel_18_10/create_base_tables.sql
index 6150eaf8..afb37437 100644
--- a/ms/neng/src/main/resources/db/changelog/scripts/rel_18_10/create_base_tables.sql
+++ b/ms/neng/src/main/resources/db/changelog/scripts/rel_18_10/create_base_tables.sql
@@ -23,7 +23,7 @@ CREATED_TIME DATETIME DEFAULT CURRENT_TIMESTAMP,
CREATED_BY VARCHAR(50),
LAST_UPDATED_TIME DATETIME,
LAST_UPDATED_BY VARCHAR(50)
-) ;
+);
CREATE TABLE IDENTIFIER_MAP (IDENTIFIER_MAP_ID INTEGER PRIMARY KEY AUTO_INCREMENT(0,100),
POLICY_FN_NAME VARCHAR(500) COMMENT 'Function name in policy manager' NOT NULL,
@@ -32,7 +32,7 @@ CREATED_TIME DATETIME DEFAULT CURRENT_TIMESTAMP,
CREATED_BY VARCHAR(50),
LAST_UPDATED_TIME DATETIME,
LAST_UPDATED_BY VARCHAR(50)
-) ;
+);
CREATE TABLE EXTERNAL_INTERFACE (EXTERNAL_INTERFACE_ID INTEGER PRIMARY KEY AUTO_INCREMENT(0,100),
@@ -49,4 +49,4 @@ CREATE TABLE POLICY_MAN_SIM (POLICY_ID INTEGER PRIMARY KEY AUTO_INCREMENT(0,100)
POLICY_NAME VARCHAR(500) COMMENT 'Policy name' NOT NULL,
POLICY_RESPONSE VARCHAR(10000) COMMENT 'Policy value',
CREATED_TIME DATETIME DEFAULT CURRENT_TIMESTAMP
-) ;
+);
diff --git a/ms/neng/src/test/resources/application-test.properties b/ms/neng/src/test/resources/application-test.properties
index 5aacbbaa..a75b5288 100644
--- a/ms/neng/src/test/resources/application-test.properties
+++ b/ms/neng/src/test/resources/application-test.properties
@@ -6,7 +6,7 @@
#=========================================================================
datasource.db.driver-class-name=org.h2.Driver
-datasource.db.url=jdbc:h2:mem:tests;DB_CLOSE_DELAY=-1;
+datasource.db.url=jdbc:h2:mem:tests;DB_CLOSE_DELAY=-1;MODE=MySQL;DATABASE_TO_LOWER=TRUE;CASE_INSENSITIVE_IDENTIFIERS=TRUE;
datasource.db.username=none
datasource.db.password=none
diff --git a/ms/neng/src/test/sanity/add-policy-decision-format.sh b/ms/neng/src/test/sanity/add-policy-decision-format.sh
new file mode 100755
index 00000000..5de85024
--- /dev/null
+++ b/ms/neng/src/test/sanity/add-policy-decision-format.sh
@@ -0,0 +1,48 @@
+#!/bin/bash
+#============LICENSE_START=======================================================
+# ONAP : CCSDK.apps
+# ================================================================================
+# Copyright (C) 2018 AT&T Intellectual Property. All rights reserved.
+# ================================================================================
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#============LICENSE_END=========================================================
+
+#==================================================================================
+# This script does a sanity test on the add-policy API of the micro-service.
+#
+# This supports the decision API format
+#==================================================================================
+
+. ./env.sh
+URL=web/service/v1/addPolicy
+TEMP_FILE=/tmp/add-policy.$$.$RANDOM
+EXTERNAL_KEY=${1:-123456789}
+
+printf '{ ' > $TEMP_FILE
+printf '"policyName": "vnf-policy-decision-api' >> $TEMP_FILE
+printf '", "policyValue" : "' >> $TEMP_FILE
+cat ./policy-decision-api.json | sed 's/\"/\\\"/g' | tr '\n' ' ' | tr '\r' ' ' >> $TEMP_FILE
+echo '"}' >> $TEMP_FILE
+
+echo "==================================================="
+echo "====== Adding Policy: ==========================="
+cat $TEMP_FILE
+echo ""
+echo "==================================================="
+
+echo "==================================================="
+curl -vi -H "Content-Type: application/json" --data @$TEMP_FILE $PROTOCOL://$HOST:$PORT/$URL
+echo "==================================================="
+
+rm -f $TEMP_FILE
+
diff --git a/ms/neng/src/test/sanity/add-policy-vnf-2.sh b/ms/neng/src/test/sanity/add-policy-vnf-2.sh
index e4820671..e4820671 100644..100755
--- a/ms/neng/src/test/sanity/add-policy-vnf-2.sh
+++ b/ms/neng/src/test/sanity/add-policy-vnf-2.sh
diff --git a/ms/neng/src/test/sanity/add-policy-vnf-ts-2.sh b/ms/neng/src/test/sanity/add-policy-vnf-ts-2.sh
index 009b7c34..009b7c34 100644..100755
--- a/ms/neng/src/test/sanity/add-policy-vnf-ts-2.sh
+++ b/ms/neng/src/test/sanity/add-policy-vnf-ts-2.sh
diff --git a/ms/neng/src/test/sanity/add-policy-vnf-ts.sh b/ms/neng/src/test/sanity/add-policy-vnf-ts.sh
index 4119d88a..4119d88a 100644..100755
--- a/ms/neng/src/test/sanity/add-policy-vnf-ts.sh
+++ b/ms/neng/src/test/sanity/add-policy-vnf-ts.sh
diff --git a/ms/neng/src/test/sanity/add-policy-vnf-uuid.sh b/ms/neng/src/test/sanity/add-policy-vnf-uuid.sh
index 020dd6e4..020dd6e4 100644..100755
--- a/ms/neng/src/test/sanity/add-policy-vnf-uuid.sh
+++ b/ms/neng/src/test/sanity/add-policy-vnf-uuid.sh
diff --git a/ms/neng/src/test/sanity/add-policy-vnf.sh b/ms/neng/src/test/sanity/add-policy-vnf.sh
index b10cf57f..b10cf57f 100644..100755
--- a/ms/neng/src/test/sanity/add-policy-vnf.sh
+++ b/ms/neng/src/test/sanity/add-policy-vnf.sh
diff --git a/ms/neng/src/test/sanity/add-policy.sh b/ms/neng/src/test/sanity/add-policy.sh
index 108d0d48..108d0d48 100644..100755
--- a/ms/neng/src/test/sanity/add-policy.sh
+++ b/ms/neng/src/test/sanity/add-policy.sh
diff --git a/ms/neng/src/test/sanity/env.sh b/ms/neng/src/test/sanity/env.sh
index 8685bcf8..8685bcf8 100644..100755
--- a/ms/neng/src/test/sanity/env.sh
+++ b/ms/neng/src/test/sanity/env.sh
diff --git a/ms/neng/src/test/sanity/gen-name-decision-format.sh b/ms/neng/src/test/sanity/gen-name-decision-format.sh
new file mode 100755
index 00000000..40ee3b09
--- /dev/null
+++ b/ms/neng/src/test/sanity/gen-name-decision-format.sh
@@ -0,0 +1,59 @@
+#!/bin/bash
+#============LICENSE_START=======================================================
+# ONAP : CCSDK.apps
+# ================================================================================
+# Copyright (C) 2018 AT&T Intellectual Property. All rights reserved.
+# ================================================================================
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#============LICENSE_END=========================================================
+
+#==================================================================================
+# This script does a sanity test on the generate-name API of this micro-service.
+#
+# This exercises the new policy API (decision API)
+#==================================================================================
+
+. ./env.sh
+URL=web/service/v1/genNetworkElementName
+TEMP_FILE=/tmp/gen-name.$$.$RANDOM
+EXTERNAL_KEY=$RANDOM
+
+USE_DB=${1:-'Y'}
+USE_DB_BOOL=$([ "$USE_DB" == "Y" ] && echo "true" || echo "false")
+
+printf '{ "UseDb": "' > $TEMP_FILE
+printf $USE_DB_BOOL >> $TEMP_FILE
+printf '", "elements": [ { "external-key": "sanity-' >> $TEMP_FILE
+printf $EXTERNAL_KEY >> $TEMP_FILE
+printf '", "policy-instance-name": "vnf-policy-decision-api", "NF_NAMING_CODE": "me9", "COMPLEX": "dlstxa", ' >> $TEMP_FILE
+printf '"resource-name": "VNF", "naming-type": "VNF", "AIC_CLOUD_REGION": "aicr" } ] }' >> $TEMP_FILE
+
+echo "==================================================="
+echo "======== Generating name with request: ============"
+echo ""
+echo ""
+cat $TEMP_FILE
+echo ""
+echo ""
+echo ""
+echo "==================================================="
+
+echo "==================================================="
+curl -vi -H "Content-Type: application/json" --data @$TEMP_FILE $PROTOCOL://$HOST:$PORT/$URL
+echo ""
+echo ""
+echo "==================================================="
+
+rm -f $TEMP_FILE
+
+
diff --git a/ms/neng/src/test/sanity/gen-name-vnf-2.sh b/ms/neng/src/test/sanity/gen-name-vnf-2.sh
index 27901538..27901538 100644..100755
--- a/ms/neng/src/test/sanity/gen-name-vnf-2.sh
+++ b/ms/neng/src/test/sanity/gen-name-vnf-2.sh
diff --git a/ms/neng/src/test/sanity/gen-name-vnf-ts-2-update.sh b/ms/neng/src/test/sanity/gen-name-vnf-ts-2-update.sh
index b90af171..b90af171 100644..100755
--- a/ms/neng/src/test/sanity/gen-name-vnf-ts-2-update.sh
+++ b/ms/neng/src/test/sanity/gen-name-vnf-ts-2-update.sh
diff --git a/ms/neng/src/test/sanity/gen-name-vnf-ts-2.sh b/ms/neng/src/test/sanity/gen-name-vnf-ts-2.sh
index 3aeeea8e..3aeeea8e 100644..100755
--- a/ms/neng/src/test/sanity/gen-name-vnf-ts-2.sh
+++ b/ms/neng/src/test/sanity/gen-name-vnf-ts-2.sh
diff --git a/ms/neng/src/test/sanity/gen-name-vnf-ts.sh b/ms/neng/src/test/sanity/gen-name-vnf-ts.sh
index abd3c79c..abd3c79c 100644..100755
--- a/ms/neng/src/test/sanity/gen-name-vnf-ts.sh
+++ b/ms/neng/src/test/sanity/gen-name-vnf-ts.sh
diff --git a/ms/neng/src/test/sanity/gen-name-vnf-uuid.sh b/ms/neng/src/test/sanity/gen-name-vnf-uuid.sh
index 9b98bd92..9b98bd92 100644..100755
--- a/ms/neng/src/test/sanity/gen-name-vnf-uuid.sh
+++ b/ms/neng/src/test/sanity/gen-name-vnf-uuid.sh
diff --git a/ms/neng/src/test/sanity/gen-name-vnf.sh b/ms/neng/src/test/sanity/gen-name-vnf.sh
index 5c4c3ec5..5c4c3ec5 100644..100755
--- a/ms/neng/src/test/sanity/gen-name-vnf.sh
+++ b/ms/neng/src/test/sanity/gen-name-vnf.sh
diff --git a/ms/neng/src/test/sanity/gen-name.sh b/ms/neng/src/test/sanity/gen-name.sh
index fb106eda..fb106eda 100644..100755
--- a/ms/neng/src/test/sanity/gen-name.sh
+++ b/ms/neng/src/test/sanity/gen-name.sh
diff --git a/ms/neng/src/test/sanity/get-policy.sh b/ms/neng/src/test/sanity/get-policy.sh
index 5c7136b6..5c7136b6 100644..100755
--- a/ms/neng/src/test/sanity/get-policy.sh
+++ b/ms/neng/src/test/sanity/get-policy.sh
diff --git a/ms/neng/src/test/sanity/hello.sh b/ms/neng/src/test/sanity/hello.sh
index baa5b703..baa5b703 100644..100755
--- a/ms/neng/src/test/sanity/hello.sh
+++ b/ms/neng/src/test/sanity/hello.sh
diff --git a/ms/neng/src/test/sanity/policy-decision-api.json b/ms/neng/src/test/sanity/policy-decision-api.json
new file mode 100644
index 00000000..3804ff45
--- /dev/null
+++ b/ms/neng/src/test/sanity/policy-decision-api.json
@@ -0,0 +1,97 @@
+{
+ "policies": {
+ "SDNC_Policy.ONAP_VNF_NAMING_TIMESTAMP": {
+ "type": "onap.policies.Naming",
+ "type_version": "1.0.0",
+ "properties": {
+ "policy-instance-name": "ONAP_VNF_NAMING_TIMESTAMP",
+ "naming-models": [
+ {
+ "naming-type": "VNF",
+ "naming-recipe": "AIC_CLOUD_REGION|DELIMITER|CONSTANT|DELIMITER|TIMESTAMP",
+ "naming-properties": [
+ {
+ "property-name": "AIC_CLOUD_REGION"
+ },
+ {
+ "property-name": "CONSTANT",
+ "property-value": "ONAP-NF"
+ },
+ {
+ "property-name": "TIMESTAMP"
+ },
+ {
+ "property-value": "_",
+ "property-name": "DELIMITER"
+ }
+ ]
+ },
+ {
+ "naming-type": "VNFC",
+ "naming-recipe": "VNF_NAME|DELIMITER|NFC_NAMING_CODE|DELIMITER|SEQUENCE",
+ "naming-properties": [
+ {
+ "property-name": "VNF_NAME"
+ },
+ {
+ "property-name": "SEQUENCE",
+ "increment-sequence": {
+ "max": "zzz",
+ "scope": "ENTIRETY",
+ "start-value": 1.0,
+ "length": 3.0,
+ "increment": 1.0,
+ "sequence-type": "alpha-numeric"
+ }
+ },
+ {
+ "property-name": "NFC_NAMING_CODE"
+ },
+ {
+ "property-value": "_",
+ "property-name": "DELIMITER"
+ }
+ ]
+ },
+ {
+ "naming-type": "VF-MODULE",
+ "naming-recipe": "VNF_NAME|DELIMITER|VF_MODULE_LABEL|DELIMITER|VF_MODULE_TYPE|DELIMITER|SEQUENCE",
+ "naming-properties": [
+ {
+ "property-name": "VNF_NAME"
+ },
+ {
+ "property-value": "_",
+ "property-name": "DELIMITER"
+ },
+ {
+ "property-name": "VF_MODULE_LABEL"
+ },
+ {
+ "property-name": "VF_MODULE_TYPE"
+ },
+ {
+ "property-name": "SEQUENCE",
+ "increment-sequence": {
+ "max": "zzz",
+ "scope": "PRECEEDING",
+ "start-value": 1.0,
+ "length": 3.0,
+ "increment": 1.0,
+ "sequence-type": "alpha-numeric"
+ }
+ }
+ ]
+ }
+ ]
+ },
+ "name": "SDNC_Policy.ONAP_VNF_NAMING_TIMESTAMP",
+ "version": "1.0.0",
+ "metadata": {
+ "policy-id": "SDNC_Policy.ONAP_VNF_NAMING_TIMESTAMP",
+ "policy-version": "1"
+ }
+ }
+ }
+}
+
diff --git a/ms/neng/src/test/sanity/release-name.sh b/ms/neng/src/test/sanity/release-name.sh
index 2a6d16df..2a6d16df 100644..100755
--- a/ms/neng/src/test/sanity/release-name.sh
+++ b/ms/neng/src/test/sanity/release-name.sh
diff --git a/ms/neng/src/test/sanity/suite.sh b/ms/neng/src/test/sanity/suite.sh
index 79d5b414..7050a28e 100644..100755
--- a/ms/neng/src/test/sanity/suite.sh
+++ b/ms/neng/src/test/sanity/suite.sh
@@ -28,4 +28,6 @@ EXTERNAL_KEY=$(date +%s)$RANDOM
./get-policy.sh $EXTERNAL_KEY
./gen-name.sh Y $EXTERNAL_KEY
./release-name.sh Y $EXTERNAL_KEY
+./add-policy-decision-format.sh $EXTERNAL_KEY
+./gen-name-decision-format.sh Y $EXTERNAL_KEY