Merge pull request #8 from Martin819/master
Added Kitchen tests and Travis
diff --git a/.kitchen.yml b/.kitchen.yml
new file mode 100644
index 0000000..bf95612
--- /dev/null
+++ b/.kitchen.yml
@@ -0,0 +1,49 @@
+---
+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: ubuntu-trusty
+ driver_config:
+ image: trevorj/salty-whales:trusty
+ platform: ubuntu
+
+ - name: ubuntu-xenial
+ driver_config:
+ image: trevorj/salty-whales:xenial
+ platform: ubuntu
+
+suites:
+
+ - name: <%=ENV['SUITE'] || 'ceph_single'%>
+ provisioner:
+ pillars-from-files:
+ cinder.sls: tests/pillar/<%=ENV['SUITE'] || 'ceph_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..c1872fe
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,47 @@
+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/salt-formulas/kitchen-salt.git'
+ - bundle install
+
+env:
+ - SUITE=ceph_single
+ - SUITE=control_cluster
+ - SUITE=control_single
+ - SUITE=gpfs_single
+ - SUITE=hp3par_single
+ - SUITE=lefthand_single
+ - SUITE=solidfire_single
+ - SUITE=storwize_single
+ - SUITE=volume_single
+ - SUITE=vsp_single
+
+before_script:
+ - set -o pipefail
+ - make test | tail
+
+script:
+ - test ! -e .kitchen.yml || bundle exec kitchen test -t tests/integration
+
+notifications:
+ webhooks:
+ urls:
+ - https://webhooks.gitter.im/e/6123573504759330786b
+ on_success: change # options: [always|never|change] default: always
+ on_failure: never # options: [always|never|change] default: always
+ on_start: never # options: [always|never|change] default: always
+ on_cancel: never # options: [always|never|change] default: always
+ on_error: never # options: [always|never|change] default: always
+ email: false
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..762b665 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) %}
@@ -70,7 +72,9 @@
- source: salt://cinder/files/iscsitarget
- template: jinja
- require:
- - pkg: cinder_iscsi_packages
+ - pkg: cinder_iscsi_packages_{{ loop.index }}
+
+{%- if not grains.get('noservices', False) %}
cinder_scsi_service:
service.running:
@@ -83,6 +87,9 @@
{%- endif %}
+
+{%- endif %}
+
{%- if backend.engine == 'hitachi_vsp' %}
{%- if grains.os_family == 'Debian' and volume.version == 'juno' %}
@@ -116,6 +123,7 @@
cinder_driver_fujitsu_{{ loop.index }}:
pkg.latest:
- name: cinder-driver-fujitsu
+ - refresh: true
/etc/cinder/cinder_fujitsu_eternus_dx_{{ backend_name }}.xml:
file.managed:
@@ -154,6 +162,8 @@
- require:
- pkg: cinder_iscsi_packages
+{%- if not grains.get('noservices', False) %}
+
cinder_scsi_service:
service.running:
- names:
@@ -165,6 +175,8 @@
{%- endif %}
+{%- endif %}
+
{%- if volume.storage.engine == 'hitachi_vsp' %}
{%- if grains.os_family == 'Debian' and volume.version == 'juno' %}
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
deleted file mode 100644
index 52b722c..0000000
--- a/tests/pillar/eternus_single.sls
+++ /dev/null
@@ -1,49 +0,0 @@
-cinder:
- volume:
- enabled: true
- version: liberty
- backend:
- 10kThinPro:
- type_name: 10kThinPro
- engine: fujitsu
- pool: 10kThinPro
- host: 127.0.0.1
- port: 5988
- user: username
- password: password
- connection: FC
- name: 10kThinPro
- 10k_SAS:
- type_name: 10k_SAS
- pool: SAS10K
- engine: fujitsu
- host: 127.0.0.1
- port: 5988
- user: username
- password: password
- connection: FC
- name: 7k2RAID6
- controller:
- enabled: true
- version: liberty
- backend:
- 10kThinPro:
- type_name: 10kThinPro
- engine: fujitsu
- pool: 10kThinPro
- host: 127.0.0.1
- port: 5988
- user: username
- password: password
- connection: FC
- name: 10kThinPro
- 10k_SAS:
- type_name: 10k_SAS
- pool: SAS10K
- engine: fujitsu
- host: 127.0.0.1
- port: 5988
- user: username
- password: password
- connection: FC
- name: 7k2RAID6
\ No newline at end of file
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