Specifications:

    • Core Connection Sequence is correct for rsmp version 3.1.1

      Verify the connection sequence when using rsmp core 3.1.1

      1. Given the site is connected and using core 3.1.1

      2. When handshake messages are sent and received

      3. Then the handshake messages should be in the specified sequence corresponding to version 3.1.1

      4. And the connection sequence should be complete

      
      
      11
      # File 'spec/site/core/connect_spec.rb', line 11
      
      check_sequence '3.1.1'
    • Core Connection Sequence is correct for rsmp version 3.1.2

      Verify the connection sequence when using rsmp core 3.1.2

      1. Given the site is connected and using core 3.1.2

      2. When handshake messages are sent and received

      3. Then the handshake messages should be in the specified sequence corresponding to version 3.1.2

      4. And the connection sequence should be complete

      
      
      21
      # File 'spec/site/core/connect_spec.rb', line 21
      
      check_sequence '3.1.2'
    • Core Connection Sequence is correct for rsmp version 3.1.3

      Verify the connection sequence when using rsmp core 3.1.3

      1. Given the site is connected and using core 3.1.3

      2. When handshake messages are sent and received

      3. Then the handshake messages should be in the specified sequence corresponding to version 3.1.3

      4. And the connection sequence should be complete

      
      
      31
      # File 'spec/site/core/connect_spec.rb', line 31
      
      check_sequence '3.1.3'
    • Core Connection Sequence is correct for rsmp version 3.1.4

      Verify the connection sequence when using rsmp core 3.1.4

      1. Given the site is connected and using core 3.1.4

      2. When handshake messages are sent and received

      3. Then the handshake messages should be in the specified sequence corresponding to version 3.1.4

      4. And the connection sequence should be complete

      
      
      41
      # File 'spec/site/core/connect_spec.rb', line 41
      
      check_sequence '3.1.4'
    • Core Connection Sequence is correct for rsmp version 3.1.5

      Verify the connection sequence when using rsmp core 3.1.5

      1. Given the site is connected and using core 3.1.5

      2. When handshake messages are sent and received

      3. Then the handshake messages should be in the specified sequence corresponding to version 3.1.5

      4. And the connection sequence should be complete

      
      
      51
      # File 'spec/site/core/connect_spec.rb', line 51
      
      check_sequence '3.1.5'
    • Core Connection Sequence is correct for rsmp version 3.2

      Verify the connection sequence when using rsmp core 3.2

      1. Given the site is connected and using core 3.2

      2. When handshake messages are sent and received

      3. Then the handshake messages should be in the specified sequence corresponding to version 3.1.5

      4. And the connection sequence should be complete

      
      
      61
      # File 'spec/site/core/connect_spec.rb', line 61
      
      check_sequence '3.2'
    • Core Connection Sequence is correct for rsmp version 3.2.1

      Verify the connection sequence when using rsmp core 3.2.1

      1. Given the site is connected and using core 3.2.1

      2. When handshake messages are sent and received

      3. Then the handshake messages should be in the specified sequence corresponding to version 3.1.5

      4. And the connection sequence should be complete

      
      
      71
      # File 'spec/site/core/connect_spec.rb', line 71
      
      check_sequence '3.2.1'
    • Core Connection Sequence is correct for rsmp version 3.2.2

      Verify the connection sequence when using rsmp core 3.2.2

      1. Given the site is connected and using core 3.2.2

      2. When handshake messages are sent and received

      3. Then the handshake messages should be in the specified sequence corresponding to version 3.1.5

      4. And the connection sequence should be complete

      
      
      81
      # File 'spec/site/core/connect_spec.rb', line 81
      
      check_sequence '3.2.2'
    • Core Connection is closed if watchdogs are not acknowledged
      1. Given the site has just connected

      2. When our supervisor does not acknowledge watchdogs

      3. Then the site should disconnect

      
      
      16
      17
      18
      19
      20
      21
      22
      23
      24
      25
      26
      27
      28
      29
      30
      31
      # File 'spec/site/core/disconnect_spec.rb', line 16
      
      timeout = Validator.get_config('timeouts','disconnect')
            Validator::Site.isolated do |task,supervisor,site_proxy|
              supervisor.ignore_errors RSMP::DisconnectError do
                log "Disabling watchdog acknowledgements, site should disconnect"
                def site_proxy.acknowledge original
                  if original.is_a? RSMP::Watchdog
                    log "Not acknowledgning watchdog", message: original
                  else
                    super
                  end
                end
                site_proxy.wait_for_state :disconnected, timeout: timeout
              end
            rescue RSMP::TimeoutError
              raise "Site did not disconnect within #{timeout}s"
            end
    • Core Connection is not closed if watchdogs are not received
      1. Given the site has just connected

      2. When our supervisor stops sending watchdogs

      3. Then the site should not disconnect

      
      
      38
      39
      40
      41
      42
      43
      44
      45
      46
      47
      48
      49
      50
      51
      52
      # File 'spec/site/core/disconnect_spec.rb', line 38
      
      Validator::Site.isolated do |task,supervisor,site|
              timeout = Validator.get_config('timeouts','disconnect')
      
              wait_task = task.async do
                site.wait_for_state :disconnected, timeout: timeout
                raise RSMP::DisconnectError
              rescue RSMP::TimeoutError
                # ok, no disconnect happened
              end
      
              log "Stop sending watchdogs, site should not disconnect"
              site.with_watchdog_disabled do
                wait_task.wait
              end
            end
    • Core Aggregated Status can be requested

      Verify that the controller responds to an aggregated status request.

      1. Given the site is connected

      2. When we request aggregated status

      3. Then we should receive an aggregated status

      
      
      10
      11
      12
      13
      14
      15
      16
      # File 'spec/site/core/aggregated_status_spec.rb', line 10
      
      Validator::Site.connected do |task,supervisor,site|
              prepare task, site
              log "Request aggregated status"
              result = site.request_aggregated_status Validator.get_config('main_component'), collect!: {
                timeout: Validator.get_config('timeouts','status_response')
              }
            end
    • Core Aggregated Status uses null for functional position/state

      Verify that aggregated status uses null for unused attributes, from SXL 1.1 For SXL versions before 1.1 empty strings “” is also allowed.

      1. Given the is reconnected

      2. When we receive an aggregated status

      3. Then fP and fS should be null

      
      
      26
      27
      28
      29
      30
      31
      32
      33
      34
      35
      36
      37
      38
      39
      40
      41
      42
      # File 'spec/site/core/aggregated_status_spec.rb', line 26
      
      Validator::Site.isolated(
              'collect' => {
                filter: RSMP::Filter.new(type:"AggregatedStatus"),
                timeout: Validator.get_config('timeouts','ready'),
                num: 1,
                ingoing: true
              }
            ) do |task,supervisor,site_proxy|
              collector = site_proxy.collector
              collector.use_task task
              collector.wait!
              aggregated_status = site_proxy.collector.messages.first
      
              expect(aggregated_status).to be_an(RSMP::AggregatedStatus)
              expect(aggregated_status.attribute('fP')).to be_nil
              expect(aggregated_status.attribute('fS')).to be_nil
            end