lifecycle_2.test 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. %description:
  2. Test crash 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="NodeCrashOperation"/>
  47. </at>
  48. <at t="2.0">
  49. <tell module="lifecycleController" target="host" operation="NodeStartOperation"/>
  50. </at>
  51. </scenario>
  52. %contains-regex: stdout
  53. Test.host crashing
  54. .*
  55. Test.host crashed
  56. .*
  57. Test.host starting up
  58. .*
  59. Test.host started
  60. %#--------------------------------------------------------------------------------------------------------------
  61. %not-contains: stdout
  62. undisposed object:
  63. %not-contains: stdout
  64. -- check module destructor
  65. %#--------------------------------------------------------------------------------------------------------------