Added Kitchen tests and Travis
diff --git a/.kitchen.yml b/.kitchen.yml
new file mode 100644
index 0000000..06bfd00
--- /dev/null
+++ b/.kitchen.yml
@@ -0,0 +1,93 @@
+---
+driver:
+ name: docker
+ hostname: cinder.ci.local
+ use_sudo: false
+
+provisioner:
+ name: salt_solo
+ salt_install: bootstrap
+ salt_bootstrap_url: https://bootstrap.saltstack.com
+ salt_version: latest
+ require_chef: false
+ log_level: error
+ formula: cinder
+ grains:
+ noservices: True
+ state_top:
+ base:
+ "*":
+ - cinder
+ pillars:
+ top.sls:
+ base:
+ "*":
+ - cinder
+
+verifier:
+ name: inspec
+ sudo: true
+
+platforms:
+ - name: <%=ENV['PLATFORM'] || 'ubuntu-xenial'%>
+ driver_config:
+ image: <%=ENV['PLATFORM'] || 'trevorj/salty-whales:xenial'%>
+ platform: ubuntu
+
+suites:
+
+ - name: ceph_single
+ provisioner:
+ pillars-from-files:
+ cinder.sls: tests/pillar/ceph_single.sls
+
+ - name: control_cluster
+ provisioner:
+ pillars-from-files:
+ cinder.sls: tests/pillar/control_cluster.sls
+
+ - name: control_single
+ provisioner:
+ pillars-from-files:
+ cinder.sls: tests/pillar/control_single.sls
+
+ - name: eternus_single
+ provisioner:
+ pillars-from-files:
+ cinder.sls: tests/pillar/eternus_single.sls
+
+ - name: gpfs_single
+ provisioner:
+ pillars-from-files:
+ cinder.sls: tests/pillar/gpfs_single.sls
+
+ - name: hp3par_single
+ provisioner:
+ pillars-from-files:
+ cinder.sls: tests/pillar/hp3par_single.sls
+
+ - name: lefthand_single
+ provisioner:
+ pillars-from-files:
+ cinder.sls: tests/pillar/lefthand_single.sls
+
+ - name: solidfire_single
+ provisioner:
+ pillars-from-files:
+ cinder.sls: tests/pillar/solidfire_single.sls
+
+ - name: storwize_single
+ provisioner:
+ pillars-from-files:
+ cinder.sls: tests/pillar/storwize_single.sls
+
+ - name: volume_single
+ provisioner:
+ pillars-from-files:
+ cinder.sls: tests/pillar/volume_single.sls
+
+ - name: vsp_single
+ provisioner:
+ pillars-from-files:
+ cinder.sls: tests/pillar/vsp_single.sls
+# vim: ft=yaml sw=2 ts=2 sts=2 tw=125
diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 0000000..4c8e84e
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,29 @@
+sudo: required
+services:
+ - docker
+
+install:
+ - pip install PyYAML
+ - pip install virtualenv
+ - |
+ test -e Gemfile || cat <<EOF > Gemfile
+ source 'https://rubygems.org'
+ gem 'rake'
+ gem 'test-kitchen'
+ gem 'kitchen-docker'
+ gem 'kitchen-inspec'
+ gem 'inspec'
+ gem 'kitchen-salt', :git => 'https://github.com/epcim/kitchen-salt.git', :branch => 'dependencis-pkg-repo2'
+ #Waiting for PR#78
+ #gem 'kitchen-salt', '>=0.2.25'
+ - bundle install
+
+env:
+ - PLATFORM=trevorj/salty-whales:trusty
+ - PLATFORM=trevorj/salty-whales:xenial
+
+before_script:
+ - make test | tail
+
+script:
+ - test ! -e .kitchen.yml || bundle exec kitchen test -t tests/integration
diff --git a/cinder/files/backend/_hp3par.conf b/cinder/files/backend/_hp3par.conf
index 78ddfb7..4ed19ec 100644
--- a/cinder/files/backend/_hp3par.conf
+++ b/cinder/files/backend/_hp3par.conf
@@ -5,7 +5,7 @@
hp3par_api_url={{ backend.url }}
# 3PAR Super user username
-hp3par_username={{ backend.storage.user }}
+hp3par_username={{ backend.user }}
# 3PAR Super user password
hp3par_password={{ backend.password }}
diff --git a/cinder/volume.sls b/cinder/volume.sls
index 20b5adf..b5b53fd 100644
--- a/cinder/volume.sls
+++ b/cinder/volume.sls
@@ -15,8 +15,10 @@
- group: cinder
- require:
- pkg: cinder_volume_packages
+ {%- if not grains.get('noservices', False) %}
- require_in:
- service: cinder_volume_services
+ {%- endif %}
{%- if not pillar.cinder.get('controller', {}).get('enabled', False) %}
@@ -56,6 +58,8 @@
{%- if backend.engine in ['iscsi' , 'hp_lefthand'] %}
+{%- if grains.get('virtual_subtype', None) not in ['Docker', 'LXC'] %}
+
cinder_iscsi_packages_{{ loop.index }}:
pkg.installed:
- names:
@@ -72,6 +76,8 @@
- require:
- pkg: cinder_iscsi_packages
+{%- if not grains.get('noservices', False) %}
+
cinder_scsi_service:
service.running:
- names:
@@ -83,6 +89,10 @@
{%- endif %}
+{%- endif %}
+
+{%- endif %}
+
{%- if backend.engine == 'hitachi_vsp' %}
{%- if grains.os_family == 'Debian' and volume.version == 'juno' %}
@@ -113,9 +123,12 @@
{%- if backend.engine == 'fujitsu' %}
+{%- if grains.get('virtual_subtype', None) not in ['Docker', 'LXC'] %}
+
cinder_driver_fujitsu_{{ loop.index }}:
pkg.latest:
- name: cinder-driver-fujitsu
+ - refresh: true
/etc/cinder/cinder_fujitsu_eternus_dx_{{ backend_name }}.xml:
file.managed:
@@ -128,6 +141,8 @@
{%- endif %}
+{%- endif %}
+
{%- endfor %}
{%- endif %}
@@ -154,6 +169,8 @@
- require:
- pkg: cinder_iscsi_packages
+{%- if not grains.get('noservices', False) %}
+
cinder_scsi_service:
service.running:
- names:
@@ -165,6 +182,8 @@
{%- endif %}
+{%- endif %}
+
{%- if volume.storage.engine == 'hitachi_vsp' %}
{%- if grains.os_family == 'Debian' and volume.version == 'juno' %}
@@ -193,6 +212,8 @@
{%- endif %}
+{%- if grains.get('virtual_subtype', None) not in ['Docker', 'LXC'] %}
+
{%- if volume.storage.engine == 'fujitsu' %}
cinder_driver_fujitsu:
@@ -216,5 +237,7 @@
{%- endif %}
+{%- endif %}
+
{%- endif %}
diff --git a/metadata.yml b/metadata.yml
index af2198a..a16c24e 100644
--- a/metadata.yml
+++ b/metadata.yml
@@ -1,3 +1,3 @@
name: "cinder"
version: "2016.4.1"
-source: "https://github.com/openstack/salt-formula-cinder"
+source: "https://github.com/salt-formulas/salt-formula-cinder"
diff --git a/tests/pillar/ceph_single.sls b/tests/pillar/ceph_single.sls
index de5f2cc..79838a2 100644
--- a/tests/pillar/ceph_single.sls
+++ b/tests/pillar/ceph_single.sls
@@ -11,6 +11,35 @@
user: cinder
secret_uuid: password
client_cinder_key: password
+ identity:
+ engine: keystone
+ host: 127.0.0.1
+ port: 35357
+ tenant: service
+ user: cinder
+ password: pwd
+ region: regionOne
+ osapi:
+ host: 127.0.0.1
+ osapi_max_limit: 500
+ glance:
+ host: 127.0.0.1
+ port: 9292
+ default_volume_type: 7k2SaS
+ message_queue:
+ engine: rabbitmq
+ host: 127.0.0.1
+ port: 5672
+ user: openstack
+ password: pwd
+ virtual_host: '/openstack'
+ database:
+ engine: mysql
+ host: 127.0.0.1
+ port: 3306
+ name: cinder
+ user: cinder
+ password: pwd
volume:
enabled: true
version: liberty
@@ -22,4 +51,32 @@
engine: ceph
user: cinder
secret_uuid: password
- client_cinder_key: password
\ No newline at end of file
+ client_cinder_key: password
+ identity:
+ engine: keystone
+ host: 127.0.0.1
+ port: 35357
+ tenant: service
+ user: cinder
+ password: pwd
+ region: regionOne
+ osapi:
+ host: 127.0.0.1
+ glance:
+ host: 127.0.0.1
+ port: 9292
+ default_volume_type: 7k2SaS
+ message_queue:
+ engine: rabbitmq
+ host: 127.0.0.1
+ port: 5672
+ user: openstack
+ password: pwd
+ virtual_host: '/openstack'
+ database:
+ engine: mysql
+ host: 127.0.0.1
+ port: 3306
+ name: cinder
+ user: cinder
+ password: pwd
diff --git a/tests/pillar/control_cluster.sls b/tests/pillar/control_cluster.sls
index 9fcafb4..62bb44b 100644
--- a/tests/pillar/control_cluster.sls
+++ b/tests/pillar/control_cluster.sls
@@ -41,6 +41,12 @@
port: 11211
- host: 127.0.0.1
port: 11211
+ storage:
+ engine: storwize
+ host: 192.168.0.1
+ port: 22
+ user: username
+ password: pass
audit:
filter_factory: 'keystonemiddleware.audit:filter_factory'
diff --git a/tests/pillar/control_single.sls b/tests/pillar/control_single.sls
index 73a7a2e..ef2136a 100644
--- a/tests/pillar/control_single.sls
+++ b/tests/pillar/control_single.sls
@@ -30,3 +30,9 @@
user: openstack
password: password
virtual_host: '/openstack'
+ storage:
+ engine: storwize
+ host: 192.168.0.1
+ port: 22
+ user: username
+ password: pass
diff --git a/tests/pillar/eternus_single.sls b/tests/pillar/eternus_single.sls
index 52b722c..2e5f083 100644
--- a/tests/pillar/eternus_single.sls
+++ b/tests/pillar/eternus_single.sls
@@ -23,6 +23,34 @@
password: password
connection: FC
name: 7k2RAID6
+ identity:
+ engine: keystone
+ host: 127.0.0.1
+ port: 35357
+ tenant: service
+ user: cinder
+ password: pwd
+ region: regionOne
+ osapi:
+ host: 127.0.0.1
+ glance:
+ host: 127.0.0.1
+ port: 9292
+ default_volume_type: 7k2SaS
+ message_queue:
+ engine: rabbitmq
+ host: 127.0.0.1
+ port: 5672
+ user: openstack
+ password: pwd
+ virtual_host: '/openstack'
+ database:
+ engine: mysql
+ host: 127.0.0.1
+ port: 3306
+ name: cinder
+ user: cinder
+ password: pwd
controller:
enabled: true
version: liberty
@@ -46,4 +74,33 @@
user: username
password: password
connection: FC
- name: 7k2RAID6
\ No newline at end of file
+ name: 7k2RAID6
+ identity:
+ engine: keystone
+ host: 127.0.0.1
+ port: 35357
+ tenant: service
+ user: cinder
+ password: pwd
+ region: regionOne
+ osapi:
+ host: 127.0.0.1
+ osapi_max_limit: 500
+ glance:
+ host: 127.0.0.1
+ port: 9292
+ default_volume_type: 7k2SaS
+ message_queue:
+ engine: rabbitmq
+ host: 127.0.0.1
+ port: 5672
+ user: openstack
+ password: pwd
+ virtual_host: '/openstack'
+ database:
+ engine: mysql
+ host: 127.0.0.1
+ port: 3306
+ name: cinder
+ user: cinder
+ password: pwd
diff --git a/tests/pillar/gpfs_single.sls b/tests/pillar/gpfs_single.sls
index 4bb04d7..f77608d 100644
--- a/tests/pillar/gpfs_single.sls
+++ b/tests/pillar/gpfs_single.sls
@@ -11,6 +11,34 @@
type_name: GPFS-SILVER
engine: gpfs
mount_point: '/mnt/gpfs-openstack/cinder/silver'
+ identity:
+ engine: keystone
+ host: 127.0.0.1
+ port: 35357
+ tenant: service
+ user: cinder
+ password: pwd
+ region: regionOne
+ osapi:
+ host: 127.0.0.1
+ glance:
+ host: 127.0.0.1
+ port: 9292
+ default_volume_type: 7k2SaS
+ message_queue:
+ engine: rabbitmq
+ host: 127.0.0.1
+ port: 5672
+ user: openstack
+ password: pwd
+ virtual_host: '/openstack'
+ database:
+ engine: mysql
+ host: 127.0.0.1
+ port: 3306
+ name: cinder
+ user: cinder
+ password: pwd
controller:
enabled: true
version: liberty
@@ -22,4 +50,33 @@
GPFS-SILVER:
type_name: GPFS-SILVER
engine: gpfs
- mount_point: '/mnt/gpfs-openstack/cinder/silver'
\ No newline at end of file
+ mount_point: '/mnt/gpfs-openstack/cinder/silver'
+ identity:
+ engine: keystone
+ host: 127.0.0.1
+ port: 35357
+ tenant: service
+ user: cinder
+ password: pwd
+ region: regionOne
+ osapi:
+ host: 127.0.0.1
+ osapi_max_limit: 500
+ glance:
+ host: 127.0.0.1
+ port: 9292
+ default_volume_type: 7k2SaS
+ message_queue:
+ engine: rabbitmq
+ host: 127.0.0.1
+ port: 5672
+ user: openstack
+ password: pwd
+ virtual_host: '/openstack'
+ database:
+ engine: mysql
+ host: 127.0.0.1
+ port: 3306
+ name: cinder
+ user: cinder
+ password: pwd
diff --git a/tests/pillar/hp3par_single.sls b/tests/pillar/hp3par_single.sls
index cb93ba1..774c934 100644
--- a/tests/pillar/hp3par_single.sls
+++ b/tests/pillar/hp3par_single.sls
@@ -5,6 +5,7 @@
backend:
hp3par_backend:
type_name: hp3par
+ engine: hp3par
backend: hp3par_backend
user: admin
password: password
@@ -15,6 +16,35 @@
sanpassword: password
debug: True
snapcpg: OpenStackSNAPCPG
+ identity:
+ engine: keystone
+ host: 127.0.0.1
+ port: 35357
+ tenant: service
+ user: cinder
+ password: pwd
+ region: regionOne
+ osapi:
+ host: 127.0.0.1
+ osapi_max_limit: 500
+ glance:
+ host: 127.0.0.1
+ port: 9292
+ default_volume_type: 7k2SaS
+ message_queue:
+ engine: rabbitmq
+ host: 127.0.0.1
+ port: 5672
+ user: openstack
+ password: pwd
+ virtual_host: '/openstack'
+ database:
+ engine: mysql
+ host: 127.0.0.1
+ port: 3306
+ name: cinder
+ user: cinder
+ password: pwd
volume:
enabled: true
version: liberty
@@ -31,4 +61,32 @@
sanpassword: password
debug: True
snapcpg: OpenStackSNAPCPG
- engine: hp3par
\ No newline at end of file
+ engine: hp3par
+ identity:
+ engine: keystone
+ host: 127.0.0.1
+ port: 35357
+ tenant: service
+ user: cinder
+ password: pwd
+ region: regionOne
+ osapi:
+ host: 127.0.0.1
+ glance:
+ host: 127.0.0.1
+ port: 9292
+ default_volume_type: 7k2SaS
+ message_queue:
+ engine: rabbitmq
+ host: 127.0.0.1
+ port: 5672
+ user: openstack
+ password: pwd
+ virtual_host: '/openstack'
+ database:
+ engine: mysql
+ host: 127.0.0.1
+ port: 3306
+ name: cinder
+ user: cinder
+ password: pwd
diff --git a/tests/pillar/lefthand_single.sls b/tests/pillar/lefthand_single.sls
index 9a48eec..ffec435 100644
--- a/tests/pillar/lefthand_single.sls
+++ b/tests/pillar/lefthand_single.sls
@@ -11,6 +11,34 @@
password: password
clustername: cluster1
iscsi_chap_enabled: false
+ identity:
+ engine: keystone
+ host: 127.0.0.1
+ port: 35357
+ tenant: service
+ user: cinder
+ password: pwd
+ region: regionOne
+ osapi:
+ host: 127.0.0.1
+ glance:
+ host: 127.0.0.1
+ port: 9292
+ default_volume_type: 7k2SaS
+ message_queue:
+ engine: rabbitmq
+ host: 127.0.0.1
+ port: 5672
+ user: openstack
+ password: pwd
+ virtual_host: '/openstack'
+ database:
+ engine: mysql
+ host: 127.0.0.1
+ port: 3306
+ name: cinder
+ user: cinder
+ password: pwd
controller:
enabled: true
version: liberty
@@ -22,4 +50,33 @@
username: username
password: password
clustername: cluster1
- iscsi_chap_enabled: false
\ No newline at end of file
+ iscsi_chap_enabled: false
+ identity:
+ engine: keystone
+ host: 127.0.0.1
+ port: 35357
+ tenant: service
+ user: cinder
+ password: pwd
+ region: regionOne
+ osapi:
+ host: 127.0.0.1
+ osapi_max_limit: 500
+ glance:
+ host: 127.0.0.1
+ port: 9292
+ default_volume_type: 7k2SaS
+ message_queue:
+ engine: rabbitmq
+ host: 127.0.0.1
+ port: 5672
+ user: openstack
+ password: pwd
+ virtual_host: '/openstack'
+ database:
+ engine: mysql
+ host: 127.0.0.1
+ port: 3306
+ name: cinder
+ user: cinder
+ password: pwd
diff --git a/tests/pillar/solidfire_single.sls b/tests/pillar/solidfire_single.sls
index a75d6f4..4ce427d 100644
--- a/tests/pillar/solidfire_single.sls
+++ b/tests/pillar/solidfire_single.sls
@@ -11,6 +11,34 @@
san_password: password
clustername: cluster1
sf_emulate_512: false
+ identity:
+ engine: keystone
+ host: 127.0.0.1
+ port: 35357
+ tenant: service
+ user: cinder
+ password: pwd
+ region: regionOne
+ osapi:
+ host: 127.0.0.1
+ glance:
+ host: 127.0.0.1
+ port: 9292
+ default_volume_type: 7k2SaS
+ message_queue:
+ engine: rabbitmq
+ host: 127.0.0.1
+ port: 5672
+ user: openstack
+ password: pwd
+ virtual_host: '/openstack'
+ database:
+ engine: mysql
+ host: 127.0.0.1
+ port: 3306
+ name: cinder
+ user: cinder
+ password: pwd
controller:
enabled: true
version: liberty
@@ -22,4 +50,33 @@
san_login: username
san_password: password
clustername: cluster1
- sf_emulate_512: false
\ No newline at end of file
+ sf_emulate_512: false
+ identity:
+ engine: keystone
+ host: 127.0.0.1
+ port: 35357
+ tenant: service
+ user: cinder
+ password: pwd
+ region: regionOne
+ osapi:
+ host: 127.0.0.1
+ osapi_max_limit: 500
+ glance:
+ host: 127.0.0.1
+ port: 9292
+ default_volume_type: 7k2SaS
+ message_queue:
+ engine: rabbitmq
+ host: 127.0.0.1
+ port: 5672
+ user: openstack
+ password: pwd
+ virtual_host: '/openstack'
+ database:
+ engine: mysql
+ host: 127.0.0.1
+ port: 3306
+ name: cinder
+ user: cinder
+ password: pwd
diff --git a/tests/pillar/storwize_single.sls b/tests/pillar/storwize_single.sls
index 96c6b6f..01cd8b9 100644
--- a/tests/pillar/storwize_single.sls
+++ b/tests/pillar/storwize_single.sls
@@ -36,6 +36,34 @@
multihost: true
multipath: true
pool: SAS15K
+ identity:
+ engine: keystone
+ host: 127.0.0.1
+ port: 35357
+ tenant: service
+ user: cinder
+ password: pwd
+ region: regionOne
+ osapi:
+ host: 127.0.0.1
+ glance:
+ host: 127.0.0.1
+ port: 9292
+ default_volume_type: 7k2SaS
+ message_queue:
+ engine: rabbitmq
+ host: 127.0.0.1
+ port: 5672
+ user: openstack
+ password: pwd
+ virtual_host: '/openstack'
+ database:
+ engine: mysql
+ host: 127.0.0.1
+ port: 3306
+ name: cinder
+ user: cinder
+ password: pwd
controller:
enabled: true
version: liberty
@@ -72,4 +100,33 @@
connection: FC
multihost: true
multipath: true
- pool: SAS15K
\ No newline at end of file
+ pool: SAS15K
+ identity:
+ engine: keystone
+ host: 127.0.0.1
+ port: 35357
+ tenant: service
+ user: cinder
+ password: pwd
+ region: regionOne
+ osapi:
+ host: 127.0.0.1
+ osapi_max_limit: 500
+ glance:
+ host: 127.0.0.1
+ port: 9292
+ default_volume_type: 7k2SaS
+ message_queue:
+ engine: rabbitmq
+ host: 127.0.0.1
+ port: 5672
+ user: openstack
+ password: pwd
+ virtual_host: '/openstack'
+ database:
+ engine: mysql
+ host: 127.0.0.1
+ port: 3306
+ name: cinder
+ user: cinder
+ password: pwd
diff --git a/tests/pillar/volume_single.sls b/tests/pillar/volume_single.sls
index d8f7071..e86b45f 100644
--- a/tests/pillar/volume_single.sls
+++ b/tests/pillar/volume_single.sls
@@ -19,6 +19,7 @@
user: cinder
password: password
endpoint_type: internalURL
+ region: regionOne
glance:
host: 127.0.0.1
port: 9292
@@ -29,3 +30,9 @@
user: openstack
password: password
virtual_host: '/openstack'
+ storage:
+ engine: storwize
+ host: 192.168.0.1
+ port: 22
+ user: username
+ password: pass
diff --git a/tests/pillar/vsp_single.sls b/tests/pillar/vsp_single.sls
index 13450b4..3258ab7 100644
--- a/tests/pillar/vsp_single.sls
+++ b/tests/pillar/vsp_single.sls
@@ -8,6 +8,42 @@
backend: hus100_backend
engine: hitachi_vsp
connection: FC
+ storage_id: 1
+ pool_id: 10
+ thin_pool_id: 12
+ user: admin
+ password: password
+ target_ports: CL3-B
+ compute_target_ports: CL1-E,CL2-E,CL3-B,CL4-D
+ identity:
+ engine: keystone
+ host: 127.0.0.1
+ port: 35357
+ tenant: service
+ user: cinder
+ password: pwd
+ region: regionOne
+ osapi:
+ host: 127.0.0.1
+ osapi_max_limit: 500
+ glance:
+ host: 127.0.0.1
+ port: 9292
+ default_volume_type: 7k2SaS
+ message_queue:
+ engine: rabbitmq
+ host: 127.0.0.1
+ port: 5672
+ user: openstack
+ password: pwd
+ virtual_host: '/openstack'
+ database:
+ engine: mysql
+ host: 127.0.0.1
+ port: 3306
+ name: cinder
+ user: cinder
+ password: pwd
volume:
enabled: true
version: liberty
@@ -16,4 +52,32 @@
type_name: HUS100
backend: hus100_backend
engine: hitachi_vsp
- connection: FC
\ No newline at end of file
+ connection: FC
+ identity:
+ engine: keystone
+ host: 127.0.0.1
+ port: 35357
+ tenant: service
+ user: cinder
+ password: pwd
+ region: regionOne
+ osapi:
+ host: 127.0.0.1
+ glance:
+ host: 127.0.0.1
+ port: 9292
+ default_volume_type: 7k2SaS
+ message_queue:
+ engine: rabbitmq
+ host: 127.0.0.1
+ port: 5672
+ user: openstack
+ password: pwd
+ virtual_host: '/openstack'
+ database:
+ engine: mysql
+ host: 127.0.0.1
+ port: 3306
+ name: cinder
+ user: cinder
+ password: pwd