DHCP_lifecycle_2.test 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. %description:
  2. In this test the server shuts down immediately after (t = 0.0s) the starting and reboots
  3. at t = 190s. Client acts according to its default behavior and starts sending DHCPDISCOVER
  4. messages via UDP broadcasts.
  5. As the client got no responses within its default timeout (60s) it periodically retransmits
  6. the DHCPDISCOVER message.
  7. In this scenario, server reboots at 190s so client has to retransmit DHCPDISCOVER four times
  8. before its first success.
  9. %inifile: omnetpp.ini
  10. [General]
  11. network = LifecycleTest
  12. tkenv-plugin-path = ../../../etc/plugins
  13. ned-path = .;../../../../src;../../lib
  14. cmdenv-express-mode = false
  15. sim-time-limit = 300s
  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. **.scenarioManager.script = xmldoc("scenario.xml")
  24. **.numUdpApps = 1
  25. **.client.udpApp[0].typename = "DHCPClient"
  26. #**.client.udpApp[0].log-level = detail
  27. **.server.udpApp[0].typename = "DHCPServer"
  28. **.server.udpApp[0].numReservedAddresses = 100
  29. **.server.udpApp[0].maxNumClients = 100
  30. **.server.udpApp[0].dns = ""
  31. **.server.udpApp[0].leaseTime = 150s
  32. %file: test.ned
  33. import inet.node.ethernet.Eth10M;
  34. import inet.node.inet.StandardHost;
  35. import inet.networklayer.configurator.ipv4.IPv4NetworkConfigurator;
  36. import inet.common.lifecycle.LifecycleController;
  37. import inet.common.scenario.ScenarioManager;
  38. network LifecycleTest
  39. {
  40. submodules:
  41. scenarioManager: ScenarioManager {
  42. @display("p=73,59");
  43. }
  44. lifecycleController: LifecycleController {
  45. @display("p=73,185");
  46. }
  47. configurator: IPv4NetworkConfigurator {
  48. parameters:
  49. config = xml("<config><interface hosts='server' address='192.168.1.1' netmask='255.255.255.0'/></config>");
  50. @display("p=73,116");
  51. }
  52. client: StandardHost {
  53. @display("p=205,124");
  54. }
  55. server: StandardHost {
  56. @display("p=553,124");
  57. }
  58. connections:
  59. client.ethg++ <--> Eth10M <--> server.ethg++;
  60. }
  61. %file: scenario.xml
  62. <scenario>
  63. <at t="0.0">
  64. <tell module="lifecycleController" target="server" operation="NodeShutdownOperation"/>
  65. </at>
  66. <at t="190.0">
  67. <tell module="lifecycleController" target="server" operation="NodeStartOperation"/>
  68. </at>
  69. </scenario>
  70. %contains-regex: stdout
  71. .*
  72. LifecycleTest.server shut down
  73. .*
  74. Sending DHCPDISCOVER.
  75. .*
  76. (DETAIL: )?No DHCP offer received within timeout. Restarting.
  77. .*
  78. Sending DHCPDISCOVER.
  79. .*
  80. (DETAIL: )?No DHCP offer received within timeout. Restarting.
  81. .*
  82. Sending DHCPDISCOVER.
  83. .*
  84. (DETAIL: )?No DHCP offer received within timeout. Restarting.
  85. .*
  86. LifecycleTest.server started
  87. .*
  88. Sending DHCPDISCOVER.
  89. .*
  90. DHCPDISCOVER arrived. Handling it.
  91. .*
  92. The requested IP 192\.168\.1\.100/255\.255\.255\.0 is available. Assigning it to client.
  93. .*
  94. %#--------------------------------------------------------------------------------------------------------------
  95. %not-contains: stdout
  96. undisposed object:
  97. %not-contains: stdout
  98. -- check module destructor
  99. %#--------------------------------------------------------------------------------------------------------------