summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcin Migdal <marcin.migdal@nokia.com>2018-08-30 14:39:02 +0200
committerMarcin Migdal <marcin.migdal@nokia.com>2018-08-30 14:55:05 +0200
commit01473522bb70ef4df7f4bfd2c49dbb8bd1178cbf (patch)
treef83eb8ec151d61ddc6e3a70c0bb9f425ac752dbb
parent136068d7a5d421eb6bde8b9e49efcf4e202aa87b (diff)
Draft for INT-607
Logging with SSH keys Change-Id: I7749b67723a7025c39d404ae31de985fafc80eab Issue-ID: INT-607 Signed-off-by: Marcin Migdal <marcin.migdal@nokia.com>
-rw-r--r--test/mocks/pnfsimulator/README.md6
-rw-r--r--test/mocks/pnfsimulator/docker-compose.yml3
-rw-r--r--test/mocks/pnfsimulator/ssh/ssh_host_rsa_key54
-rw-r--r--test/mocks/pnfsimulator/ssh/ssh_host_rsa_key.pub1
4 files changed, 63 insertions, 1 deletions
diff --git a/test/mocks/pnfsimulator/README.md b/test/mocks/pnfsimulator/README.md
index a2a5e5539..d53a07521 100644
--- a/test/mocks/pnfsimulator/README.md
+++ b/test/mocks/pnfsimulator/README.md
@@ -26,6 +26,12 @@ It is possible to get access to logs by invocation of *./simulator.sh* logs.
The content of the logs is related to the last simulator run.
Every start of simulator will generate new logs.
+###SFTP support
+PNF Simulator allows to serve files via SFTP server. SFTP server has predefined user sftp-user.
+Connection to SFTP server is being done with usage of SSH keys. Private key is stored in *ssh* directory.
+In order to download *sftp-file.txt* file simply run *sftp -P 2222 -i ssh/ssh_host_rsa_key sftp-user@localhost:sftp/sftp-file.txt*
+In order to add a new file (e.g. test.zip), put the file into *sftp* directory and run simulator.
+After that again execute sftp command: *sftp -P 2222 -i ssh/ssh_host_rsa_key sftp-user@localhost:sftp/test.zip*
###Developer mode
For development of PNF Simulator, run *simulator.sh* start-dev in order to run Netopeer.
diff --git a/test/mocks/pnfsimulator/docker-compose.yml b/test/mocks/pnfsimulator/docker-compose.yml
index 6a381bd75..5f73cde74 100644
--- a/test/mocks/pnfsimulator/docker-compose.yml
+++ b/test/mocks/pnfsimulator/docker-compose.yml
@@ -35,5 +35,6 @@ services:
- "2222:22"
volumes:
- ./sftp:/home/sftp-user/sftp
+ - ./ssh/ssh_host_rsa_key.pub:/home/sftp-user/.ssh/keys/ssh_host_rsa_key.pub:ro
restart: on-failure
- command: sftp-user:sftp-password \ No newline at end of file
+ command: sftp-user::1001 \ No newline at end of file
diff --git a/test/mocks/pnfsimulator/ssh/ssh_host_rsa_key b/test/mocks/pnfsimulator/ssh/ssh_host_rsa_key
new file mode 100644
index 000000000..1a3c49e37
--- /dev/null
+++ b/test/mocks/pnfsimulator/ssh/ssh_host_rsa_key
@@ -0,0 +1,54 @@
+-----BEGIN RSA PRIVATE KEY-----
+Proc-Type: 4,ENCRYPTED
+DEK-Info: AES-128-CBC,242034B2C46EE5D70C6017C29024CFAE
+
+33cZKnNILWwb7Xlw4sQLEWp5w72vS8znQr/T4Hd7mCxoxrTJM0Cm3oNM6zK92kMp
+tXtJiT/Mpz6zmlUrKwhcESk+4ovNHGkzVCyYQfofkb5jyYHT92HXA8H1Qd1oyKBA
+8DUDFdFqlW2EZS7joDrU/ImpWkAI4gysbhg40QUeWbjlO/gyzii7/gu6AgZ3RF8l
+hKu4600kk7m3xa28GqMm53k2TVlgAI7JBiFH/aTxeHhntjpO2NRwtQ+YQlx8DveH
+CXw1+RhfWa2CtBPosstuAza+8NPRreIclUjMBKz7FDWIucnMbBhLCoyZyCRctYy5
+exzIkjQ3Uacz0aV9GTNvmJ4HiratKPPsMzCVggk6bxQy+DfvcYdoP/Z8vsLvhCkg
+usOWh5EUDI918rPwwA6O9fZce8QJHp/SY29m5JboafWN9raUMd0Szdc3DcNYK0oR
+04dF7FZuRhrBY8c0xPJV99K9091Hnr9gJU+0dst6naw6z/X5ZXra+pBIPEAFkRdy
+eZLAr9sKsjEhEb+jY1T/PI2sfR1B9dygCZW/nqrpqHKqjxZ034R9AmrpSRiwb8BJ
+1omLjh49J6ys7ibmY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
+8R8F/ArtsSGsw+KJqK5Uyf+2LzL9BNdv80EiRKkubJ8+ODdRrBMNCT/hPRY7iACX
+UEudm5DA0Ai5NOyUDV7kVyW9C7SFaXoMtG0NO7TL5cBZ63uFpsoBrk+Y4tepgVIx
++8beinOJSBAu7HlTyj4eS2L+TQbPIf7j+UwPh2FKNvloVeXku3IUtyRjfcRlWpct
+5sjAXvtc+elSAVVoX9J1fAltepsRG9sd9iFTNTpiOC6nrvWuVz8jrbCitFuvKYnm
+tD5bqRmGLkqYrwz+MSkA7cFCE50F5WPXVkRxp/bZ1ds+fh/Ymx9UwlsUqgRpHsGb
+ZhpJZALukr2YDGw4mSyTtRE9uhGW7+YFSHp1TL6wEUHAT5GwqrY2MioZ2Da6vVYD
+SZv+uusSWHjaiJpkuoqOOnPfdFDse8Khc4xBsOMLgAc86wfjZtD3gWBcDkRdD81C
+-----END RSA PRIVATE KEY-----
diff --git a/test/mocks/pnfsimulator/ssh/ssh_host_rsa_key.pub b/test/mocks/pnfsimulator/ssh/ssh_host_rsa_key.pub
new file mode 100644
index 000000000..619333558
--- /dev/null
+++ b/test/mocks/pnfsimulator/ssh/ssh_host_rsa_key.pub
@@ -0,0 +1 @@
+ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCiZJaJfjmjnaJqHTcYG8DkrU1Mr7WAmGR70QVd4mDxmM5vPm26nOv3uDO0sSwjP/sDGyVzlaxwlnfBfVZwJbMMf6sEPMNCLvBSwT4E6vf9rKwXqUIzj8hZuvOd7RPp241Z29CkL6aep6QNSk3NOlu4mxGMv+WJwyoDq8ya+ePEXQgl5QipabAmXFOKk1x15z9tcs9Dw5JvKkCpjpJ7zAd9tkmuiramS9OlETy8BJ0QkMj3ucNuqDsUkUzvKnnWHVcykmacJY3v3D9S4BoqLc1XZTVB4oRg0GlOCqOMQeVLP/jxtzVYiK5EsHbC55qhC9i8IaaSyeN66hgWwIh6FHhPMHr40vRKyliZGK0aBP+paS0V1PvNUW9+sb3ZDB/7mu/0yp06yGpqJAAFRQCZzNqiWbbQy1s/+HQbtUwVr7gnY2jhhAv8bcBPwTtIctg/rO/WDWJJsLzuFnb7fGkFL+EqAt0qozDSL5bDzJgylg00Y6GM1ebvBluNE+71n1TigInlIvKWHKtrAtiHQwXLOS/v3aEoepgJKiwABvYXiB2QNXqxkbrnFoT4+byhmakG3SVmDCDUlbQoDJpKLekwt5dezSuDNdFeC1TxUahfsBcOOG1TOxrsCKJU+ZoMXVXsouAAshpWiSZGZR2imXFLcRfDV5FI2bRZPv+WADzuzsfkJw== \ No newline at end of file