Contents

hello_failed handler

Background:

  • Given I set the environment variables to:
    variablevalue
    TREMA_LOG_DIR.
    TREMA_PID_DIR.
    TREMA_SOCKET_DIR.
  • And a file named "hello_fails.rb" with:
    ruby
    require 'version_mismatch'
    
    class HelloFails < Trema::Controller
      def hello_failed(message)
        logger.info 'Hello failed.'
      end
    end
  • And a file named "trema.conf" with:
    ruby
    vswitch { datapath_id 0xabc }

Scenario: invoke hello_failed handler

@sudo @wip

  • Given I use OpenFlow 1.0
  • And a file named "version_mismatch.rb" with:
    ruby
    module Trema
      class Switch
        private
    
        # force trema to send Hello1.3 on startup.
        def exchange_hello_messages
          write Pio::OpenFlow13::Hello.new
          expect_receiving Hello
        end
      end
    end
  • When I trema run "hello_fails.rb" with the configuration "trema.conf"
  • Then the file "HelloFails.log" should contain "Hello failed."

Scenario: invoke hello_failed handler (OpenFlow 1.3)

@sudo @wip

  • Given I use OpenFlow 1.3
  • And a file named "version_mismatch.rb" with:
    ruby
    module Trema
      class Switch
        private
    
        # force trema to send Hello1.0 on startup.
        def exchange_hello_messages
          write Pio::OpenFlow10::Hello.new
          expect_receiving Hello
        end
      end
    end
  • When I trema run "hello_fails.rb" with the configuration "trema.conf"
  • Then the file "HelloFails.log" should contain "Hello failed."

Source: features/handlers/hello_failed.feature at commit 3711a30c, Trema (GPL license).