Update .travis.yml and .kitchen.yml files for parallel testing
Change-Id: I51f119ab0ece25e23aa3b6f34e69d446ffededbc
diff --git a/.kitchen.travis.yml b/.kitchen.travis.yml
new file mode 100644
index 0000000..f847543
--- /dev/null
+++ b/.kitchen.travis.yml
@@ -0,0 +1,6 @@
+suites:
+
+ - name: <%= ENV['SUITE'] %>
+ provisioner:
+ pillars-from-files:
+ neutron.sls: tests/pillar/<%= ENV['SUITE'] %>.sls
diff --git a/.kitchen.yml b/.kitchen.yml
new file mode 100644
index 0000000..dda0ec5
--- /dev/null
+++ b/.kitchen.yml
@@ -0,0 +1,45 @@
+---
+driver:
+ name: docker
+ hostname: openldap.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: openldap
+ grains:
+ noservices: True
+ state_top:
+ base:
+ "*":
+ - openldap
+ pillars:
+ top.sls:
+ base:
+ "*":
+ - openldap
+
+verifier:
+ name: inspec
+ sudo: true
+
+
+platforms:
+ - name: <%=ENV['PLATFORM'] || 'ubuntu-xenial'%>
+ driver_config:
+ image: <%=ENV['PLATFORM'] || 'trevorj/salty-whales:xenial'%>
+ platform: ubuntu
+
+suites:
+
+ - name: client
+ provisioner:
+ pillars-from-files:
+ openldap.sls: tests/pillar/client.sls
+
+# vim: ft=yaml sw=2 ts=2 sts=2 tw=125
\ No newline at end of file
diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 0000000..98adcca
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,39 @@
+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:
+ - PLATFORM=trevorj/salty-whales:trusty SUITE=client
+ - PLATFORM=trevorj/salty-whales:xenial SUITE=client
+
+before_script:
+ - set -o pipefail
+ - make test | tail
+
+script:
+ - KITCHEN_LOCAL_YAML=.kitchen.travis.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
\ No newline at end of file
diff --git a/openldap/client.sls b/openldap/client.sls
index e7cd3f3..c5b028c 100644
--- a/openldap/client.sls
+++ b/openldap/client.sls
@@ -52,6 +52,9 @@
- ldap: openldap_client_{{ member }}{% if member.split(',')[-1].split('=')[0] != 'dc' %},{{ client.server.basedn }}{% endif %}
{%- endfor %}
{%- endif %}
+ {%- if grains.get('noservices', False) %}
+ - onlyif: 'false'
+ {%- endif %}
{%- if param.entry is defined %}
{{ process_entry(param.entry, param.get('type', 'cn') + "=" + name + "," + tree) }}
diff --git a/tests/pillar/client.sls b/tests/pillar/client.sls
index 32ee4e2..7f07c78 100644
--- a/tests/pillar/client.sls
+++ b/tests/pillar/client.sls
@@ -1,3 +1,42 @@
openldap:
client:
- enabled: true
+ server:
+ basedn: dc=example,dc=local
+ host: ldap.example.local
+ tls: true
+ port: 389
+ auth:
+ user: cn=admin,dc=example,dc=local
+ password: dummypass
+ entry:
+ people:
+ type: ou
+ classes:
+ - top
+ - organizationalUnit
+ entry:
+ jdoe:
+ type: cn
+ # Change attributes that already exists with different content
+ action: replace
+ # Delete all other attributes
+ purge: true
+ attr:
+ uid: jdoe
+ uidNumber: 20001
+ gidNumber: 20001
+ gecos: John Doe
+ givenName: John
+ sn: Doe
+ homeDirectory: /home/jdoe
+ loginShell: /bin/bash
+ classes:
+ - posixAccount
+ - inetOrgPerson
+ - top
+ - ldapPublicKey
+ - shadowAccount
+ karel:
+ # Simply remove cn=karel
+ type: cn
+ enabled: false
\ No newline at end of file