123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103 |
- %description:
- Test for basic TCP application lifecycle handling.
- Sequence of operations:
- - at 0 client initializes to down
- - at 0 server initializes to up
- - at 1 server executes shutdown operation
- - at 2 client executes startup operation
- - simulation stops at 3
- %inifile: omnetpp.ini
- [General]
- network = Test
- tkenv-plugin-path = ../../../etc/plugins
- ned-path = .;../../../../src;../../lib
- cmdenv-express-mode = false
- sim-time-limit = 3s
- record-eventlog = true
- #omnetpp 5.0 - 5.1 compatibility:
- eventlog-file = "${resultdir}/${configname}-${runnumber}.elog"
- output-scalar-file = "${resultdir}/${configname}-${runnumber}.sca"
- output-vector-file = "${resultdir}/${configname}-${runnumber}.vec"
- snapshot-file = "${resultdir}/${configname}-${runnumber}.sna"
- **.hasStatus = true
- **.client.status.initialStatus = "down"
- **.server.status.initialStatus = "up"
- **.scenarioManager.script = xmldoc("scenario.xml")
- **.arp.retryCount = 0
- **.arp.retryTimeout = 100ms
- # tcp apps
- **.numTcpApps = 1
- **.client.tcpApp[0].typename = "TCPBasicClientApp"
- **.client.tcpApp[0].startTime = 0s
- **.client.tcpApp[0].localPort = -1
- **.client.tcpApp[0].connectAddress = "server"
- **.client.tcpApp[0].connectPort = 1000
- **.client.tcpApp[0].numRequestsPerSession = 1000
- **.client.tcpApp[0].requestLength = 100B
- **.client.tcpApp[0].idleInterval = 1000000s
- **.client.tcpApp[0].thinkTime = 100ms
- **.server.tcpApp[0].typename = "TCPEchoApp"
- **.server.tcpApp[0].localPort = 1000
- **.tcpApp[0].dataTransferMode = "bytecount"
- %file: test.ned
- import inet.node.ethernet.Eth10M;
- import inet.node.inet.StandardHost;
- import inet.networklayer.configurator.ipv4.IPv4NetworkConfigurator;
- import inet.common.lifecycle.LifecycleController;
- import inet.common.scenario.ScenarioManager;
- network Test
- {
- submodules:
- scenarioManager: ScenarioManager;
- lifecycleController: LifecycleController;
- configurator: IPv4NetworkConfigurator;
- client: StandardHost;
- server: StandardHost;
- connections:
- client.ethg++ <--> Eth10M <--> server.ethg++;
- }
- %file: scenario.xml
-
- <scenario>
- <at t="1">
- <tell module="lifecycleController" target="server" operation="NodeShutdownOperation"/>
- </at>
- <at t="2">
- <tell module="lifecycleController" target="client" operation="NodeStartOperation"/>
- </at>
- </scenario>
- %contains-regex: stdout
- .*
- Test.server shutting down
- .*
- Test.server shut down
- .*
- Test.client starting up
- .*
- Test.client started
- .*
- Test.client.tcpApp\[0\]: received 0 bytes in 0 packets
- .*
- %#--------------------------------------------------------------------------------------------------------------
- %not-contains: stdout
- undisposed object:
- %not-contains: stdout
- -- check module destructor
- %#--------------------------------------------------------------------------------------------------------------
|