aboutsummaryrefslogtreecommitdiffstats
path: root/test/mocks
diff options
context:
space:
mode:
Diffstat (limited to 'test/mocks')
-rw-r--r--test/mocks/pnfsimulator/README.md22
-rw-r--r--test/mocks/pnfsimulator/deployment/PnP_PNF_sim_heat_template.yml37
-rw-r--r--test/mocks/pnfsimulator/docker-compose.yml5
-rw-r--r--test/mocks/pnfsimulator/ftpes/files/ftpes-noone.txt0
-rw-r--r--test/mocks/pnfsimulator/ftpes/files/onap/ftpes-onap.txt0
-rw-r--r--test/mocks/pnfsimulator/pom.xml16
-rw-r--r--test/mocks/pnfsimulator/src/assembly/resources.xml65
7 files changed, 115 insertions, 30 deletions
diff --git a/test/mocks/pnfsimulator/README.md b/test/mocks/pnfsimulator/README.md
index 14b62eecc..567c5d06b 100644
--- a/test/mocks/pnfsimulator/README.md
+++ b/test/mocks/pnfsimulator/README.md
@@ -36,13 +36,25 @@ After that again execute sftp command: *sftp -P 2222 -i ssh/ssh_host_rsa_key sft
In order to disable usage of SSH keys and start using password, change in *docker-compose.yml* service *sftp-service* entry *command* from *sftp-user::1001* to *sftp-user:password:1001*
###FTPES support
-PNF Simulator allows to serve files via FTPES server. FTPES server has predefined user: onap with password: pano.
-In order to connect we execute command *ftp-ssl host* and then enter user name and password.
-In order to download execute command while logged in*get file_name*.
-In order to add a new file execute command while logged in*put file_name*.
+PNF Simulator allows to serve files via FTPES server. FTPES server has predefined user *onap* with password *pano*.
+
+####FTPES support with TLS enabled
+By default TLS support is enabled. In order to verify connection, please use *FileZilla* for testing.
+
+####FTPES support for TLS disabled
+For local testing TLS may be disabled, but it's not recommended.
+In order to set up such configuration, comment or remove in *ftpes-server* service section in *docker-compose.yml* following entries:
+- *./ftpes/tls/:/etc/ssl/private/*
+- *ADDED_FLAGS: --tls=2*
+
+After that execute *./simulator.sh stop* and when it's finished *./simulator.sh start* .
+
+In order to connect execute command *ftp -p localhost 2221* and, when requested, provide user and password.
+In order to download a file execute, while still being logged in, *get file-name-to-be-downloaded*.
+
###Developer mode
-For development of PNF Simulator, run *simulator.sh* start-dev in order to run Netopeer.
+For development of PNF Simulator, run *simulator.sh* start-dev in order to run minimal necessary set of supporting services such as Netopeer of FTP servers.
After that it is possible to run PNF Simulator from IDE.
diff --git a/test/mocks/pnfsimulator/deployment/PnP_PNF_sim_heat_template.yml b/test/mocks/pnfsimulator/deployment/PnP_PNF_sim_heat_template.yml
index d9acc9e37..4bf6758d9 100644
--- a/test/mocks/pnfsimulator/deployment/PnP_PNF_sim_heat_template.yml
+++ b/test/mocks/pnfsimulator/deployment/PnP_PNF_sim_heat_template.yml
@@ -42,7 +42,7 @@ resources:
dnf -y install fedora-upgrade
}
- docker_install_configure () {
+ docker_remove () {
dnf -y remove docker \
docker-client \
docker-client-latest \
@@ -53,6 +53,9 @@ resources:
docker-selinux \
docker-engine-selinux \
docker-engine
+ }
+
+ docker_install_and_configure () {
dnf -y install dnf-plugins-core
dnf config-manager \
--add-repo \
@@ -67,41 +70,27 @@ resources:
EOF
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
+ 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 (){
- ~/sim/simulator.sh start
+ 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_install_configure
+ docker_remove
+ docker_install_and_configure
docker_compose_install
pnf_sim_file_checkout
start_simulator
@@ -126,4 +115,4 @@ outputs:
value: { get_attr: [ PNF_PnP_simualtor, first_address ] }
PNF_PnP_simualtor_public_ip:
description: Floating IP address of PNF_PnP_simualtor in public network
- value: { get_attr: [ PNF_PnP_simualtor_public, floating_ip_address ] }
+ value: { get_attr: [ PNF_PnP_simualtor_public, floating_ip_address ] } \ No newline at end of file
diff --git a/test/mocks/pnfsimulator/docker-compose.yml b/test/mocks/pnfsimulator/docker-compose.yml
index 3d23e00c9..214a7733a 100644
--- a/test/mocks/pnfsimulator/docker-compose.yml
+++ b/test/mocks/pnfsimulator/docker-compose.yml
@@ -45,11 +45,14 @@ services:
image: stilliard/pure-ftpd:latest
ports:
- "2221:21"
+ - "30000-30009:30000-30009"
volumes:
+ - ./ftpes/files:/home/ftpusers/onap
- ./ftpes/userpass/:/etc/pure-ftpd/passwd/
- ./ftpes/tls/:/etc/ssl/private/
- - ./ftpes/files:/home/onap
+
environment:
PUBLICHOST: localhost
ADDED_FLAGS: --tls=2
+ FTP_USER_HOME: onap
restart: on-failure \ No newline at end of file
diff --git a/test/mocks/pnfsimulator/ftpes/files/ftpes-noone.txt b/test/mocks/pnfsimulator/ftpes/files/ftpes-noone.txt
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/test/mocks/pnfsimulator/ftpes/files/ftpes-noone.txt
diff --git a/test/mocks/pnfsimulator/ftpes/files/onap/ftpes-onap.txt b/test/mocks/pnfsimulator/ftpes/files/onap/ftpes-onap.txt
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/test/mocks/pnfsimulator/ftpes/files/onap/ftpes-onap.txt
diff --git a/test/mocks/pnfsimulator/pom.xml b/test/mocks/pnfsimulator/pom.xml
index b4adcd806..c8355dcd2 100644
--- a/test/mocks/pnfsimulator/pom.xml
+++ b/test/mocks/pnfsimulator/pom.xml
@@ -168,6 +168,22 @@
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <configuration>
+ <descriptor>src/assembly/resources.xml</descriptor>
+ <finalName>${project.artifactId}-${pom.version}</finalName>
+ </configuration>
+ <executions>
+ <execution>
+ <phase>package</phase>
+ <goals>
+ <goal>single</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.7.0</version>
<configuration>
diff --git a/test/mocks/pnfsimulator/src/assembly/resources.xml b/test/mocks/pnfsimulator/src/assembly/resources.xml
new file mode 100644
index 000000000..8754ecc4b
--- /dev/null
+++ b/test/mocks/pnfsimulator/src/assembly/resources.xml
@@ -0,0 +1,65 @@
+<assembly>
+ <id>resources</id>
+ <formats>
+ <format>zip</format>
+ </formats>
+
+ <fileSets>
+ <fileSet>
+ <includes>
+ <include>simulator.sh</include>
+ </includes>
+ <lineEnding>unix</lineEnding>
+ <fileMode>0755</fileMode>
+ </fileSet>
+ <fileSet>
+ <directory>config</directory>
+ <outputDirectory>config</outputDirectory>
+ <includes>
+ <include>**/*</include>
+ </includes>
+ </fileSet>
+ <fileSet>
+ <directory>deployment</directory>
+ <outputDirectory>deployment</outputDirectory>
+ <includes>
+ <include>**/*</include>
+ </includes>
+ </fileSet>
+ <fileSet>
+ <directory>ftpes</directory>
+ <outputDirectory>ftpes</outputDirectory>
+ <includes>
+ <include>**/*</include>
+ </includes>
+ </fileSet>
+ <fileSet>
+ <directory>json_schema</directory>
+ <outputDirectory>json_schema</outputDirectory>
+ <includes>
+ <include>**/*</include>
+ </includes>
+ </fileSet>
+ <fileSet>
+ <directory>netconf</directory>
+ <outputDirectory>netconf</outputDirectory>
+ <includes>
+ <include>**/*</include>
+ </includes>
+ </fileSet>
+ <fileSet>
+ <directory>sftp</directory>
+ <outputDirectory>sftp</outputDirectory>
+ <includes>
+ <include>**/*</include>
+ </includes>
+ </fileSet>
+ <fileSet>
+ <directory>ssh</directory>
+ <outputDirectory>ssh</outputDirectory>
+ <includes>
+ <include>**/*</include>
+ </includes>
+ </fileSet>
+ </fileSets>
+</assembly> \ No newline at end of file