Add runtest tests for neutron formula
Add module and state tests for neutron salt formula
Change-Id: Id9caaa0a80b625147ecfb1b55a1be7c57bb371ff
Related-Prod: PROD-21213
diff --git a/runtest/salttest/modules/openstack/init.sls b/runtest/salttest/modules/openstack/init.sls
index bd022ae..a9d6334 100644
--- a/runtest/salttest/modules/openstack/init.sls
+++ b/runtest/salttest/modules/openstack/init.sls
@@ -4,5 +4,6 @@
- runtest.salttest.modules.openstack.keystone
- runtest.salttest.modules.openstack.nova
- runtest.salttest.modules.openstack.neutron
+- runtest.salttest.modules.openstack.neutronv2
- runtest.salttest.modules.openstack.cinderv3
- runtest.salttest.modules.openstack.heatv1
diff --git a/runtest/salttest/modules/openstack/neutronv2.sls b/runtest/salttest/modules/openstack/neutronv2.sls
new file mode 100644
index 0000000..eeb5b56
--- /dev/null
+++ b/runtest/salttest/modules/openstack/neutronv2.sls
@@ -0,0 +1,134 @@
+{%- set neutron_test_network = 'NeutronTestNetwork' %}
+{%- set neutron_bulk_test_network = 'NeutronTestBulkNetworks' %}
+{%- set neutron_test_subnet = 'NeutronTestSubnet' %}
+{%- set neutron_test_subnet_pool = 'NeutronTestSubnetPool' %}
+
+neutronv2_network_create:
+ module.run:
+ - name: neutronv2.network_create
+ - kwargs:
+ cloud_name: admin_identity
+ name: {{ neutron_test_network }}
+
+neutronv2_network_bulk_create:
+ module.run:
+ - name: neutronv2.network_bulk_create
+ - kwargs:
+ cloud_name: admin_identity
+ networks:
+ - name: {{ neutron_bulk_test_network }}
+
+neutronv2_subnet_create:
+ module.run:
+ - name: neutronv2.subnet_create
+ - kwargs:
+ cloud_name: admin_identity
+ name: {{ neutron_test_subnet }}
+ ip_version: 4
+ cidr: 192.168.88.0/24
+ network_id: {{ neutron_test_network }}
+
+neutronv2_subnetpool_create:
+ module.run:
+ - name: neutronv2.subnetpool_create
+ - kwargs:
+ cloud_name: admin_identity
+ name: {{ neutron_test_subnet_pool }}
+ prefixes: [203.0.113.0/24]
+
+neutronv2_subnet_list:
+ module.run:
+ - name: neutronv2.subnet_list
+ - kwargs:
+ cloud_name: admin_identity
+
+neutronv2_network_list:
+ module.run:
+ - name: neutronv2.network_list
+ - kwargs:
+ cloud_name: admin_identity
+
+neutronv2_subnetpool_list:
+ module.run:
+ - name: neutronv2.subnetpool_list
+ - kwargs:
+ cloud_name: admin_identity
+
+neutronv2_subnet_get_details:
+ module.run:
+ - name: neutronv2.subnet_get_details
+ - args:
+ - {{ neutron_test_subnet }}
+ - kwargs:
+ cloud_name: admin_identity
+
+neutronv2_subnetpool_get_details:
+ module.run:
+ - name: neutronv2.subnetpool_get_details
+ - args:
+ - {{ neutron_test_subnet_pool }}
+ - kwargs:
+ cloud_name: admin_identity
+
+neutronv2_network_get_details:
+ module.run:
+ - name: neutronv2.network_get_details
+ - kwargs:
+ cloud_name: admin_identity
+ name: {{ neutron_test_network }}
+
+neutronv2_subnet_update:
+ module.run:
+ - name: neutronv2.subnet_update
+ - args:
+ - {{ neutron_test_subnet }}
+ - kwargs:
+ cloud_name: admin_identity
+ description: NeutronTestSubnetDescription
+
+neutronv2_subnetpool_update:
+ module.run:
+ - name: neutronv2.subnetpool_update
+ - args:
+ - {{ neutron_test_subnet_pool }}
+ - kwargs:
+ cloud_name: admin_identity
+ description: NeutronTestSubnetPoolDescription
+
+neutronv2_network_update:
+ module.run:
+ - name: neutronv2.network_update
+ - kwargs:
+ cloud_name: admin_identity
+ name: {{ neutron_test_network }}
+ description: NeutronTestNetworkDescription
+
+neutronv2_subnet_delete:
+ module.run:
+ - name: neutronv2.subnet_delete
+ - args:
+ - {{ neutron_test_subnet }}
+ - kwargs:
+ cloud_name: admin_identity
+
+neutronv2_subnetpool_delete:
+ module.run:
+ - name: neutronv2.subnetpool_delete
+ - args:
+ - {{ neutron_test_subnet_pool }}
+ - kwargs:
+ cloud_name: admin_identity
+
+neutronv2_network_delete:
+ module.run:
+ - name: neutronv2.network_delete
+ - kwargs:
+ cloud_name: admin_identity
+ name: {{ neutron_test_network }}
+
+neutronv2_bulk_network_delete:
+ module.run:
+ - name: neutronv2.network_delete
+ - kwargs:
+ cloud_name: admin_identity
+ name: {{ neutron_bulk_test_network }}
\ No newline at end of file
diff --git a/runtest/salttest/states/openstack/init.sls b/runtest/salttest/states/openstack/init.sls
index 12c48bf..bb70bb0 100644
--- a/runtest/salttest/states/openstack/init.sls
+++ b/runtest/salttest/states/openstack/init.sls
@@ -1,5 +1,6 @@
include:
- runtest.salttest.states.openstack.neutron
+- runtest.salttest.states.openstack.neutronv2
- runtest.salttest.states.openstack.nova
- runtest.salttest.states.openstack.glancev2
- runtest.salttest.states.openstack.cinderv3
diff --git a/runtest/salttest/states/openstack/neutronv2.sls b/runtest/salttest/states/openstack/neutronv2.sls
new file mode 100644
index 0000000..a2221a7
--- /dev/null
+++ b/runtest/salttest/states/openstack/neutronv2.sls
@@ -0,0 +1,37 @@
+{%- set neutron_test_network = 'NeutronStateTestNetwork' %}
+{%- set neutron_test_subnet = 'NeutronStateTestSubnet' %}
+{%- set neutron_test_subnet_pool = 'NeutronStateTestSubnetPool' %}
+
+neutronv2_network_present:
+ neutronv2.network_present:
+ - cloud_name: admin_identity
+ - name: {{ neutron_test_network }}
+
+neutronv2_subnet_present:
+ neutronv2.subnet_present:
+ - name: {{ neutron_test_subnet }}
+ - cloud_name: admin_identity
+ - network_id: {{ neutron_test_network }}
+ - ip_version: 4
+ - cidr: 192.168.89.0/24
+
+neutronv2_subnetpool_present:
+ neutronv2.subnetpool_present:
+ - cloud_name: admin_identity
+ - name: {{ neutron_test_subnet_pool }}
+ - prefixes: [203.0.113.0/24]
+
+neutronv2_subnetpool_absent:
+ neutronv2.subnetpool_absent:
+ - cloud_name: admin_identity
+ - name: {{ neutron_test_subnet_pool }}
+
+neutronv2_subnet_absent:
+ neutronv2.subnet_absent:
+ - cloud_name: admin_identity
+ - name: {{ neutron_test_subnet }}
+
+neutronv2_network_absent:
+ neutronv2.network_absent:
+ - cloud_name: admin_identity
+ - name: {{ neutron_test_network }}