Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents

Library

Precondition

  • Server flavor : 2 VCPU, 8 GB of RAM, 32 GB of HDD
  • 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
languagebash
#!/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_install_configure () {
    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
    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
    systemctl daemon-reload
    systemctl restart docker
    docker login -u docker -p docker nexus3.onap.org:10003
}
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 () {
    mkdir ~/sim/
    mkdir ~/sim/ssh
    cd ~/sim/ssh/;wget "https://gerrit.onap.org/r/gitweb?p=integration.git;a=blob_plain;f=test/mocks/pnfsimulator/ssh/ssh_host_rsa_key;hb=HEAD" -O ssh_host_rsa_key
    cd ~/sim/ssh/;wget "https://gerrit.onap.org/r/gitweb?p=integration.git;a=blob_plain;f=test/mocks/pnfsimulator/ssh/ssh_host_rsa_key.pub;hb=HEAD" -O ssh_host_rsa_key.pub
    mkdir ~/sim/sftp
    cd ~/sim/sftp/;wget "https://gerrit.onap.org/r/gitweb?p=integration.git;a=blob_plain;f=test/mocks/pnfsimulator/sftp/sftp-file.txt;hb=HEAD" -O sftp-file.txt
    mkdir ~/sim/config
    cd ~/sim/config/;wget "https://gerrit.onap.org/r/gitweb?p=integration.git;a=blob_plain;f=test/mocks/pnfsimulator/config/config.json;hb=HEAD" -O config.json
    cd ~/sim/config/;wget "https://gerrit.onap.org/r/gitweb?p=integration.git;a=blob_plain;f=test/mocks/pnfsimulator/config/netconf.env;hb=HEAD" -O netconf.env
    mkdir ~/sim/json_schema
    cd ~/sim/config/;wget "https://gerrit.onap.org/r/gitweb?p=integration.git;a=blob_plain;f=test/mocks/pnfsimulator/json_schema/input_validator.json;hb=HEAD" -O input_validator.json
    cd ~/sim/config/;wget "https://gerrit.onap.org/r/gitweb?p=integration.git;a=blob_plain;f=test/mocks/pnfsimulator/json_schema/output_validator_ves_schema_30.0.1.json;hb=HEAD" -O output_validator_ves_schema_30.0.1.json
    mkdir ~/sim/netconf
    cd ~/sim/netconf/;wget "https://gerrit.onap.org/r/gitweb?p=integration.git;a=blob_plain;f=test/mocks/pnfsimulator/netconf/pnf-simulator.data.xml;hb=HEAD" -O pnf-simulator.data.xml
    cd ~/sim/netconf/;wget "https://gerrit.onap.org/r/gitweb?p=integration.git;a=blob_plain;f=test/mocks/pnfsimulator/netconf/pnf-simulator.yang;hb=HEAD" -O pnf-simulator.yang
    cd ~/sim/;wget "https://gerrit.onap.org/r/gitweb?p=integration.git;a=blob_plain;f=test/mocks/pnfsimulator/docker-compose.yml;hb=HEAD" -O docker-compose.yml
    cd ~/sim/;wget "https://gerrit.onap.org/r/gitweb?p=integration.git;a=blob_plain;f=test/mocks/pnfsimulator/simulator.sh;hb=HEAD" -O simulator.sh
    chmod 654 ~/sim/simulator.sh
}

start_simulator (){
   ~/sim/simulator.sh start
}

set_versions
enable_root_ssh
update_os
docker_install_configure
docker_compose_install
pnf_sim_file_checkout
start_simulator

Using heat template:

...

Verify that all docker containers are up :

Code Block
languagebash
[root@pnf-sim ~]# docker ps -a
CONTAINER ID        IMAGE                                             COMMAND                  CREATED             STATUS                          PORTS                  NAMES
bf0e6872738a        nexus3.onap.org:10003/onap/pnf-simulator:latest   "/bin/sh -c 'java -c…"   11 minutes ago      Restarting (1) 47 seconds ago                          pnf-simulator
05f16489d3ca        sysrepo/sysrepo-netopeer2:latest                  "/usr/bin/supervisor…"   14 minutes ago      Up 14 minutes                   0.0.0.0:830->830/tcp   netopeer
f1e73511a75e        atmoz/sftp:alpine                                 "/entrypoint sftp-us…"   14 minutes ago      Up 14 minutes                   0.0.0.0:2222->22/tcp   sftp-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 ~/sim/config/config.json

    Code Block
    languagejs
    titleonfig.json
    {
      "simulatorParams": {
        "vesServerUrl": "http://<VES-HOST>:<VES-PORT>/eventListener/v7",
        "testDuration": "10",
        "messageInterval": "1"
      },
      "messageParams": {
        "pnf_serialNumber": "6061ZW3",
        "pnf_vendorName": "Nokia",
        "pnf_oamV4IpAddress": "val3",
        "pnf_oamV6IpAddress": "val4",
        "pnf_unitFamily": "BBU",
        "pnf_modelNumber": "val6",
        "pnf_softwareVersion": "val7",
        "pnf_unitType": "val8",
        "eventName": "pnfRegistration_Nokia_5gDu",
        "nfNamingCode": "gNB",
        "nfcNamingCode": "oam",
        "sourceName": "NOK6061ZW3",
        "sourceId": "val13",
        "reportingEntityName": "NOK6061ZW3"
      }
    }
    

    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

...

Stopping  PNF registration events simulation

...

Running and using simulator

https://docs.onap.org/projects/onap-integration/en/latest/simulators/nf_simulator.html