aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrajendrajaiswal <rajendra.jaiswal@ericsson.com>2019-02-14 14:47:15 +0000
committerroot <rajendra.jaiswal@ericsson.com>2019-02-14 14:53:11 +0000
commit140bfd2c8572f13a8499066bc8c2eea8ce96f641 (patch)
treeae118db105f1ba7f9d9d1ee26b6a7a871a940bed
parenta1574707fd66cd38cdbda22d0bc8d900570904c3 (diff)
New Test Cases for PM Mapper
Change-Id: I10e4409e6ed9ba0847032920ccd56941c83be04b Issue-ID: INT-863 Signed-off-by: Rajendra Jaiswal <rajendra.jaiswal@ericsson.com>
-rw-r--r--plans/dcaegen2-pmmapper/pmmapper/setup.sh17
-rw-r--r--plans/dcaegen2-pmmapper/pmmapper/teardown.sh4
-rw-r--r--tests/dcaegen2-pmmapper/pmmapper/pmmapper.robot15
3 files changed, 30 insertions, 6 deletions
diff --git a/plans/dcaegen2-pmmapper/pmmapper/setup.sh b/plans/dcaegen2-pmmapper/pmmapper/setup.sh
index e896190e..01e14689 100644
--- a/plans/dcaegen2-pmmapper/pmmapper/setup.sh
+++ b/plans/dcaegen2-pmmapper/pmmapper/setup.sh
@@ -88,7 +88,7 @@ for i in {1..10}; do
[ $(docker inspect --format '{{ .State.Running }}' cbs) ] && \
[ $(docker inspect --format '{{ .State.Running }}' buscontroller) ]
then
- echo "DR Service Running"
+ echo "Data Router, Consul, Config Binding Service, Buscontroller Services Running"
break
else
echo sleep $i
@@ -122,9 +122,22 @@ CBS_IP=$(docker inspect '--format={{range .NetworkSettings.Networks}}{{.IPAddres
sed -i 's/CBSIP/'$CBS_IP'/g' docker-compose.yml
sed -i 's/BUSIP/'$DMAAPBC_IP'/g' docker-compose.yml
docker-compose up -d
+
+# Wait for initialization of Docker container for 3GPP PM Mapper
+for i in {1..10}; do
+ if [ $(docker inspect --format '{{ .State.Running }}' pmmapper) ]
+ then
+ echo "PM Mapper Service Running"
+ break
+ else
+ echo sleep $i
+ sleep $i
+ fi
+done
PMMAPPER_IP=$(docker inspect '--format={{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' pmmapper)
+docker exec datarouter-prov /bin/sh -c "echo '${PMMAPPER_IP}' 3gpppmmapper >> /etc/hosts"
sleep 10
-docker exec pmmapper /bin/sh -c "cat /var/log/ONAP/dcaegen2/services/pm-mapper/pm-mapper_output.log"
+docker exec pmmapper /bin/sh -c "head -n 5 /var/log/ONAP/dcaegen2/services/pm-mapper/pm-mapper_output.log" >> /tmp/pmmapper.log
curl -k https://$DR_PROV_IP:8443/internal/prov
#Pass any variables required by Robot test suites in ROBOT_VARIABLES
diff --git a/plans/dcaegen2-pmmapper/pmmapper/teardown.sh b/plans/dcaegen2-pmmapper/pmmapper/teardown.sh
index 5b910121..08e1c770 100644
--- a/plans/dcaegen2-pmmapper/pmmapper/teardown.sh
+++ b/plans/dcaegen2-pmmapper/pmmapper/teardown.sh
@@ -7,4 +7,6 @@ kill-instance.sh datarouter-node
kill-instance.sh datarouter-prov
kill-instance.sh mariadb
kill-instance.sh cbs
-kill-instance.sh consul \ No newline at end of file
+kill-instance.sh consul
+kill-instance.sh buscontroller
+kill-instance.sh pmmapper \ No newline at end of file
diff --git a/tests/dcaegen2-pmmapper/pmmapper/pmmapper.robot b/tests/dcaegen2-pmmapper/pmmapper/pmmapper.robot
index 78d7bf30..51d78d43 100644
--- a/tests/dcaegen2-pmmapper/pmmapper/pmmapper.robot
+++ b/tests/dcaegen2-pmmapper/pmmapper/pmmapper.robot
@@ -7,14 +7,23 @@ Library Process
*** Variables ***
-${CLI_EXEC_CLI} curl -k https://${DR_PROV_IP}:8443/internal/prov
+${CLI_EXEC_CLI_CONFIG} cat /tmp/pmmapper.log
+${CLI_EXEC_CLI_SUBS} curl -k https://${DR_PROV_IP}:8443/internal/prov
*** Test Cases ***
-Verify 3GPP PM Mapper Subscribes to Data Router
+Verify PM Mapper Receive Configuraton From Config Binding Service
[Tags] PM_MAPPER_01
+ [Documentation] Verify 3gpp pm mapper successfully receive config data from CBS
+ ${cli_cmd_output}= Run Process ${CLI_EXEC_CLI_CONFIG} shell=yes
+ Log ${cli_cmd_output.stdout}
+ Should Be Equal As Strings ${cli_cmd_output.rc} 0
+ Should Contain ${cli_cmd_output.stdout} "3gpppmmapper"
+
+Verify 3GPP PM Mapper Subscribes to Data Router
+ [Tags] PM_MAPPER_02
[Documentation] Verify 3gpp pm mapper subscribes to data router
- ${cli_cmd_output}= Run Process ${CLI_EXEC_CLI} shell=yes
+ ${cli_cmd_output}= Run Process ${CLI_EXEC_CLI_SUBS} shell=yes
Log ${cli_cmd_output.stdout}
Should Be Equal As Strings ${cli_cmd_output.rc} 0
Should Contain ${cli_cmd_output.stdout} "3gpppmmapper"