From 3eb7b494df8ed577844f8d37af5198ab7995b0cd Mon Sep 17 00:00:00 2001 From: Tim Meusel Date: Tue, 22 Sep 2020 12:22:27 +0200 Subject: [PATCH] Add acceptance tests --- spec/acceptance/class_spec.rb | 14 -------------- spec/acceptance/server_spec.rb | 22 ++++++++++++++++++++++ 2 files changed, 22 insertions(+), 14 deletions(-) delete mode 100644 spec/acceptance/class_spec.rb create mode 100644 spec/acceptance/server_spec.rb diff --git a/spec/acceptance/class_spec.rb b/spec/acceptance/class_spec.rb deleted file mode 100644 index af693b0..0000000 --- a/spec/acceptance/class_spec.rb +++ /dev/null @@ -1,14 +0,0 @@ -require 'spec_helper_acceptance' - -describe 'hyperglass::server class' do - context 'default parameters' do - # Using puppet_apply as a helper - it 'works with no errors' do - pp = 'include hyperglass::server' - - # Run it twice and test for idempotency - apply_manifest(pp, catch_failures: true) - apply_manifest(pp, catch_changes: true) - end - end -end diff --git a/spec/acceptance/server_spec.rb b/spec/acceptance/server_spec.rb new file mode 100644 index 0000000..4ce4f68 --- /dev/null +++ b/spec/acceptance/server_spec.rb @@ -0,0 +1,22 @@ +require 'spec_helper_acceptance' + +describe 'hyperglass::server class' do + context 'default parameters' do + # Using puppet_apply as a helper + it 'works with no errors' do + pp = 'include hyperglass::server' + + # Run it three times and test for idempotency + # redis dependency needs two run twice to start properly on selinux nodes + # selinux is only enabled in vagrant images, not docker + apply_manifest(pp, catch_failures: true) + apply_manifest(pp, catch_failures: true) + apply_manifest(pp, catch_changes: true) + end + + describe service('hyperglass') do + it { is_expected.to be_running } + it { is_expected.to be_enabled } + end + end +end