aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBogumil Zebek <bogumil.zebek@nokia.com>2020-02-27 07:39:38 +0100
committerZebek Bogumil <bogumil.zebek@nokia.com>2020-02-27 11:18:37 +0100
commit78bc8f367f38f8dddc761bec7980876cfba69bbf (patch)
treee91fb25f0988d378c272f6016d81bbabf8e3e0e5
parent0da675320e8150f26935c4ab3de89b7c7fba0d14 (diff)
Fix ca name
Use proper CA name in CSIT test Issue-ID: AAF-997 Signed-off-by: Zebek Bogumil <bogumil.zebek@nokia.com> Change-Id: I8954f6af116fd1c5d208ad4c2d2736aa52c9c027
-rw-r--r--plans/aaf/certservice/cmpServers.json24
-rw-r--r--plans/aaf/certservice/setup.sh19
-rw-r--r--tests/aaf/certservice/cert-service-test.robot12
-rw-r--r--tests/aaf/certservice/resources/cert-service-properties.robot2
4 files changed, 48 insertions, 9 deletions
diff --git a/plans/aaf/certservice/cmpServers.json b/plans/aaf/certservice/cmpServers.json
new file mode 100644
index 00000000..f461edc7
--- /dev/null
+++ b/plans/aaf/certservice/cmpServers.json
@@ -0,0 +1,24 @@
+{
+ "cmpv2Servers": [
+ {
+ "caName": "TEST",
+ "url": "http://127.0.0.1/ejbca/publicweb/cmp/cmp",
+ "issuerDN": "CN=ManagementCA",
+ "caMode": "CLIENT",
+ "authentication": {
+ "iak": "xxx",
+ "rv": "yyy"
+ }
+ },
+ {
+ "caName": "TEST2",
+ "url": "http://127.0.0.1/ejbca/publicweb/cmp/cmpRA",
+ "issuerDN": "CN=ManagementCA2",
+ "caMode": "RA",
+ "authentication": {
+ "iak": "xxx",
+ "rv": "yyy"
+ }
+ }
+ ]
+}
diff --git a/plans/aaf/certservice/setup.sh b/plans/aaf/certservice/setup.sh
index 48bf00b9..1bf57470 100644
--- a/plans/aaf/certservice/setup.sh
+++ b/plans/aaf/certservice/setup.sh
@@ -1,6 +1,6 @@
#!/bin/bash
#
-# Copyright 2017 ZTE Corporation.
+# Copyright 2020 Nokia.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -19,8 +19,23 @@ AAFCERT_IMAGE=nexus3.onap.org:10001/onap/org.onap.aaf.certservice.aaf-certservic
echo AAFCERT_IMAGE=${AAFCERT_IMAGE}
+# ------------------------------------
+# Resolve path to cmp servers configuration
+
+SCRIPT=`realpath $0`
+CURRENT_WORKDIR_PATH=`dirname $SCRIPT`
+
+CONFIGURATION_FILE="cmpServers.json"
+if test -f "$CURRENT_WORKDIR_PATH/plans/aaf/certservice/$CONFIGURATION_FILE"; then
+ CONFIGURATION_PATH="$CURRENT_WORKDIR_PATH/plans/aaf/certservice/$CONFIGURATION_FILE"
+else test -f "$CURRENT_WORKDIR_PATH/$CONFIGURATION_FILE";
+ CONFIGURATION_PATH=$CURRENT_WORKDIR_PATH/$CONFIGURATION_FILE
+fi
+echo "Use configuration from: $CONFIGURATION_PATH"
+# -------------------------------------
+
# Start AAF Cert Srevice
-docker run -p 8080:8080 -d --name aafcert ${AAFCERT_IMAGE}
+docker run -p 8080:8080 -d --mount type=bind,source=${CONFIGURATION_PATH},target=/etc/onap/aaf/certservice/cmpServers.json --name aafcert ${AAFCERT_IMAGE}
AAFCERT_IP=`get-instance-ip.sh aafcert`
export AAFCERT_IP=${AAFCERT_IP}
diff --git a/tests/aaf/certservice/cert-service-test.robot b/tests/aaf/certservice/cert-service-test.robot
index aa2691a7..daaa07ca 100644
--- a/tests/aaf/certservice/cert-service-test.robot
+++ b/tests/aaf/certservice/cert-service-test.robot
@@ -1,6 +1,6 @@
*** Settings ***
-Documentation Run healthcheck
+Documentation AAF test case scenarios
Library RequestsLibrary
Resource ./resources/cert-service-keywords.robot
@@ -20,7 +20,7 @@ AAF Cert Service API Reload Configuration
AAF Cert Service API Send Valid CSR and Valid PK
[Tags] AAF-CERT-SERVICE
- [Documentation] Send request to /v1/certificate/test endpoint and expect 200
+ [Documentation] Send request to ${CERT_PATH} endpoint and expect 200
Send Get Request with Header And Validate Response ${CERT_PATH} ${VALID_CSR_FILE} ${VALID_PK_FILE} 200
AAF Cert Service API Send Valid CSR and Valid PK to Wrong Path
@@ -30,15 +30,15 @@ AAF Cert Service API Send Valid CSR and Valid PK to Wrong Path
AAF Cert Service API Send Request without Header
[Tags] AAF-CERT-SERVICE
- [Documentation] Send request to /v1/certificate/ endpoint and expect 400
+ [Documentation] Send request without header to ${CERT_PATH} endpoint and expect 400
Send Get Request And Validate Response ${CERT_PATH} 400
AAF Cert Service API Send Invalid CSR and Valid PK
[Tags] AAF-CERT-SERVICE
- [Documentation] Send request to /v1/certificate/test endpoint and expect 400
+ [Documentation] Send request to ${CERT_PATH} endpoint and expect 400
Send Get Request with Header And Validate Response ${CERT_PATH} ${INVALID_CSR_FILE} ${VALID_PK_FILE} 400
AAF Cert Service API Send Valid CSR and Invalid PK
[Tags] AAF-CERT-SERVICE
- [Documentation] Send request to /v1/certificate/test endpoint and expect 400
- Send Get Request with Header And Validate Response ${CERT_PATH} ${VALID_CSR_FILE} ${INVALID_PK_FILE} 400 \ No newline at end of file
+ [Documentation] Send request to ${CERT_PATH} endpoint and expect 400
+ Send Get Request with Header And Validate Response ${CERT_PATH} ${VALID_CSR_FILE} ${INVALID_PK_FILE} 400
diff --git a/tests/aaf/certservice/resources/cert-service-properties.robot b/tests/aaf/certservice/resources/cert-service-properties.robot
index e911133d..1049695e 100644
--- a/tests/aaf/certservice/resources/cert-service-properties.robot
+++ b/tests/aaf/certservice/resources/cert-service-properties.robot
@@ -1,7 +1,7 @@
*** Variables ***
${AAFCERT_URL} http://%{AAFCERT_IP}:8080
-${CAName} test
+${CAName} TEST
${CERT_PATH} /v1/certificate/${CAName}
${VALID_CSR_FILE} %{WORKSPACE}/tests/aaf/certservice/assets/valid.csr
${VALID_PK_FILE} %{WORKSPACE}/tests/aaf/certservice/assets/valid.key