lifecycle_1.test 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. %description:
  2. Test shutdown and startup operations on StandardHost.
  3. %inifile: omnetpp.ini
  4. [General]
  5. network = Test
  6. tkenv-plugin-path = ../../../etc/plugins
  7. ned-path = .;../../../../src;../../lib
  8. cmdenv-express-mode = false
  9. record-eventlog = true
  10. #omnetpp 5.0 - 5.1 compatibility:
  11. eventlog-file = "${resultdir}/${configname}-${runnumber}.elog"
  12. output-scalar-file = "${resultdir}/${configname}-${runnumber}.sca"
  13. output-vector-file = "${resultdir}/${configname}-${runnumber}.vec"
  14. snapshot-file = "${resultdir}/${configname}-${runnumber}.sna"
  15. **.hasStatus = true
  16. **.scenarioManager.script = xmldoc("scenario.xml")
  17. *.host.hasTcp = true
  18. *.host.hasUdp = true
  19. *.host.hasSctp = true
  20. *.host.eth[0].csmacdSupport = true
  21. *.host.eth[1].csmacdSupport = false
  22. *.host.networkLayer.configurator.networkConfiguratorModule = ""
  23. %file: test.ned
  24. import inet.node.inet.StandardHost;
  25. import inet.common.lifecycle.LifecycleController;
  26. import inet.status.NodeStatus;
  27. import inet.common.scenario.ScenarioManager;
  28. network Test
  29. {
  30. submodules:
  31. scenarioManager: ScenarioManager;
  32. lifecycleController: LifecycleController;
  33. host: StandardHost
  34. {
  35. gates:
  36. ethg[2];
  37. pppg[2];
  38. }
  39. connections:
  40. host.ethg[0] <--> {datarate=10Mbps; delay=10us;} <--> host.ethg[1];
  41. host.pppg[0] <--> {datarate=10Mbps; delay=10us;} <--> host.pppg[1];
  42. }
  43. %file: scenario.xml
  44. <scenario>
  45. <at t="1.0">
  46. <tell module="lifecycleController" target="host" operation="NodeShutdownOperation"/>
  47. </at>
  48. <at t="2.0">
  49. <tell module="lifecycleController" target="host" operation="NodeStartOperation"/>
  50. </at>
  51. <at t="2.5">
  52. <tell module="lifecycleController" target="host" operation="NodeShutdownOperation"/>
  53. </at>
  54. </scenario>
  55. %contains-regex: stdout
  56. Test.host shutting down
  57. .*
  58. Test.host shut down
  59. .*
  60. Test.host starting up
  61. .*
  62. Test.host started
  63. .*
  64. Test.host shutting down
  65. .*
  66. Test.host shut down
  67. %#--------------------------------------------------------------------------------------------------------------
  68. %not-contains: stdout
  69. undisposed object:
  70. %not-contains: stdout
  71. -- check module destructor
  72. %#--------------------------------------------------------------------------------------------------------------