A Discrete-Event Network Simulator
API
test-ns3.py
Go to the documentation of this file.
1 #! /usr/bin/env python3
2 # -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
3 #
4 # Copyright (c) 2021 Universidade de Brasília
5 #
6 # This program is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License version 2 as
8 # published by the Free Software Foundation;
9 #
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
14 #
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write to the Free Software
17 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 #
19 # Author: Gabriel Ferreira <gabrielcarvfer@gmail.com>
20 
21 import itertools
22 import shutil
23 from functools import partial
24 import sys
25 import unittest
26 import os
27 import subprocess
28 import re
29 import glob
30 
31 # Get path containing ns3
32 ns3_path = os.path.dirname(os.path.abspath(os.sep.join([__file__, "../../"])))
33 ns3_script = os.sep.join([ns3_path, "ns3"])
34 ns3rc_script = os.sep.join([ns3_path, ".ns3rc"])
35 build_status_script = os.sep.join([ns3_path, "build", "build-status.py"])
36 c4che_script = os.sep.join([ns3_path, "build", "c4che", "_cache.py"])
37 
38 # Move the current working directory to the ns-3-dev/utils/tests folder
39 os.chdir(os.path.dirname(os.path.abspath(__file__)))
40 
41 # Cmake commands
42 cmake_refresh_cache_command = "cd {ns3_path}/cmake_cache; /usr/bin/cmake ..".format(ns3_path=ns3_path)
43 cmake_build_project_command = "cd {ns3_path}/cmake_cache; cmake --build . -j".format(ns3_path=ns3_path)
44 cmake_build_target_command = partial("cd {ns3_path}/cmake_cache; cmake --build . -j {jobs} --target {target}".format,
45  ns3_path=ns3_path,
46  jobs=max(1, os.cpu_count() - 1)
47  )
48 
49 
50 def run_ns3(args):
51  return run_program(ns3_script, args, True)
52 
53 
54 # Adapted from https://github.com/metabrainz/picard/blob/master/picard/util/__init__.py
55 def run_program(program, args, python=False):
56  if type(args) != str:
57  raise Exception("args should be a string")
58 
59  # Include python interpreter if running a python script
60  if python:
61  arguments = [sys.executable, program]
62  else:
63  arguments = [program]
64 
65  if args != "":
66  arguments.extend(re.findall("(?:\".*?\"|\S)+", args))
67 
68  # Call program with arguments
69  ret = subprocess.run(
70  arguments,
71  stdin=subprocess.DEVNULL,
72  stdout=subprocess.PIPE,
73  stderr=subprocess.PIPE,
74  timeout=None,
75  cwd=ns3_path # run process from the ns-3-dev path
76  )
77 
78  # Return (error code, stdout and stderr)
79  return ret.returncode, ret.stdout.decode(sys.stdout.encoding), ret.stderr.decode(sys.stderr.encoding)
80 
81 
83  values = {}
84  with open(build_status_script) as f:
85  exec(f.read(), globals(), values)
86  return values["ns3_runnable_programs"]
87 
88 
89 def read_c4che_entry(entry):
90  values = {}
91  with open(c4che_script) as f:
92  exec(f.read(), globals(), values)
93  return values[entry]
94 
95 
97  return read_c4che_entry("ENABLE_TESTS")
98 
99 
101  return read_c4che_entry("NS3_ENABLED_MODULES")
102 
103 
104 class NS3RunWafTargets(unittest.TestCase):
105 
106  cleaned_once = False
107 
108  def setUp(self):
109  if not NS3RunWafTargets.cleaned_once:
110  NS3RunWafTargets.cleaned_once = True
111  run_ns3("clean")
112  return_code, stdout, stderr = run_program("waf", "configure --enable-examples --enable-tests", python=True)
113  self.assertEqual(return_code, 0)
114  self.assertIn("finished successfully", stdout)
115 
116  return_code, stdout, stderr = run_program("waf", "build", python=True)
117  self.assertEqual(return_code, 0)
118  self.assertIn("finished successfully", stdout)
119 
121  # Check if build-status.py exists, then read to get list of executables
122  self.assertTrue(os.path.exists(build_status_script))
124  self.assertGreater(len(self.ns3_executables), 0)
125 
127  # Check if c4che.py exists than read to get the list of enabled modules
128  self.assertTrue(os.path.exists(c4che_script))
130  self.assertGreater(len(self.ns3_modules), 0)
131 
133  return_code, stdout, stderr = run_ns3("--run-no-build scratch-simulator")
134  self.assertEqual(return_code, 0)
135  self.assertIn("Scratch Simulator", stderr)
136 
138  return_code, stdout, stderr = run_ns3("--run-no-build command-line-example")
139  self.assertEqual(return_code, 0)
140  self.assertIn("command-line-example", stdout)
141 
143  return_code, stdout, stderr = run_program("test.py", "--nowaf -s core-example-simulator", True)
144  self.assertEqual(return_code, 0)
145  self.assertIn("PASS", stdout)
146 
148  return_code, stdout, stderr = run_program("test.py", "--nowaf -s examples-as-tests-test-suite", True)
149  self.assertEqual(return_code, 0)
150  self.assertIn("PASS", stdout)
151 
152 
153 class NS3CommonSettingsTestCase(unittest.TestCase):
154  def setUp(self):
155  super().setUp()
156  # No special setup for common test cases other than making sure we are working on a clean directory
157  run_ns3("clean")
158 
159  def test_01_NoOption(self):
160  return_code, stdout, stderr = run_ns3("")
161  self.assertEqual(return_code, 0)
162  self.assertIn("You need to configure ns-3 first: try ./ns3 configure", stdout)
163 
164  def test_02_Verbose(self):
165  return_code, stdout, stderr = run_ns3("--verbose")
166  self.assertEqual(return_code, 0)
167  self.assertIn("You need to configure ns-3 first: try ./ns3 configure", stdout)
168 
170  return_code, stdout, stderr = run_ns3("--no-task-lines")
171  self.assertEqual(return_code, 0)
172  self.assertIn("You need to configure ns-3 first: try ./ns3 configure", stdout)
173 
175  return_code, stdout, stderr = run_ns3("--check-config")
176  self.assertEqual(return_code, 1)
177  self.assertIn("Project was not configured", stderr)
178 
179 
180 class NS3ConfigureBuildProfileTestCase(unittest.TestCase):
181  def setUp(self):
182  super().setUp()
183  # No special setup for common test cases other than making sure we are working on a clean directory
184  run_ns3("clean")
185 
186  def test_01_Debug(self):
187  return_code, stdout, stderr = run_ns3("configure -d debug")
188  self.assertEqual(return_code, 0)
189  self.assertIn("Build profile : debug", stdout)
190  self.assertIn("Build files have been written to", stdout)
191 
192  # Build core to check if profile suffixes match the expected
193  return_code, stdout, stderr = run_ns3("build core")
194  self.assertEqual(return_code, 0)
195  self.assertIn("Built target libcore", stdout)
196 
197  libcore = glob.glob(os.sep.join([ns3_path, "build", "lib"]) + '/*', recursive=True)
198  self.assertGreater(len(libcore), 0)
199  self.assertIn("core-debug", libcore[0])
200 
201  def test_02_Release(self):
202  return_code, stdout, stderr = run_ns3("configure -d release")
203  self.assertEqual(return_code, 0)
204  self.assertIn("Build profile : release", stdout)
205  self.assertIn("Build files have been written to", stdout)
206 
207  def test_03_Optimized(self):
208  return_code, stdout, stderr = run_ns3("configure -d optimized")
209  self.assertEqual(return_code, 0)
210  self.assertIn("Build profile : optimized", stdout)
211  self.assertIn("Build files have been written to", stdout)
212 
213  # Build core to check if profile suffixes match the expected
214  return_code, stdout, stderr = run_ns3("build core")
215  self.assertEqual(return_code, 0)
216  self.assertIn("Built target libcore", stdout)
217 
218  libcore = glob.glob(os.sep.join([ns3_path, "build", "lib"]) + '/*', recursive=True)
219  self.assertGreater(len(libcore), 0)
220  self.assertIn("core-optimized", libcore[0])
221 
222  def test_04_Typo(self):
223  return_code, stdout, stderr = run_ns3("configure -d Optimized")
224  self.assertEqual(return_code, 2)
225  self.assertIn("invalid choice: 'Optimized'", stderr)
226 
227  def test_05_TYPO(self):
228  return_code, stdout, stderr = run_ns3("configure -d OPTIMIZED")
229  self.assertEqual(return_code, 2)
230  self.assertIn("invalid choice: 'OPTIMIZED'", stderr)
231 
232 
233 class NS3BaseTestCase(unittest.TestCase):
234 
235  cleaned_once = False
236 
237  def config_ok(self, return_code, stdout):
238  self.assertEqual(return_code, 0)
239  self.assertIn("Build profile : release", stdout)
240  self.assertIn("Build files have been written to", stdout)
241 
242  def setUp(self):
243  super().setUp()
244 
245  if os.path.exists(ns3rc_script):
246  os.remove(ns3rc_script)
247 
248  # We only clear it once and then update the settings by changing flags or consuming ns3rc
249  if not NS3BaseTestCase.cleaned_once:
250  NS3BaseTestCase.cleaned_once = True
251  run_ns3("clean")
252  return_code, stdout, stderr = run_ns3("configure -d release")
253  self.config_ok(return_code, stdout)
254 
255  # Check if build-status.py exists, then read to get list of executables
256  self.assertTrue(os.path.exists(build_status_script))
258 
259  # Check if c4che.py exists than read to get the list of enabled modules
260  self.assertTrue(os.path.exists(c4che_script))
262 
263 
265 
266  cleaned_once = False
267 
268  def setUp(self):
269  if not NS3ConfigureTestCase.cleaned_once:
270  NS3ConfigureTestCase.cleaned_once = True
271  NS3BaseTestCase.cleaned_once = False
272  super().setUp()
273 
274  def test_01_Examples(self):
275  return_code, stdout, stderr = run_ns3("configure --enable-examples")
276 
277  # This just tests if we didn't break anything, not that we actually have enabled anything
278  self.config_ok(return_code, stdout)
279 
280  # If nothing went wrong, we should have more executables in the list after enabling the examples
281  self.assertGreater(len(get_programs_list()), len(self.ns3_executables))
282 
283  # Now we disabled them back
284  return_code, stdout, stderr = run_ns3("configure --disable-examples")
285 
286  # This just tests if we didn't break anything, not that we actually have enabled anything
287  self.config_ok(return_code, stdout)
288 
289  # And check if they went back to the original list
290  self.assertEqual(len(get_programs_list()), len(self.ns3_executables))
291 
292  def test_02_Tests(self):
293  # Try enabling tests
294  return_code, stdout, stderr = run_ns3("configure --enable-tests")
295  self.config_ok(return_code, stdout)
296 
297  # Then try building the libcore test
298  return_code, stdout, stderr = run_ns3("build core-test")
299 
300  # If nothing went wrong, this should have worked
301  self.assertEqual(return_code, 0)
302  self.assertIn("Built target libcore-test", stdout)
303 
304  # Now we disabled the tests
305  return_code, stdout, stderr = run_ns3("configure --disable-tests")
306  self.config_ok(return_code, stdout)
307 
308  # Now building the library test should fail
309  return_code, stdout, stderr = run_ns3("build core-test")
310 
311  # And check if they went back to the original list
312  self.assertGreater(len(stderr), 0)
313 
315  # Try filtering enabled modules to network+wifi and their dependencies
316  return_code, stdout, stderr = run_ns3("configure --enable-modules='network;wifi'")
317  self.config_ok(return_code, stdout)
318 
319  # At this point we should have fewer modules
320  enabled_modules = get_enabled_modules()
321  self.assertLess(len(get_enabled_modules()), len(self.ns3_modules))
322  self.assertIn("ns3-network", enabled_modules)
323  self.assertIn("ns3-wifi", enabled_modules)
324 
325  # Try cleaning the list of enabled modules to reset to the normal configuration
326  return_code, stdout, stderr = run_ns3("configure --enable-modules=''")
327  self.config_ok(return_code, stdout)
328 
329  # At this point we should have the same amount of modules that we had when we started
330  self.assertEqual(len(get_enabled_modules()), len(self.ns3_modules))
331 
333  # Try filtering disabled modules to disable lte and modules that depend on it
334  return_code, stdout, stderr = run_ns3("configure --disable-modules='lte;mpi'")
335  self.config_ok(return_code, stdout)
336 
337  # At this point we should have fewer modules
338  enabled_modules = get_enabled_modules()
339  self.assertLess(len(enabled_modules), len(self.ns3_modules))
340  self.assertNotIn("ns3-lte", enabled_modules)
341  self.assertNotIn("ns3-mpi", enabled_modules)
342 
343  # Try cleaning the list of enabled modules to reset to the normal configuration
344  return_code, stdout, stderr = run_ns3("configure --disable-modules=''")
345  self.config_ok(return_code, stdout)
346 
347  # At this point we should have the same amount of modules that we had when we started
348  self.assertEqual(len(get_enabled_modules()), len(self.ns3_modules))
349 
350  def test_05_Ns3rc(self):
351  ns3rc_template = "# ! /usr/bin/env python\
352  \
353  # A list of the modules that will be enabled when ns-3 is run.\
354  # Modules that depend on the listed modules will be enabled also.\
355  #\
356  # All modules can be enabled by choosing 'all_modules'.\
357  modules_enabled = [{modules}]\
358  \
359  # Set this equal to true if you want examples to be run.\
360  examples_enabled = {examples}\
361  \
362  # Set this equal to true if you want tests to be run.\
363  tests_enabled = {tests}\
364  "
365 
366  # Now we repeat the command line tests but with the ns3rc file
367  with open(ns3rc_script, "w") as f:
368  f.write(ns3rc_template.format(modules="'lte'", examples="False", tests="True"))
369 
370  # Reconfigure
371  return_code, stdout, stderr = run_ns3("configure")
372  self.config_ok(return_code, stdout)
373 
374  # Check
375  enabled_modules = get_enabled_modules()
376  self.assertLess(len(get_enabled_modules()), len(self.ns3_modules))
377  self.assertIn("ns3-lte", enabled_modules)
378  self.assertTrue(get_test_enabled())
379  self.assertEqual(len(get_programs_list()) + 1, len(self.ns3_executables)) # the +1 is due to test-runner
380 
381  # Replace the ns3rc file
382  with open(ns3rc_script, "w") as f:
383  f.write(ns3rc_template.format(modules="'wifi'", examples="True", tests="False"))
384 
385  # Reconfigure
386  return_code, stdout, stderr = run_ns3("configure")
387  self.config_ok(return_code, stdout)
388 
389  # Check
390  enabled_modules = get_enabled_modules()
391  self.assertLess(len(get_enabled_modules()), len(self.ns3_modules))
392  self.assertIn("ns3-wifi", enabled_modules)
393  self.assertFalse(get_test_enabled())
394  self.assertGreater(len(get_programs_list()), len(self.ns3_executables))
395 
396  # Then we roll back by removing the ns3rc config file
397  os.remove(ns3rc_script)
398 
399  # Reconfigure
400  return_code, stdout, stderr = run_ns3("configure")
401  self.config_ok(return_code, stdout)
402 
403  # Check
404  self.assertEqual(len(get_enabled_modules()), len(self.ns3_modules))
405  self.assertFalse(get_test_enabled())
406  self.assertEqual(len(get_programs_list()), len(self.ns3_executables))
407 
408  def test_06_DryRun(self):
409  # todo: collect commands from CMake and test them
410  pass
411 
412 
413 class NS3BuildBaseTestCase(NS3BaseTestCase):
414  cleaned_once = False
415 
416  def setUp(self):
417  if not NS3BuildBaseTestCase.cleaned_once:
418  NS3BuildBaseTestCase.cleaned_once = True
419  NS3BaseTestCase.cleaned_once = False
420  super().setUp()
421 
423  return_code, stdout, stderr = run_ns3("build core")
424  self.assertEqual(return_code, 0)
425  self.assertIn("Built target libcore", stdout)
426 
428  # tests are not enable, so the target isn't available
429  return_code, stdout, stderr = run_ns3("build core-test")
430  self.assertGreater(len(stderr), 0)
431 
433  return_code, stdout, stderr = run_ns3("build")
434  self.assertEqual(return_code, 0)
435  self.assertIn("Built target", stdout)
436  for program in get_programs_list():
437  self.assertTrue(os.path.exists(program))
438 
440  return_code, stdout, stderr = run_ns3("--verbose build")
441  self.assertEqual(return_code, 0)
442  self.assertIn("Built target", stdout)
443  for program in get_programs_list():
444  self.assertTrue(os.path.exists(program))
445  self.assertIn(cmake_refresh_cache_command, stdout)
446  self.assertIn(cmake_build_project_command, stdout)
447 
449  return_code, stdout, stderr = run_ns3("--no-task-lines build")
450  self.assertEqual(return_code, 0)
451  self.assertEqual(len(stderr), 0)
452  self.assertEqual(len(stdout), 0)
453 
455  return_code, stdout, stderr = run_ns3("--no-task-lines --verbose build")
456  self.assertEqual(return_code, 0)
457  self.assertIn(cmake_refresh_cache_command, stdout)
458  self.assertIn(cmake_build_project_command, stdout)
459 
460 
462  cleaned_once = False
463 
464  def setUp(self):
465  if not NS3ExpectedUseTestCase.cleaned_once:
466  NS3ExpectedUseTestCase.cleaned_once = True
467  NS3BaseTestCase.cleaned_once = False
468  super().setUp()
469 
470  # On top of the release build configured by NS3ConfigureTestCase, also enable examples, tests and docs
471  return_code, stdout, stderr = run_ns3("configure --enable-examples --enable-tests --enable-documentation")
472  self.config_ok(return_code, stdout)
473 
474  # Check if build-status.py exists, then read to get list of executables
475  self.assertTrue(os.path.exists(build_status_script))
477 
478  # Check if c4che.py exists than read to get the list of enabled modules
479  self.assertTrue(os.path.exists(c4che_script))
481 
483  return_code, stdout, stderr = run_ns3("--verbose build")
484  self.assertEqual(return_code, 0)
485  self.assertIn("Built target", stdout)
486  for program in get_programs_list():
487  self.assertTrue(os.path.exists(program))
488  libraries = ";".join(glob.glob(os.sep.join([ns3_path, "build", "lib"]) + '/*', recursive=True))
489  for module in get_enabled_modules():
490  self.assertIn(module.replace("ns3-", ""), libraries)
491  self.assertIn(cmake_refresh_cache_command, stdout)
492  self.assertIn(cmake_build_project_command, stdout)
493 
495  return_code, stdout, stderr = run_ns3('--verbose --run "test-runner --list"')
496  self.assertEqual(return_code, 0)
497  self.assertIn("Built target test-runner", stdout)
498  self.assertIn(cmake_refresh_cache_command, stdout)
499  self.assertIn(cmake_build_target_command(target="test-runner"), stdout)
500 
502  return_code, stdout, stderr = run_ns3("--run core") # this should not work
503  self.assertEqual(return_code, 1)
504  self.assertIn("Couldn't find the specified program: core", stderr)
505 
507  return_code, stdout, stderr = run_ns3("--run nonsense") # this should not work
508  self.assertEqual(return_code, 1)
509  self.assertIn("Couldn't find the specified program: nonsense", stderr)
510 
512  return_code, stdout, stderr = run_ns3('--verbose --run-no-build "test-runner --list"')
513  self.assertEqual(return_code, 0)
514  self.assertNotIn("Built target test-runner", stdout)
515  self.assertNotIn(cmake_refresh_cache_command, stdout)
516  self.assertNotIn(cmake_build_target_command(target="test-runner"), stdout)
517  self.assertIn("test-runner", stdout)
518  self.assertIn("--list", stdout)
519 
521  return_code, stdout, stderr = run_ns3("--verbose --run-no-build core") # this should not work
522  self.assertEqual(return_code, 1)
523  self.assertIn("Couldn't find the specified program: core", stderr)
524 
526  return_code, stdout, stderr = run_ns3("--verbose --run-no-build nonsense") # this should not work
527  self.assertEqual(return_code, 1)
528  self.assertIn("Couldn't find the specified program: nonsense", stderr)
529 
531  return_code, stdout, stderr = run_ns3("--run-no-build scratch-simulator --gdb")
532  self.assertEqual(return_code, 0)
533  self.assertIn("scratch-simulator", stdout)
534  self.assertIn("No debugging symbols found", stdout)
535 
537  return_code, stdout, stderr = run_ns3("--run-no-build scratch-simulator --valgrind")
538  self.assertEqual(return_code, 0)
539  self.assertIn("scratch-simulator", stderr)
540  self.assertIn("Memcheck", stderr)
541 
543  return_code, stdout, stderr = run_ns3("--verbose --doxygen")
544  self.assertEqual(return_code, 0)
545  self.assertIn(cmake_refresh_cache_command, stdout)
546  self.assertIn(cmake_build_target_command(target="doxygen"), stdout)
547  self.assertIn("Built target doxygen", stdout)
548 
550  return_code, stdout, stderr = run_ns3("--verbose --doxygen-no-build")
551  self.assertEqual(return_code, 0)
552  self.assertIn(cmake_refresh_cache_command, stdout)
553  self.assertIn(cmake_build_target_command(target="doxygen-no-build"), stdout)
554  self.assertIn("Built target doxygen-no-build", stdout)
555 
556 
557 if __name__ == '__main__':
558  loader = unittest.TestLoader()
559  suite = unittest.TestSuite()
560 
561  # Put tests cases in order
562  suite.addTests(loader.loadTestsFromTestCase(NS3RunWafTargets))
563  suite.addTests(loader.loadTestsFromTestCase(NS3CommonSettingsTestCase))
564  suite.addTests(loader.loadTestsFromTestCase(NS3ConfigureBuildProfileTestCase))
565  suite.addTests(loader.loadTestsFromTestCase(NS3ConfigureTestCase))
566  suite.addTests(loader.loadTestsFromTestCase(NS3BuildBaseTestCase))
567  suite.addTests(loader.loadTestsFromTestCase(NS3ExpectedUseTestCase))
568 
569  # Before running, check if ns3rc exists and save it
570  ns3rc_script_bak = ns3rc_script + ".bak"
571  if os.path.exists(ns3rc_script) and not os.path.exists(ns3rc_script_bak):
572  shutil.move(ns3rc_script, ns3rc_script_bak)
573 
574  # Run tests and fail as fast as possible
575  runner = unittest.TextTestRunner(failfast=True)
576  result = runner.run(suite)
577 
578  # After completing the tests successfully, restore the ns3rc file
579  if os.path.exists(ns3rc_script_bak):
580  shutil.move(ns3rc_script_bak, ns3rc_script)
test-ns3.NS3BuildBaseTestCase.setUp
def setUp(self)
Definition: test-ns3.py:416
test-ns3.NS3BuildBaseTestCase.test_04_BuildProjectVerbose
def test_04_BuildProjectVerbose(self)
Definition: test-ns3.py:439
test-ns3.NS3ExpectedUseTestCase.test_09_RunNoBuildValgrind
def test_09_RunNoBuildValgrind(self)
Definition: test-ns3.py:536
test-ns3.NS3ExpectedUseTestCase.setUp
def setUp(self)
Definition: test-ns3.py:464
test-ns3.NS3RunWafTargets.ns3_executables
ns3_executables
Definition: test-ns3.py:123
test-ns3.NS3CommonSettingsTestCase.test_01_NoOption
def test_01_NoOption(self)
Definition: test-ns3.py:159
test-ns3.NS3ConfigureBuildProfileTestCase
Definition: test-ns3.py:180
test-ns3.NS3ConfigureTestCase.setUp
def setUp(self)
Definition: test-ns3.py:268
test-ns3.NS3BuildBaseTestCase.test_06_BuildProjectVerboseAndNoTaskLines
def test_06_BuildProjectVerboseAndNoTaskLines(self)
Definition: test-ns3.py:454
test-ns3.run_program
def run_program(program, args, python=False)
Definition: test-ns3.py:55
test-ns3.NS3ConfigureBuildProfileTestCase.test_01_Debug
def test_01_Debug(self)
Definition: test-ns3.py:186
test-ns3.NS3ExpectedUseTestCase
Definition: test-ns3.py:461
test-ns3.get_enabled_modules
def get_enabled_modules()
Definition: test-ns3.py:100
test-ns3.NS3RunWafTargets.test_04_runNobuildExample
def test_04_runNobuildExample(self)
Definition: test-ns3.py:137
test-ns3.NS3RunWafTargets.test_05_runTestCaseCoreExampleSimulator
def test_05_runTestCaseCoreExampleSimulator(self)
Definition: test-ns3.py:142
test-ns3.NS3ConfigureTestCase.test_02_Tests
def test_02_Tests(self)
Definition: test-ns3.py:292
test-ns3.NS3ConfigureTestCase.test_06_DryRun
def test_06_DryRun(self)
Definition: test-ns3.py:408
test-ns3.NS3BaseTestCase.ns3_executables
ns3_executables
Definition: test-ns3.py:257
test-ns3.NS3ConfigureBuildProfileTestCase.test_04_Typo
def test_04_Typo(self)
Definition: test-ns3.py:222
test-ns3.NS3ConfigureBuildProfileTestCase.test_03_Optimized
def test_03_Optimized(self)
Definition: test-ns3.py:207
test-ns3.NS3BuildBaseTestCase.test_03_BuildProject
def test_03_BuildProject(self)
Definition: test-ns3.py:432
test-ns3.NS3ExpectedUseTestCase.test_03_BuildAndRunExistingLibraryTarget
def test_03_BuildAndRunExistingLibraryTarget(self)
Definition: test-ns3.py:501
test-ns3.NS3CommonSettingsTestCase.test_03_NoTaskLines
def test_03_NoTaskLines(self)
Definition: test-ns3.py:169
test-ns3.NS3RunWafTargets
Definition: test-ns3.py:104
test-ns3.NS3ExpectedUseTestCase.test_11_DoxygenWithoutBuild
def test_11_DoxygenWithoutBuild(self)
Definition: test-ns3.py:549
test-ns3.NS3ConfigureBuildProfileTestCase.test_02_Release
def test_02_Release(self)
Definition: test-ns3.py:201
test-ns3.NS3BaseTestCase.config_ok
def config_ok(self, return_code, stdout)
Definition: test-ns3.py:237
test-ns3.NS3ExpectedUseTestCase.test_02_BuildAndRunExistingExecutableTarget
def test_02_BuildAndRunExistingExecutableTarget(self)
Definition: test-ns3.py:494
max
#define max(a, b)
Definition: 80211b.c:43
test-ns3.NS3ExpectedUseTestCase.test_07_RunNoBuildNonExistingExecutableTarget
def test_07_RunNoBuildNonExistingExecutableTarget(self)
Definition: test-ns3.py:525
test-ns3.read_c4che_entry
def read_c4che_entry(entry)
Definition: test-ns3.py:89
test-ns3.NS3ConfigureTestCase.test_03_EnableModules
def test_03_EnableModules(self)
Definition: test-ns3.py:314
test-ns3.NS3BuildBaseTestCase.test_01_BuildExistingTargets
def test_01_BuildExistingTargets(self)
Definition: test-ns3.py:422
test-ns3.NS3ConfigureTestCase
Definition: test-ns3.py:264
test-ns3.NS3CommonSettingsTestCase.test_04_CheckConfig
def test_04_CheckConfig(self)
Definition: test-ns3.py:174
test-ns3.NS3CommonSettingsTestCase
Definition: test-ns3.py:153
test-ns3.NS3RunWafTargets.ns3_modules
ns3_modules
Definition: test-ns3.py:129
test-ns3.run_ns3
def run_ns3(args)
Definition: test-ns3.py:50
test-ns3.NS3BaseTestCase.ns3_modules
ns3_modules
Definition: test-ns3.py:261
test-ns3.NS3RunWafTargets.test_03_runNobuildScratchSim
def test_03_runNobuildScratchSim(self)
Definition: test-ns3.py:132
test-ns3.NS3ConfigureBuildProfileTestCase.setUp
def setUp(self)
Definition: test-ns3.py:181
test-ns3.NS3ConfigureBuildProfileTestCase.test_05_TYPO
def test_05_TYPO(self)
Definition: test-ns3.py:227
test-ns3.get_test_enabled
def get_test_enabled()
Definition: test-ns3.py:96
test-ns3.NS3RunWafTargets.test_02_loadModules
def test_02_loadModules(self)
Definition: test-ns3.py:126
test-ns3.NS3RunWafTargets.test_01_loadExecutables
def test_01_loadExecutables(self)
Definition: test-ns3.py:120
test-ns3.NS3BuildBaseTestCase.test_05_BuildProjectNoTaskLines
def test_05_BuildProjectNoTaskLines(self)
Definition: test-ns3.py:448
test-ns3.NS3BaseTestCase
Definition: test-ns3.py:233
test-ns3.NS3ExpectedUseTestCase.test_04_BuildAndRunNonExistingTarget
def test_04_BuildAndRunNonExistingTarget(self)
Definition: test-ns3.py:506
test-ns3.NS3ConfigureTestCase.test_04_DisableModules
def test_04_DisableModules(self)
Definition: test-ns3.py:332
test-ns3.get_programs_list
def get_programs_list()
Definition: test-ns3.py:82
test-ns3.NS3CommonSettingsTestCase.setUp
def setUp(self)
Definition: test-ns3.py:154
test-ns3.NS3ExpectedUseTestCase.test_01_BuildProjectVerbose
def test_01_BuildProjectVerbose(self)
Definition: test-ns3.py:482
test-ns3.NS3BuildBaseTestCase.test_02_BuildNonExistingTargets
def test_02_BuildNonExistingTargets(self)
Definition: test-ns3.py:427
test-ns3.NS3CommonSettingsTestCase.test_02_Verbose
def test_02_Verbose(self)
Definition: test-ns3.py:164
test-ns3.NS3ConfigureTestCase.test_05_Ns3rc
def test_05_Ns3rc(self)
Definition: test-ns3.py:350
test-ns3.NS3ExpectedUseTestCase.test_08_RunNoBuildGdb
def test_08_RunNoBuildGdb(self)
Definition: test-ns3.py:530
test-ns3.cmake_build_target_command
cmake_build_target_command
Definition: test-ns3.py:44
test-ns3.NS3RunWafTargets.test_06_runTestCaseExamplesAsTestsTestSuite
def test_06_runTestCaseExamplesAsTestsTestSuite(self)
Definition: test-ns3.py:147
test-ns3.NS3ExpectedUseTestCase.test_10_DoxygenWithBuild
def test_10_DoxygenWithBuild(self)
Definition: test-ns3.py:542
test-ns3.NS3ExpectedUseTestCase.test_06_RunNoBuildExistingLibraryTarget
def test_06_RunNoBuildExistingLibraryTarget(self)
Definition: test-ns3.py:520
test-ns3.NS3ExpectedUseTestCase.test_05_RunNoBuildExistingExecutableTarget
def test_05_RunNoBuildExistingExecutableTarget(self)
Definition: test-ns3.py:511
test-ns3.NS3ConfigureTestCase.test_01_Examples
def test_01_Examples(self)
Definition: test-ns3.py:274
test-ns3.NS3BaseTestCase.setUp
def setUp(self)
Definition: test-ns3.py:242
test-ns3.NS3RunWafTargets.setUp
def setUp(self)
Definition: test-ns3.py:108