DHCP_lifecycle_1.test 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. %description:
  2. Test for basic DHCP lifecycle handling.
  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. sim-time-limit = 1000s
  10. record-eventlog = true
  11. #omnetpp 5.0 - 5.1 compatibility:
  12. eventlog-file = "${resultdir}/${configname}-${runnumber}.elog"
  13. output-scalar-file = "${resultdir}/${configname}-${runnumber}.sca"
  14. output-vector-file = "${resultdir}/${configname}-${runnumber}.vec"
  15. snapshot-file = "${resultdir}/${configname}-${runnumber}.sna"
  16. **.hasStatus = true
  17. **.scenarioManager.script = xmldoc("scenario.xml")
  18. **.numUdpApps = 1
  19. **.client.udpApp[0].typename = "DHCPClient"
  20. **.client.udpApp[0].interface = "eth0"
  21. **.server.udpApp[0].typename = "DHCPServer"
  22. **.server.udpApp[0].subnetMask = "255.255.255.0"
  23. **.server.udpApp[0].numReservedAddresses = 100
  24. **.server.udpApp[0].maxNumClients = 100
  25. **.server.udpApp[0].gateway = "192.168.1.1"
  26. **.server.udpApp[0].dns = ""
  27. **.server.udpApp[0].leaseTime = 100s
  28. **.server.udpApp[0].interface = "eth0"
  29. %file: test.ned
  30. import inet.node.ethernet.Eth10M;
  31. import inet.node.inet.StandardHost;
  32. import inet.networklayer.configurator.ipv4.IPv4NetworkConfigurator;
  33. import inet.common.lifecycle.LifecycleController;
  34. import inet.common.scenario.ScenarioManager;
  35. network Test
  36. {
  37. submodules:
  38. scenarioManager: ScenarioManager;
  39. lifecycleController: LifecycleController;
  40. configurator: IPv4NetworkConfigurator {
  41. parameters:
  42. config = xml("<config><interface hosts='server' address='192.168.1.1' netmask='255.255.255.0'/></config>");
  43. }
  44. client: StandardHost;
  45. server: StandardHost;
  46. connections:
  47. client.ethg++ <--> Eth10M <--> server.ethg++;
  48. }
  49. %file: scenario.xml
  50. <scenario>
  51. <at t="1.0">
  52. <tell module="lifecycleController" target="client" operation="NodeShutdownOperation"/>
  53. </at>
  54. <at t="2.0">
  55. <tell module="lifecycleController" target="client" operation="NodeStartOperation"/>
  56. </at>
  57. <at t="3.0">
  58. <tell module="lifecycleController" target="server" operation="NodeShutdownOperation"/>
  59. </at>
  60. <at t="4.0">
  61. <tell module="lifecycleController" target="server" operation="NodeStartOperation"/>
  62. </at> -->
  63. </scenario>
  64. %contains-regex: stdout
  65. .*
  66. The requested IP 192\.168\.1\.100/255\.255\.255\.0 is available. Assigning it to client.
  67. .*
  68. Test.client shutting down
  69. .*
  70. Test.client shut down
  71. .*
  72. Test.client starting up
  73. .*
  74. Test.client started
  75. .*
  76. The requested IP 192\.168\.1\.100/255\.255\.255\.0 is available. Assigning it to client.
  77. .*
  78. Test.server shutting down
  79. .*
  80. Test.server shut down
  81. .*
  82. Test.server starting up
  83. .*
  84. Test.server started
  85. .*
  86. The requested IP 192\.168\.1\.100/255\.255\.255\.0 is available. Assigning it to client.
  87. .*
  88. %#--------------------------------------------------------------------------------------------------------------
  89. %not-contains: stdout
  90. undisposed object:
  91. %not-contains: stdout
  92. -- check module destructor
  93. %#--------------------------------------------------------------------------------------------------------------