Add sftp strict host key checking to DFC in 5G-bulkpm test

Issue-ID: DCAEGEN2-2219
Signed-off-by: Remigiusz Janeczek <remigiusz.janeczek@nokia.com>
Change-Id: Ie616b5a3ac4228442bc0623d28f0d9c560fde696
diff --git a/plans/usecases-5G-bulkpm/5G-bulkpm/setup.sh b/plans/usecases-5G-bulkpm/5G-bulkpm/setup.sh
index 1f5f26d..8cb3d9f 100644
--- a/plans/usecases-5G-bulkpm/5G-bulkpm/setup.sh
+++ b/plans/usecases-5G-bulkpm/5G-bulkpm/setup.sh
@@ -78,6 +78,11 @@
 DMAAP_MR_IP=$(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' dmaap-message-router-server)
 VESC_IP=$(docker inspect '--format={{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' dcaegen2-vescollector)
 
+#Add SFTP server pubilc key to known hosts of datafile collector
+HOST_NAMES=$(docker inspect -f '{{ range .NetworkSettings.Networks}}{{join .Aliases ","}}{{end}}' sftp)
+KEY_ENTRY=$(echo $HOST_NAMES "$(docker exec sftp cat /etc/ssh/ssh_host_rsa_key.pub)" | sed -e 's/\w*@\w*$//')
+docker exec -i -u root dcaegen2-datafile-collector sh -c "echo $KEY_ENTRY >> /home/datafile/.ssh/known_hosts"
+
 # Add gateway IP to DR Prov
 docker exec -i datarouter-prov sh -c "curl -k  -X PUT https://$DR_PROV_IP:8443/internal/api/NODES?val=dmaap-dr-node\|$DR_GATEWAY_IP"
 docker exec -i datarouter-prov sh -c "curl -k  -X PUT https://$DR_PROV_IP:8443/internal/api/PROV_AUTH_ADDRESSES?val=dmaap-dr-prov\|$DR_GATEWAY_IP"
@@ -116,4 +121,4 @@
 export DMAAP_MR_IP=${DMAAP_MR_IP}
 
 #Pass any variables required by Robot test suites in ROBOT_VARIABLES
-ROBOT_VARIABLES="-v DR_PROV_IP:${DR_PROV_IP} -v DMAAP_MR_IP:${DMAAP_MR_IP} -v VESC_IP:${VESC_IP} -v VESC_PORT:${VESC_PORT}"
\ No newline at end of file
+ROBOT_VARIABLES="-v DR_PROV_IP:${DR_PROV_IP} -v DMAAP_MR_IP:${DMAAP_MR_IP} -v VESC_IP:${VESC_IP} -v VESC_PORT:${VESC_PORT}"