From 6bce2b13b2d533cfd5bf4b59a70cde4dd66fb031 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Deronne?= Date: Tue, 27 Dec 2016 09:31:14 +0100 Subject: [PATCH] examples: Fix regression run for wifi-aggregation --- examples/wireless/examples-to-run.py | 2 +- examples/wireless/wifi-aggregation.cc | 24 ++++++++++++++++++++++-- 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/examples/wireless/examples-to-run.py b/examples/wireless/examples-to-run.py index 45a6e0293..9f13b43c4 100755 --- a/examples/wireless/examples-to-run.py +++ b/examples/wireless/examples-to-run.py @@ -16,7 +16,6 @@ cpp_examples = [ ("multirate --totalTime=0.3s --rateManager=ns3::MinstrelWifiManager", "True", "True"), ("multirate --totalTime=0.3s --rateManager=ns3::OnoeWifiManager", "True", "True"), ("multirate --totalTime=0.3s --rateManager=ns3::RraaWifiManager", "True", "True"), - ("simple-wifi-frame-aggregation", "True", "True"), ("wifi-adhoc", "False", "True"), # Takes too long to run ("wifi-ap --verbose=0", "True", "True"), # Don't let it spew to stdout ("wifi-clear-channel-cmu", "False", "True"), # Requires specific hardware @@ -34,6 +33,7 @@ cpp_examples = [ ("vht-wifi-network --simulationTime=0.1", "True", "True"), ("simple-ht-hidden-stations --simulationTime=1", "True", "True"), ("mixed-bg-network --simulationTime=1", "True", "True"), + ("wifi-aggregation --simulationTime=1", "True", "True"), ("wifi-tcp", "True", "True"), ("wifi-spectrum-per-example --distance=52 --index=3 --wifiType=ns3::SpectrumWifiPhy --simulationTime=1", "True", "True"), ("wifi-spectrum-per-example --distance=24 --index=31 --wifiType=ns3::YansWifiPhy --simulationTime=1", "True", "True"), diff --git a/examples/wireless/wifi-aggregation.cc b/examples/wireless/wifi-aggregation.cc index 9de73f8fe..84c458c09 100644 --- a/examples/wireless/wifi-aggregation.cc +++ b/examples/wireless/wifi-aggregation.cc @@ -280,18 +280,38 @@ int main (int argc, char *argv[]) uint32_t totalPacketsThrough = DynamicCast (serverAppA.Get (0))->GetReceived (); double throughput = totalPacketsThrough * payloadSize * 8 / (simulationTime * 1000000.0); std::cout << "Throughput with default configuration (A-MPDU aggregation enabled, 65kB): " << throughput << " Mbit/s" << '\n'; + if (throughput < 59.5 || throughput > 60.5) + { + NS_LOG_ERROR ("Obtained throughput " << throughput << " is not in the expected boundaries!"); + exit (1); + } totalPacketsThrough = DynamicCast (serverAppB.Get (0))->GetReceived (); throughput = totalPacketsThrough * payloadSize * 8 / (simulationTime * 1000000.0); std::cout << "Throughput with aggregation disabled: " << throughput << " Mbit/s" << '\n'; - + if (throughput < 30 || throughput > 30.5) + { + NS_LOG_ERROR ("Obtained throughput " << throughput << " is not in the expected boundaries!"); + exit (1); + } + totalPacketsThrough = DynamicCast (serverAppC.Get (0))->GetReceived (); throughput = totalPacketsThrough * payloadSize * 8 / (simulationTime * 1000000.0); std::cout << "Throughput with A-MPDU disabled and A-MSDU enabled (8kB): " << throughput << " Mbit/s" << '\n'; - + if (throughput < 51 || throughput > 52) + { + NS_LOG_ERROR ("Obtained throughput " << throughput << " is not in the expected boundaries!"); + exit (1); + } + totalPacketsThrough = DynamicCast (serverAppD.Get (0))->GetReceived (); throughput = totalPacketsThrough * payloadSize * 8 / (simulationTime * 1000000.0); std::cout << "Throughput with A-MPDU enabled (32kB) and A-MSDU enabled (4kB): " << throughput << " Mbit/s" << '\n'; + if (throughput < 58 || throughput > 59) + { + NS_LOG_ERROR ("Obtained throughput " << throughput << " is not in the expected boundaries!"); + exit (1); + } return 0; }