View | Details | Raw Unified | Return to bug 345
Collapse All | Expand All

(-)6105fe16df43 (+33 lines)
Added Link Here 
1
#! /usr/bin/env python
2
3
"""Trace-comparison-type regression test for the Network Simulation Cradle."""
4
5
import os
6
import shutil
7
import sys
8
import tracediff
9
import platform
10
11
12
def run(verbose, generate, refDirName):
13
    """Run a Network Simulation Cradle test involving two TCP streams."""
14
15
    if not tracediff.env['ENABLE_NSC']:
16
        print >>sys.stderr, "Skipping tcp-nsc-lfn: NSC not available."
17
        raise NotImplementedError
18
19
    testName = "tcp-nsc-lfn"
20
    arguments = ["--ns3::OnOffApplication::DataRate=40000", "--runtime=20"]
21
    platform_bits = platform.architecture()[0]
22
    
23
    if platform_bits == "64bit":
24
        traceDirName = testName + "_64bit.ref"
25
    elif platform_bits == "32bit":
26
        traceDirName = testName + "_32bit.ref"
27
    else:
28
        # Something unexpected. How should we signal an error here? Rasing a
29
        # string might not be the best idea?
30
        raise "Unknown architecture, not 64 or 32 bit?"
31
32
    return tracediff.run_test(verbose, generate, refDirName,
33
        testName, arguments=arguments, refTestName=traceDirName)
(-)a/src/internet-stack/wscript (+3 lines)
 Lines 54-59    Link Here 
54
        nsc_update()
54
        nsc_update()
55
55
56
def configure(conf):
56
def configure(conf):
57
    conf.env['ENABLE_NSC'] = False
58
57
    # checks for flex and bison, which is needed to build NSCs globaliser
59
    # checks for flex and bison, which is needed to build NSCs globaliser
58
    def check_nsc_buildutils():
60
    def check_nsc_buildutils():
59
        import flex
61
        import flex
 Lines 82-87    Link Here 
82
        e.define = 'HAVE_DL'
84
        e.define = 'HAVE_DL'
83
        e.uselib = 'DL'
85
        e.uselib = 'DL'
84
        e.run()
86
        e.run()
87
        conf.env['ENABLE_NSC'] = True
85
        ok = True
88
        ok = True
86
    conf.check_message('NSC supported architecture', arch, ok)
89
    conf.check_message('NSC supported architecture', arch, ok)
87
    conf.report_optional_feature("nsc", "Network Simulation Cradle", ok,
90
    conf.report_optional_feature("nsc", "Network Simulation Cradle", ok,
(-)a/wscript (-2 / +8 lines)
 Lines 820-826    Link Here 
820
        self.testdir = testdir
820
        self.testdir = testdir
821
        self.env = Params.g_build.env_of_name('default')
821
        self.env = Params.g_build.env_of_name('default')
822
822
823
    def run_test(self, verbose, generate, refDirName, testName, arguments=[], pyscript=None):
823
    def run_test(self, verbose, generate, refDirName, testName, arguments=[], pyscript=None, refTestName=None):
824
        """
824
        """
825
        @param verbose: enable verbose execution
825
        @param verbose: enable verbose execution
826
826
 Lines 836-846    Link Here 
836
        parameter contains the path to the python script, relative to
836
        parameter contains the path to the python script, relative to
837
        the project root dir
837
        the project root dir
838
838
839
        @param refTestName: if not None, this is the name of the directory under refDirName
840
        that contains the reference traces. Otherwise "refDirname/testName + .ref" is used.
841
839
        """
842
        """
840
        if not isinstance(arguments, list):
843
        if not isinstance(arguments, list):
841
            raise TypeError
844
            raise TypeError
842
        
845
        
843
        refTestDirName = os.path.join(refDirName, (testName + ".ref"))
846
        if refTestName is None:
847
            refTestDirName = os.path.join(refDirName, (testName + ".ref"))
848
        else:
849
            refTestDirName = os.path.join(refDirName, refTestName)
844
850
845
        if not os.path.exists(refDirName):
851
        if not os.path.exists(refDirName):
846
            print"No reference trace repository"
852
            print"No reference trace repository"

Return to bug 345