udpapp_lifecycle_2.test 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. %description:
  2. Test for basic UDP application lifecycle handling.
  3. Sequence of operations:
  4. - at 0 client initializes to down
  5. - at 0 server initializes to down
  6. - at 1 server executes startup operation
  7. - at 2 client executes startup operation
  8. - simulation stops at 3
  9. %inifile: omnetpp.ini
  10. [General]
  11. network = Test
  12. tkenv-plugin-path = ../../../etc/plugins
  13. ned-path = .;../../../../src;../../lib
  14. cmdenv-express-mode = false
  15. sim-time-limit = 3s
  16. record-eventlog = true
  17. #omnetpp 5.0 - 5.1 compatibility:
  18. eventlog-file = "${resultdir}/${configname}-${runnumber}.elog"
  19. output-scalar-file = "${resultdir}/${configname}-${runnumber}.sca"
  20. output-vector-file = "${resultdir}/${configname}-${runnumber}.vec"
  21. snapshot-file = "${resultdir}/${configname}-${runnumber}.sna"
  22. **.hasStatus = true
  23. **.initialStatus = "down"
  24. **.scenarioManager.script = xmldoc("scenario.xml")
  25. **.arp.retryCount = 0
  26. **.arp.retryTimeout = 100ms
  27. # udp apps
  28. **.numUdpApps = 1
  29. **.client.udpApp[0].typename = "UDPBasicApp"
  30. **.client.udpApp[0].startTime = 0s
  31. **.client.udpApp[0].destAddresses = "10.0.0.2"
  32. **.client.udpApp[0].destPort = 1000
  33. **.client.udpApp[0].messageLength = 1000B
  34. **.client.udpApp[0].sendInterval = 100ms
  35. **.server.udpApp[0].typename = "UDPSink"
  36. **.server.udpApp[0].localPort = 1000
  37. %file: test.ned
  38. import inet.node.ethernet.Eth10M;
  39. import inet.node.inet.StandardHost;
  40. import inet.networklayer.configurator.ipv4.IPv4NetworkConfigurator;
  41. import inet.common.lifecycle.LifecycleController;
  42. import inet.common.scenario.ScenarioManager;
  43. network Test
  44. {
  45. submodules:
  46. scenarioManager: ScenarioManager;
  47. lifecycleController: LifecycleController;
  48. configurator: IPv4NetworkConfigurator;
  49. client: StandardHost;
  50. server: StandardHost;
  51. connections:
  52. client.pppg++ <--> Eth10M <--> server.pppg++;
  53. }
  54. %file: scenario.xml
  55. <scenario>
  56. <at t="1">
  57. <tell module="lifecycleController" target="server" operation="NodeStartOperation"/>
  58. </at>
  59. <at t="2">
  60. <tell module="lifecycleController" target="client" operation="NodeStartOperation"/>
  61. </at>
  62. </scenario>
  63. %contains-regex: stdout
  64. .*
  65. Test.server starting up
  66. .*
  67. Test.server started
  68. .*
  69. Test.client starting up
  70. .*
  71. Test.client started
  72. .*
  73. Test.server.udpApp\[0\]: received 10 packets
  74. .*
  75. %#--------------------------------------------------------------------------------------------------------------
  76. %not-contains: stdout
  77. undisposed object:
  78. %not-contains: stdout
  79. -- check module destructor
  80. %#--------------------------------------------------------------------------------------------------------------