Skip to content

Testing with simulator

Roman Tretiak edited this page Nov 14, 2018 · 10 revisions

Note: This feature is not actually implemented and currently is on-hold.

General overview

Simulator is a separate storm topology that performs the role of the speaker (floodlight) and has the following functionality:

  • create topology
  • add/modify switch/port/isl
  • isl discovery simulation
  • clear up current topology
  • working with flows (?)

All communication is done by kafka messaging with pre-defined message format (more details).

Design solutions.

Simulator listens two kafka topics:

  • kafka.topic.speaker - This topic contains all messages for floodlight and simulator processes them to execute his own functions.
  • kafka.topic.simulator - To that topic should be send all commands for simulator (i.e. create topology)

All simulator responses and commands is send to kafka.topic.topo.disco and those messages will be processed like they were created by floodlight speaker.

Message structure

All types of expected messages are listed in org.openkilda.messaging.simulator package. Commands and models are located in the relevant subdirectories.

Creation of atdd test with simulator

Tests that use simulator as a speaker should be tagged with "@sim". There are some utils and common glues existed in services/src/atdd/src/test/java/org/openkilda/simulator/ that make writing tests easier. Cucumber scenarios are available here services/src/atdd/src/test/resources/features/mvp.1/simulator/