tcpapp_lifecycle_6.test 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. %description:
  2. Test for basic TCP application lifecycle handling.
  3. Sequence of operations:
  4. - at 0 client initializes to up
  5. - at 0 server initializes to down
  6. - at 1 server executes startup operation
  7. - at 2 client executes shutdown 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 = "up"
  24. **.server.status.initialStatus = "down"
  25. **.scenarioManager.script = xmldoc("scenario.xml")
  26. **.arp.retryCount = 0
  27. **.arp.retryTimeout = 100ms
  28. # tcp apps
  29. **.numTcpApps = 1
  30. **.client.tcpApp[0].typename = "TCPBasicClientApp"
  31. **.client.tcpApp[0].startTime = 0s
  32. **.client.tcpApp[0].localPort = -1
  33. **.client.tcpApp[0].connectAddress = "server"
  34. **.client.tcpApp[0].connectPort = 1000
  35. **.client.tcpApp[0].numRequestsPerSession = 1000
  36. **.client.tcpApp[0].requestLength = 100B
  37. **.client.tcpApp[0].idleInterval = 1000000s
  38. **.client.tcpApp[0].thinkTime = 100ms
  39. **.server.tcpApp[0].typename = "TCPEchoApp"
  40. **.server.tcpApp[0].localPort = 1000
  41. **.tcpApp[0].dataTransferMode = "bytecount"
  42. %file: test.ned
  43. import inet.node.ethernet.Eth10M;
  44. import inet.node.inet.StandardHost;
  45. import inet.networklayer.configurator.ipv4.IPv4NetworkConfigurator;
  46. import inet.common.lifecycle.LifecycleController;
  47. import inet.common.scenario.ScenarioManager;
  48. network Test
  49. {
  50. submodules:
  51. scenarioManager: ScenarioManager;
  52. lifecycleController: LifecycleController;
  53. configurator: IPv4NetworkConfigurator;
  54. client: StandardHost;
  55. server: StandardHost;
  56. connections:
  57. client.ethg++ <--> Eth10M <--> server.ethg++;
  58. }
  59. %file: scenario.xml
  60. <scenario>
  61. <at t="1">
  62. <tell module="lifecycleController" target="server" operation="NodeStartOperation"/>
  63. </at>
  64. <at t="2">
  65. <tell module="lifecycleController" target="client" operation="NodeShutdownOperation"/>
  66. </at>
  67. </scenario>
  68. %contains-regex: stdout
  69. .*
  70. Test.server starting up
  71. .*
  72. Test.server started
  73. .*
  74. Test.client shutting down
  75. .*
  76. Test.client shut down
  77. .*
  78. Test.client.tcpApp\[0\]: received 0 bytes in 0 packets
  79. .*
  80. %#--------------------------------------------------------------------------------------------------------------
  81. %not-contains: stdout
  82. undisposed object:
  83. %not-contains: stdout
  84. -- check module destructor
  85. %#--------------------------------------------------------------------------------------------------------------