aboutsummaryrefslogtreecommitdiffstats
path: root/vnfs/TestVNF/docker
diff options
context:
space:
mode:
authora.sreekumar <ajith.sreekumar@ericsson.com>2018-10-24 16:07:36 +0100
committera.sreekumar <ajith.sreekumar@ericsson.com>2018-10-24 16:08:17 +0100
commitf46c20006c23d119ffc1c83117d203ed649f687c (patch)
treea04482e2a418f557e7423f7cacd375db7c318687 /vnfs/TestVNF/docker
parent2233d21abae761e91d7b056644c6ac972e662d57 (diff)
Adding TestVNF netconf server
TestVNF netconf server is a partial implementation of a netconfserver for netconf termination. TestVNF is configurable and can be used for testing purposes. Issue-ID: INT-355 Change-Id: I98594d7df57ca14582159bb006d8df51dca74ec7 Signed-off-by: a.sreekumar <ajith.sreekumar@ericsson.com>
Diffstat (limited to 'vnfs/TestVNF/docker')
-rw-r--r--vnfs/TestVNF/docker/NetconfServerDocker/DockerFile11
-rw-r--r--vnfs/TestVNF/docker/README.md27
2 files changed, 38 insertions, 0 deletions
diff --git a/vnfs/TestVNF/docker/NetconfServerDocker/DockerFile b/vnfs/TestVNF/docker/NetconfServerDocker/DockerFile
new file mode 100644
index 00000000..4160a295
--- /dev/null
+++ b/vnfs/TestVNF/docker/NetconfServerDocker/DockerFile
@@ -0,0 +1,11 @@
+FROM openjdk:8-jre-alpine
+
+RUN mkdir /app
+
+COPY netconfsystem-jar-with-dependencies.jar /app
+
+EXPOSE 2052
+
+WORKDIR /app
+
+CMD java -cp netconfsystem-jar-with-dependencies.jar com.ericsson.testvnf.server.Server $NETCONFTEMPLATESDIRECTORY $TIMEDELAYFORSENDINGEVENTS
diff --git a/vnfs/TestVNF/docker/README.md b/vnfs/TestVNF/docker/README.md
new file mode 100644
index 00000000..48f71ef3
--- /dev/null
+++ b/vnfs/TestVNF/docker/README.md
@@ -0,0 +1,27 @@
+# Running TestVNF in Docker
+
+## Create the docker image for the netconfserver.
+Start docker.
+Go to NetconfServerDocker directory. Place the jar created by building the netconfserver maven project into this directory.
+The directory also contains the DockerFile to create a docker image.
+Run the command:
+
+ $ docker build -t testnetconfserver .
+
+A docker image testnetconfserver is now created.
+
+## Running docker containers
+First run a mariadb container, which then can be linked to netconfserver container.
+
+ $ docker run -it --name=testmariadbserver -v /mariadb/:/var/lib/mysql -e MYSQL_USER=root -e MYSQL_DATABASE=netconf_db -e MYSQL_PASSWORD=root -e MYSQL_ROOT_PASSWORD=root -p 3306:3306 -d jbergstroem/mariadb-alpine
+
+Next, run the container for netconfserver. Also link the mariadb container to it.
+
+ $ docker run -e NETCONFTEMPLATESDIRECTORY="/var/netconf/netconftemplates" -e TIMEDELAYFORSENDINGEVENTS="__timeDelayForSendingEvents__" -p 4002:2052 -it --link testmariadbserver:mariadb --name testnetconfserver -v "__host_location__":"/var/netconf/netconftemplates" testnetconfserver
+
+ __timeDelayForSendingEvents__ needs to be replaced with an actual value required in milliseconds (for example: 15000)
+ __host_location__ needs to be replaced with the actual location in the host machine which contains the netconftemplates (for example: /home/ubuntu/netconftemplates).
+
+The container testmariadbserver is linked to container testnetconfserver.
+So as per the above command, in the groovy files used to execute actions by the netconfserver, use 'mariadb' as the host name to connect to the mariadb database.
+