tcpapp_lifecycle_2.test 2.7 KB

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