123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102 |
- %description:
- Test for basic TCP application lifecycle handling.
- Sequence of operations:
- - at 0 client initializes to up
- - at 0 server initializes to up
- - at 1 client executes shutdown operation
- - at 2 server executes shutdown 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
- **.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="client" operation="NodeShutdownOperation"/>
- </at>
- <at t="2">
- <tell module="lifecycleController" target="server" operation="NodeShutdownOperation"/>
- </at>
- </scenario>
- %contains-regex: stdout
- .*
- Test.client shutting down
- .*
- Test.client shut down
- .*
- Test.server shutting down
- .*
- Test.server shut down
- .*
- Test.client.tcpApp\[0\]: received 1000 bytes in 10 packets
- .*
- %#--------------------------------------------------------------------------------------------------------------
- %not-contains: stdout
- undisposed object:
- %not-contains: stdout
- -- check module destructor
- %#--------------------------------------------------------------------------------------------------------------
|