Library
- PnP PNF simulator code: https://gerrit.onap.org/r/gitweb?p=integration.git;a=tree;f=test/mocks/pnfsimulator;hb=HEAD
Precondition
- VM (server) flavor : 2 VCPU, 8 GB of RAM, 32 GB of disk space
- Server OS : Fedora 27/28
PnP PNF simulator installation
Using bash script:Put the following bash script on the server and run it :
#!/bin/bash set_versions () { DOCKER_COMPOSE_VERSION=1.22.0 } enable_root_ssh () { sed -i 's/PermitRootLogin.*/PermitRootLogin yes/' /etc/ssh/sshd_config sed -i 's/PasswordAuthentication.*/PasswordAuthentication yes/' /etc/ssh/sshd_config service sshd restart echo -e "arthur\narthur" | passwd root } update_os () { dnf -y install fedora-upgrade } docker_remove () { dnf -y remove docker \ docker-client \ docker-client-latest \ docker-common \ docker-latest \ docker-latest-logrotate \ docker-logrotate \ docker-selinux \ docker-engine-selinux \ docker-engine } docker_install_and_configure () { dnf -y install dnf-plugins-core dnf config-manager \ --add-repo \ https://download.docker.com/linux/fedora/docker-ce.repo dnf -y install docker-ce systemctl start docker } docker_compose_install () { curl -L https://github.com/docker/compose/releases/download/$DOCKER_COMPOSE_VERSION/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose chmod +x /usr/local/bin/docker-compose } pnf_sim_file_checkout () { cd /root; git clone https://gerrit.onap.org/r/integration printf "{\n "simulatorParams": {\n "vesServerUrl": "http://VES-HOST:VES-PORT/eventListener/v7",\n "testDuration": "10",\n "messageInterval": "1"\n },\n "commonEventHeaderParams": {\n "eventName": "pnfRegistration_Nokia_5gDu",\n "nfNamingCode": "gNB",\n "nfcNamingCode": "oam",\n "sourceName": "NOK6061ZW3",\n "sourceId": "val13",\n "reportingEntityName": "NOK6061ZW3"\n },\n "pnfRegistrationParams": {\n "serialNumber": "6061ZW3",\n "vendorName": "Nokia",\n "oamV4IpAddress": "val3",\n "oamV6IpAddress": "val4",\n "unitFamily": "BBU",\n "modelNumber": "val6",\n "softwareVersion": "val7",\n "unitType": "val8"\n }\n}" > integration/test/mocks/pnfsimulator/config/config.json } start_simulator () { docker login -u docker -p docker nexus3.onap.org:10003 cd ~/integration/test/mocks/pnfsimulator ./simulator.sh start } set_versions enable_root_ssh update_os docker_remove docker_install_and_configure docker_compose_install pnf_sim_file_checkout start_simulator
Using heat template:
Heat template used to deploy PnP PNF simulator on open stack can be found in:
https://gerrit.onap.org/r/gitweb?p=integration.git;a=tree;f=test/mocks/pnfsimulator/deployment;hb=HEAD
Deployment requires to fill define following parameters:- flavor_name
- Image name - use fesdora/centos/redhat base image with dnf support
- Key pair name
- Public network name or ID
- Private network name or ID
- Private subnetwork name or ID
- Proxy (optional parameter, format http://10.10.10.10:8080/, default is empty string)
Verify that all docker containers are up :
[root@pnp-pnf-simulator-heat-pnf-pnp-simualtor-zaxysj4zteyy ~]# docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 90c67bbc8ff1 nexus3.onap.org:10003/onap/pnf-simulator:latest "/bin/sh -c 'java -c…" 32 minutes ago Up 32 minutes 0.0.0.0:5000->5000/tcp pnf-simulator 27b80e0de7c1 sysrepo/sysrepo-netopeer2:latest "/usr/bin/supervisor…" 34 minutes ago Up 34 minutes 0.0.0.0:830->830/tcp netopeer d42e41c873a6 atmoz/sftp:alpine "/entrypoint sftp-us…" 34 minutes ago Up 34 minutes 0.0.0.0:2222->22/tcp sftp-server 189b7e48955e stilliard/pure-ftpd:latest "/bin/sh -c '/run.sh…" 34 minutes ago Up 34 minutes 0.0.0.0:30000-30009->30000-30009/tcp, 0.0.0.0:2221->21/tcp ftpes-server
PnP PNF simulator usage
PNF registration events configuration
In order to configure events that will be send to OANP user need to configure config.json file.
Path to the file /root/integration/test/mocks/pnfsimulator/config/config.jsonconfig.json{ simulatorParams: { vesServerUrl: http://VES-HOST:VES-PORT/eventListener/v7, testDuration: 10, messageInterval: 1 }, commonEventHeaderParams: { eventName: pnfRegistration_Nokia_5gDu, nfNamingCode: gNB, nfcNamingCode: oam, sourceName: NOK6061ZW3, sourceId: val13, reportingEntityName: NOK6061ZW3 }, pnfRegistrationParams: { serialNumber: 6061ZW3, vendorName: Nokia, oamV4IpAddress: val3, oamV6IpAddress: val4, unitFamily: BBU, modelNumber: val6, softwareVersion: val7, unitType: val8 } }
User need to fill:
vesServerUrl
<VES-HOST> - IP of any Kubernetes host
<VES-PORT> - port under which VES service is visible outside Kuberentes cluster
messageInterval - interval with which messages are send to ONAP
testDuration - amount of registration requests
sourceName - use correlationId value used during service instantiation
pnfOamIpv4Address - put there some IPv4 address
pnfOamIpv6Address - put there some IPv6 address
Starting PNF registration events simulation
In order to send messages from simulator to VES collector run command~/sim/simulator.sh run-simulator
Stopping PNF registration events simulation
In order to send messages from simulator to VES collector run command~/sim/simulator.sh stop-simulator