udpapp_lifecycle_4.test 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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 up
  6. - at 1 server executes shutdown 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. **.client.status.initialStatus = "down"
  24. **.server.status.initialStatus = "up"
  25. **.scenarioManager.script = xmldoc("scenario.xml")
  26. **.arp.retryCount = 0
  27. **.arp.retryTimeout = 100ms
  28. # udp apps
  29. **.numUdpApps = 1
  30. **.client.udpApp[0].typename = "UDPBasicApp"
  31. **.client.udpApp[0].startTime = 0s
  32. **.client.udpApp[0].destAddresses = "10.0.0.2"
  33. **.client.udpApp[0].destPort = 1000
  34. **.client.udpApp[0].messageLength = 1000B
  35. **.client.udpApp[0].sendInterval = 100ms
  36. **.server.udpApp[0].typename = "UDPSink"
  37. **.server.udpApp[0].localPort = 1000
  38. %file: test.ned
  39. import inet.node.ethernet.Eth10M;
  40. import inet.node.inet.StandardHost;
  41. import inet.networklayer.configurator.ipv4.IPv4NetworkConfigurator;
  42. import inet.common.lifecycle.LifecycleController;
  43. import inet.common.scenario.ScenarioManager;
  44. network Test
  45. {
  46. submodules:
  47. scenarioManager: ScenarioManager;
  48. lifecycleController: LifecycleController;
  49. configurator: IPv4NetworkConfigurator;
  50. client: StandardHost;
  51. server: StandardHost;
  52. connections:
  53. client.pppg++ <--> Eth10M <--> server.pppg++;
  54. }
  55. %file: scenario.xml
  56. <scenario>
  57. <at t="1">
  58. <tell module="lifecycleController" target="server" operation="NodeShutdownOperation"/>
  59. </at>
  60. <at t="2">
  61. <tell module="lifecycleController" target="client" operation="NodeStartOperation"/>
  62. </at>
  63. </scenario>
  64. %contains-regex: stdout
  65. .*
  66. Test.server shutting down
  67. .*
  68. Test.server shut down
  69. .*
  70. Test.client starting up
  71. .*
  72. Test.client started
  73. .*
  74. Test.server.udpApp\[0\]: received 0 packets
  75. .*
  76. %#--------------------------------------------------------------------------------------------------------------
  77. %not-contains: stdout
  78. undisposed object:
  79. %not-contains: stdout
  80. -- check module destructor
  81. %#--------------------------------------------------------------------------------------------------------------