Add runtest tests for heat formula
Add module and state tests for heat salt formula
Change-Id: I09a1af304b2bd092fb843ee7a50da742704a8114
Related-Prod: PROD-20862
diff --git a/runtest/files/heat_test_tempate.yml b/runtest/files/heat_test_tempate.yml
new file mode 100644
index 0000000..552fd22
--- /dev/null
+++ b/runtest/files/heat_test_tempate.yml
@@ -0,0 +1,16 @@
+heat_template_version: 2015-10-15
+
+parameters:
+ length:
+ type: number
+ default: 100
+
+resources:
+ random:
+ type: OS::Heat::RandomString
+ properties:
+ length: {get_param: length}
+
+outputs:
+ value:
+ value: {get_attr: [random, value]}
diff --git a/runtest/salttest/modules/openstack/heatv1.sls b/runtest/salttest/modules/openstack/heatv1.sls
new file mode 100644
index 0000000..f819094
--- /dev/null
+++ b/runtest/salttest/modules/openstack/heatv1.sls
@@ -0,0 +1,50 @@
+create_heatv1_module_resource:
+ file.managed:
+ - name: /srv/heat/env/template/heat_test_tempate.yml
+ - source: salt://runtest/files/heat_test_tempate.yml
+ - template: jinja
+ - makedirs: true
+ - mode: 644
+ - user: root
+ - group: root
+
+heatv1_stack_create:
+ module.run:
+ - name: heatv1.stack_create
+ - kwargs:
+ cloud_name: admin_identity
+ name: TestHeatStack
+ template: heat_test_tempate.yml
+
+heatv1_stack_list:
+ module.run:
+ - name: heatv1.stack_list
+ - kwargs:
+ cloud_name: admin_identity
+
+heatv1_stack_show:
+ module.run:
+ - name: heatv1.stack_show
+ - kwargs:
+ cloud_name: admin_identity
+ name: TestHeatStack
+
+heatv1_stack_update:
+ module.run:
+ - name: heatv1.stack_update
+ - kwargs:
+ cloud_name: admin_identity
+ name: TestHeatStack
+ template: heat_test_tempate.yml
+
+heatv1_stack_delete:
+ module.run:
+ - name: heatv1.stack_delete
+ - kwargs:
+ cloud_name: admin_identity
+ name: TestHeatStack
+
+remove_heatv1_module_resource:
+ file.directory:
+ - name: /srv/heat
+ - clean: True
\ No newline at end of file
diff --git a/runtest/salttest/modules/openstack/init.sls b/runtest/salttest/modules/openstack/init.sls
index 54a7e30..bd022ae 100644
--- a/runtest/salttest/modules/openstack/init.sls
+++ b/runtest/salttest/modules/openstack/init.sls
@@ -5,3 +5,4 @@
- runtest.salttest.modules.openstack.nova
- runtest.salttest.modules.openstack.neutron
- runtest.salttest.modules.openstack.cinderv3
+- runtest.salttest.modules.openstack.heatv1
diff --git a/runtest/salttest/states/openstack/heatv1.sls b/runtest/salttest/states/openstack/heatv1.sls
new file mode 100644
index 0000000..471e4b9
--- /dev/null
+++ b/runtest/salttest/states/openstack/heatv1.sls
@@ -0,0 +1,25 @@
+create_heatv1_state_resource:
+ file.managed:
+ - name: /srv/heat/env/template/heat_test_tempate.yml
+ - source: salt://runtest/files/heat_test_tempate.yml
+ - template: jinja
+ - makedirs: true
+ - mode: 644
+ - user: root
+ - group: root
+
+heatv1_stack_present:
+ heatv1.stack_present:
+ - name: TestHeatStack
+ - cloud_name: admin_identity
+ - template: heat_test_tempate.yml
+
+heatv1_stack_absent:
+ heatv1.stack_absent:
+ - name: TestHeatStack
+ - cloud_name: admin_identity
+
+remove_heatv1_state_resource:
+ file.directory:
+ - name: /srv/heat
+ - clean: True
\ No newline at end of file
diff --git a/runtest/salttest/states/openstack/init.sls b/runtest/salttest/states/openstack/init.sls
index 2e14835..12c48bf 100644
--- a/runtest/salttest/states/openstack/init.sls
+++ b/runtest/salttest/states/openstack/init.sls
@@ -3,3 +3,4 @@
- runtest.salttest.states.openstack.nova
- runtest.salttest.states.openstack.glancev2
- runtest.salttest.states.openstack.cinderv3
+- runtest.salttest.states.openstack.heatv1