From 35fa6724eeffc5d081499b1204d9b13481b65852 Mon Sep 17 00:00:00 2001 From: Jeremy Lecour Date: Thu, 20 Apr 2017 15:50:35 +0200 Subject: [PATCH] mongodb-org tests are disabled The way systemd is managed in Docker is different so managing systemd unit through Ansible is different. We'll resolve this later. --- mongodb-org/{.kitchen.yml => .z_kitchen.yml} | 6 ++++++ mongodb-org/tests/inventory | 1 - mongodb-org/tests/spec/main_spec.rb | 21 ++++++++++++++++++++ mongodb-org/tests/test.yml | 7 +++++++ 4 files changed, 34 insertions(+), 1 deletion(-) rename mongodb-org/{.kitchen.yml => .z_kitchen.yml} (76%) delete mode 100644 mongodb-org/tests/inventory create mode 100644 mongodb-org/tests/spec/main_spec.rb diff --git a/mongodb-org/.kitchen.yml b/mongodb-org/.z_kitchen.yml similarity index 76% rename from mongodb-org/.kitchen.yml rename to mongodb-org/.z_kitchen.yml index 07986065..569f6f5d 100644 --- a/mongodb-org/.kitchen.yml +++ b/mongodb-org/.z_kitchen.yml @@ -3,6 +3,9 @@ driver: name: docker privileged: true use_sudo: false + # important if you need to interact with systemd + # otherwise a barebone ssh server is the main process + run_command: /sbin/init provisioner: name: ansible_playbook @@ -16,6 +19,9 @@ provisioner: platforms: - name: debian-8 + driver_config: + image: debian:jessie + platform: debian # verifier: # name: serverspec diff --git a/mongodb-org/tests/inventory b/mongodb-org/tests/inventory deleted file mode 100644 index d18580b3..00000000 --- a/mongodb-org/tests/inventory +++ /dev/null @@ -1 +0,0 @@ -localhost \ No newline at end of file diff --git a/mongodb-org/tests/spec/main_spec.rb b/mongodb-org/tests/spec/main_spec.rb new file mode 100644 index 00000000..e1e66868 --- /dev/null +++ b/mongodb-org/tests/spec/main_spec.rb @@ -0,0 +1,21 @@ +require 'net/http' +require 'uri' + +require 'serverspec' +set :backend, :exec + +describe service('mongodb') do + it { should be_enabled } +end + +describe port(27042) do + it { should be_listening } +end + +describe file("/var/log/mongo-test.log") do + it { should be_file } +end + +describe file("/var/run/mongodb.pid") do + it { should be_file } +end diff --git a/mongodb-org/tests/test.yml b/mongodb-org/tests/test.yml index 05c33dc0..e7023fb0 100644 --- a/mongodb-org/tests/test.yml +++ b/mongodb-org/tests/test.yml @@ -1,4 +1,11 @@ --- - hosts: test-kitchen + + vars: + mongodb_pidfile_path: /var/run/mongodb.pid + mongodb_logfile_path: /var/log/mongo-test.log + mongodb_port: 27042 + mongodb_bind: 0.0.0.0 + roles: - role: mongodb-org