Browse Source

Add idempotency test

Add a test to ensure the module is idempotent. By doing this extra work,
the ethercalc service has enough time to figure things out and get
started, so we can also enable the checks to ensure the service is
responding.

Change-Id: Iede6db9dda0814bee9072c6dcc554ccc1aa89af1
changes/93/585293/5
Colleen Murphy 1 year ago
parent
commit
bc771d07c8
1 changed files with 14 additions and 13 deletions
  1. 14
    13
      spec/acceptance/ethercalc_spec.rb

+ 14
- 13
spec/acceptance/ethercalc_spec.rb View File

@@ -15,6 +15,10 @@ describe 'puppet-ethercalc:: manifest', :if => ['debian', 'ubuntu'].include?(os[
15 15
     apply_manifest(init_puppet_module, catch_failures: true)
16 16
   end
17 17
 
18
+  it 'should be idempotent' do
19
+    apply_manifest(init_puppet_module, catch_changes: true)
20
+  end
21
+
18 22
   describe 'required packages' do
19 23
     describe 'os packages' do
20 24
       required_packages = [
@@ -36,19 +40,16 @@ describe 'puppet-ethercalc:: manifest', :if => ['debian', 'ubuntu'].include?(os[
36 40
     end
37 41
   end
38 42
 
39
-  # TODO(ianw): not quite reliable ... possibly need this in a retry
40
-  # loop for a little to let the service start up?
41
-
42
-  # describe 'required services' do
43
-  #   describe 'ports are open and services are reachable' do
44
-  #     describe port(8000) do
45
-  #       it { should be_listening }
46
-  #     end
43
+  describe 'required services' do
44
+    describe 'ports are open and services are reachable' do
45
+      describe port(8000) do
46
+        it { should be_listening }
47
+      end
47 48
 
48
-  #     describe command('curl http://localhost:8000 --verbose') do
49
-  #       its(:stdout) { should contain('EtherCalc - Share the URL to your friends') }
50
-  #     end
51
-  #   end
52
-  # end
49
+      describe command('curl http://localhost:8000 --verbose') do
50
+        its(:stdout) { should contain('EtherCalc - Share the URL to your friends') }
51
+      end
52
+    end
53
+  end
53 54
 
54 55
 end

Loading…
Cancel
Save