12.07.2015 Views

The ns Manual (formerly ns Notes and Documentation)1 - NM Lab at ...

The ns Manual (formerly ns Notes and Documentation)1 - NM Lab at ...

The ns Manual (formerly ns Notes and Documentation)1 - NM Lab at ...

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 27Test Suite Support<strong>The</strong> <strong>ns</strong> distribution contai<strong>ns</strong> many test suites under ~<strong>ns</strong>/tcl/test, which used by valid<strong>at</strong>ion programs (~<strong>ns</strong>/valid<strong>at</strong>e, valid<strong>at</strong>ewired,valid<strong>at</strong>e-wireless, <strong>and</strong> valid<strong>at</strong>e.win32) to verify th<strong>at</strong> the i<strong>ns</strong>tall<strong>at</strong>ion of <strong>ns</strong> is correct. If you modify or add new modulesto <strong>ns</strong>, you are encouraged to run the valid<strong>at</strong>ion programs to make sure th<strong>at</strong> your changes do not affect other parts in <strong>ns</strong>.27.1 Test Suite ComponentsEach test suite under ~<strong>ns</strong>/tcl/test is written to verify the correctness of a certain module in <strong>ns</strong>. It has 3 components:• A shell script (test-all-xxx) to start the test;• A <strong>ns</strong> tcl script (test-suite-xxx.tcl) to actually run through the tests defined.• A subdirectory (test-output-xxx) under ~<strong>ns</strong>/tcl/test, which contai<strong>ns</strong> thecorrect trace files gener<strong>at</strong>ed by the test suite.<strong>The</strong>se files are used to verify if the test suite ru<strong>ns</strong> correctly with your <strong>ns</strong>.(Note: xxx st<strong>and</strong>s for the name of the test suite.)27.2 Write a Test SuiteYou can take one of the test suites under ~<strong>ns</strong>/tcl/test as a templ<strong>at</strong>e when you are writing your own, for example the test suitewritten for wireless lan (test-all-wireless-lan, test-suite-wireless-lan.tcl, <strong>and</strong> test-output-wireless-lan).To write a test suite, you first need to write the shell script (test-all-xxx). In the shell script, you specify the module to betested, the name of the <strong>ns</strong> tcl script <strong>and</strong> the output subdirectory. You can run this shell script in quiet mode. Below is theexample (test-all-wireless-lan):# To run in quiet mode: "./test-all-wireless-lan quiet".f="wireless-lan" # Specify the name of the module to test.244

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!