Table of Contents |
---|
Warning | ||
---|---|---|
| ||
Will be updated soon to follow changes from https://gerrit.onap.org/r/#/c/integration/+/91154/ |
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 :
Code Block | ||
---|---|---|
| ||
#!/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:
...
Verify that all docker containers are up :
Code Block | ||
---|---|---|
| ||
[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.json
Code Block | ||||
---|---|---|---|---|
| ||||
{
"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"
},
"notificationParams": {
"changeIdentifier": "PM_MEAS_FILES",
"changeType": "FileReady",
"arrayOfNamedHashMap": [
{"name": "A20161221.1031-1041.bin.gz", "hashMap": {
"location": "ftpes://192.169.0.1:22/ftp/rop/A20161224.1030-1045.bin.gz",
"compression": "gzip",
"fileformatType": "org.3GPP.32.435#measCollec",
"fileFormatVersion": "V10"
}
},
{"name": "A20161222.1042-1102.bin.gz", "hashMap": {
"location": "ftpes://192.168.0.102:22/ftp/rop/A20161224.1045-1100.bin.gz",
"compression": "gzip",
"fileFormatType": "org.3GPP.32.435#measCollec",
"fileFormatVersion": "V10"
}
}
]
}
}
|
In order to use simulator as in Registration Request mode user need to:
remove whole "notificationParams" section:
Code Block | ||||
---|---|---|---|---|
| ||||
,
"notificationParams": {
"changeIdentifier": "PM_MEAS_FILES",
"changeType": "FileReady",
"arrayOfNamedHashMap": [
{"name": "A20161221.1031-1041.bin.gz", "hashMap": {
"location": "ftpes://192.169.0.1:22/ftp/rop/A20161224.1030-1045.bin.gz",
"compression": "gzip",
"fileformatType": "org.3GPP.32.435#measCollec",
"fileFormatVersion": "V10"
}
},
{"name": "A20161222.1042-1102.bin.gz", "hashMap": {
"location": "ftpes://192.168.0.102:22/ftp/rop/A20161224.1045-1100.bin.gz",
"compression": "gzip",
"fileFormatType": "org.3GPP.32.435#measCollec",
"fileFormatVersion": "V10"
}
}
]
} |
...
fill these parameters:
vesServerUrl
<VES-HOST> - IP of any Kubernetes host where ONAP is deployed
<VES-PORT> - port under which VES service is accessible outside of 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
...
cd
~
/integration/test/mocks/pnfsimulator
.
/simulator
.sh run-simulator
Stopping PNF registration events simulation
...