summaryrefslogtreecommitdiff
path: root/tests/white-box/network.rb
blob: 8ca56ffd31adc1ff2e9dc86e798c435825401f48 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
require 'socket'

raise SkipTest if $node["dummy"]

class TestNetwork < LeapTest

  def setup
  end

  #
  # example properties:
  #
  # stunnel:
  #   couch_client:
  #     couch1_5984:
  #       accept_port: 4000
  #       connect: couch1.bitmask.i
  #       connect_port: 15984
  #
  def test_01_stunnel_is_running
    if $node['stunnel']
      $node['stunnel'].values.each do |stunnel_type|
        stunnel_type.values.each do |stunnel_conf|
          assert port = stunnel_conf['accept_port'], 'Field `accept_port` must be present in `stunnel` property.'
          assert_tcp_socket('localhost', port)
        end
      end
    end
    pass
  end

end