Add HOT parameters for the simulator 85/110485/2
authorBartek Grzybowski <b.grzybowski@partner.samsung.com>
Thu, 23 Jul 2020 09:08:36 +0000 (11:08 +0200)
committerPaweł Wieczorek <p.wieczorek2@samsung.com>
Mon, 27 Jul 2020 12:46:58 +0000 (12:46 +0000)
Run simulator instances from runner script

Change-Id: I9d9a317c378a84b1846821916fee5f47452944c5
Issue-ID: INT-1662
Signed-off-by: Bartek Grzybowski <b.grzybowski@partner.samsung.com>
test/mocks/mass-pnf-sim/deployment/heat/heat.env
test/mocks/mass-pnf-sim/deployment/heat/heat.yaml
test/mocks/mass-pnf-sim/deployment/heat/mass-pnf-sim_run.sh

index feed7d2..3e402fe 100644 (file)
@@ -4,3 +4,7 @@ parameters:
   key_name:
   instance_net_id:
   float_net_id:
+  simulator_instances:
+  ves_url:
+  ftp_user:
+  ftp_password:
index be6032e..9718c5c 100644 (file)
@@ -17,6 +17,18 @@ parameters:
   instance_net_id:
     type: string
     description: Id of a private network for instance interface
+  simulator_instances:
+    type: number
+    description: Number of simulator instances to run on cloud instance
+  ves_url:
+    type: string
+    description: VES Collector url
+  ftp_user:
+    type: string
+    description: Username for the ftp server
+  ftp_password:
+    type: string
+    description: Password for the ftp server
 resources:
   config:
     type: OS::Heat::SoftwareConfig
@@ -27,7 +39,15 @@ resources:
     type: OS::Heat::SoftwareConfig
     properties:
       config:
-        get_file: mass-pnf-sim_run.sh
+        str_replace:
+          template:
+            get_file: mass-pnf-sim_run.sh
+          params:
+            $SIMULATOR_INSTANCES: { get_param: simulator_instances }
+            $VES_URL: { get_param: ves_url }
+            $FILE_SERVER: { get_attr: [simulator_floating_ip, floating_ip_address] }
+            $FTP_USER: { get_param: ftp_user }
+            $FTP_PASSWORD: { get_param: ftp_password }
   sim_script_file:
     type: OS::Heat::CloudConfig
     properties:
@@ -36,13 +56,18 @@ resources:
           - path: /root/mass-pnf-sim_run.sh
             content:
               get_attr: [sim_script, config]
+  simulator_port:
+    type: OS::Neutron::Port
+    properties:
+      network:
+        get_param: instance_net_id
   simulator_floating_ip:
     type: OS::Neutron::FloatingIP
     properties:
       floating_network:
         get_param: float_net_id
       port_id:
-        get_attr: [simulator, addresses, get_param: instance_net_id, 0, port]
+        get_resource: simulator_port
   cloud_config:
     type: OS::Heat::MultipartMime
     properties:
@@ -62,8 +87,8 @@ resources:
       flavor:
         get_param: flavor_name
       networks:
-        - network:
-            get_param: instance_net_id
+        - port:
+            get_resource: simulator_port
       user_data_format: RAW
       user_data:
         get_resource: cloud_config
index 8200536..2088000 100644 (file)
@@ -4,3 +4,8 @@ git clone https://git.onap.org/integration
 pushd integration/test/mocks/mass-pnf-sim
 ./setup.sh
 source .tox/MassPnfSim-runtime/bin/activate
+./mass-pnf-sim.py build
+./mass-pnf-sim.py bootstrap --count $SIMULATOR_INSTANCES --urlves $VES_URL --ipfileserver $FILE_SERVER --typefileserver ftps --ipstart 10.11.0.16 --user $FTP_USER --password $FTP_PASSWORD
+./mass-pnf-sim.py start
+sleep 30
+./mass-pnf-sim.py trigger