diff options
author | Bartek Grzybowski <b.grzybowski@partner.samsung.com> | 2020-07-21 11:06:27 +0200 |
---|---|---|
committer | Paweł Wieczorek <p.wieczorek2@samsung.com> | 2020-07-27 12:46:58 +0000 |
commit | 6c4d32e5f5c2f68796c66819f2f3de1652a5f3c1 (patch) | |
tree | cd98fac1bb8778293f69f0f9b0b8213a0f3d388f /test | |
parent | 18aaab4bd16d410815f81906227aa82a77171296 (diff) |
Setup runner script for the simulator in HOT
This adds shell runner script and HOT setup to
deploy and run it.
Change-Id: I88b9b516f38dac789da1caa050192358829e9357
Issue-ID: INT-1661
Signed-off-by: Bartek Grzybowski <b.grzybowski@partner.samsung.com>
Diffstat (limited to 'test')
3 files changed, 35 insertions, 2 deletions
diff --git a/test/mocks/mass-pnf-sim/deployment/heat/cloud-config.yaml b/test/mocks/mass-pnf-sim/deployment/heat/cloud-config.yaml index 73d9f090b..583c1a54f 100644 --- a/test/mocks/mass-pnf-sim/deployment/heat/cloud-config.yaml +++ b/test/mocks/mass-pnf-sim/deployment/heat/cloud-config.yaml @@ -8,8 +8,11 @@ packages: - docker-ce - docker-ce-cli - containerd.io + - docker-compose + - python3-virtualenv + - python3-pip # Docker's apt key needs to be injected early in the boot as 'apt' cloud-init -# module doesn't support configuring key from file +# module doesn't support configuring key from file bootcmd: - [curl, "https://download.docker.com/linux/ubuntu/gpg", -o, /run/docker.key] - [apt-key, add, /run/docker.key] @@ -17,3 +20,6 @@ apt: sources: docker: source: "deb [arch=amd64] https://download.docker.com/linux/ubuntu $RELEASE stable" +runcmd: + - [pip3, install, tox] + - [bash, /root/mass-pnf-sim_run.sh] diff --git a/test/mocks/mass-pnf-sim/deployment/heat/heat.yaml b/test/mocks/mass-pnf-sim/deployment/heat/heat.yaml index 9664ea0ad..be6032eb7 100644 --- a/test/mocks/mass-pnf-sim/deployment/heat/heat.yaml +++ b/test/mocks/mass-pnf-sim/deployment/heat/heat.yaml @@ -23,6 +23,19 @@ resources: properties: config: get_file: cloud-config.yaml + sim_script: + type: OS::Heat::SoftwareConfig + properties: + config: + get_file: mass-pnf-sim_run.sh + sim_script_file: + type: OS::Heat::CloudConfig + properties: + cloud_config: + write_files: + - path: /root/mass-pnf-sim_run.sh + content: + get_attr: [sim_script, config] simulator_floating_ip: type: OS::Neutron::FloatingIP properties: @@ -30,6 +43,14 @@ resources: get_param: float_net_id port_id: get_attr: [simulator, addresses, get_param: instance_net_id, 0, port] + cloud_config: + type: OS::Heat::MultipartMime + properties: + parts: + - config: + get_resource: config + - config: + get_resource: sim_script_file simulator: type: OS::Nova::Server properties: @@ -45,7 +66,7 @@ resources: get_param: instance_net_id user_data_format: RAW user_data: - get_resource: config + get_resource: cloud_config outputs: simulator_instance_id: description: ID of the simulator instance diff --git a/test/mocks/mass-pnf-sim/deployment/heat/mass-pnf-sim_run.sh b/test/mocks/mass-pnf-sim/deployment/heat/mass-pnf-sim_run.sh new file mode 100644 index 000000000..8200536b4 --- /dev/null +++ b/test/mocks/mass-pnf-sim/deployment/heat/mass-pnf-sim_run.sh @@ -0,0 +1,6 @@ +#!/bin/bash +pushd /root +git clone https://git.onap.org/integration +pushd integration/test/mocks/mass-pnf-sim +./setup.sh +source .tox/MassPnfSim-runtime/bin/activate |