regression/tests/test-tcp-nsc-lfn.py
author Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
Wed, 19 Nov 2008 17:17:07 +0000
changeset 3872 8e757a83fb36
parent 3703 71d93292bc49
child 4114 a6c5ccfa3451
permissions -rw-r--r--
Add a --with-regression-traces configure option, to allow using externally supplied regression traces instead of fetching them from the network.

#! /usr/bin/env python

"""Trace-comparison-type regression test for the Network Simulation Cradle."""

import os
import shutil
import sys
import tracediff
import platform


def run(verbose, generate):
    """Run a Network Simulation Cradle test involving two TCP streams."""

    if not tracediff.env['ENABLE_NSC']:
        print >>sys.stderr, "Skipping tcp-nsc-lfn: NSC not available."
        raise NotImplementedError

    testName = "tcp-nsc-lfn"
    arguments = ["--ns3::OnOffApplication::DataRate=40000", "--runtime=20"]
    platform_bits = platform.architecture()[0]
    
    if platform_bits == "64bit":
        traceDirName = testName + "_64bit.ref"
    elif platform_bits == "32bit":
        traceDirName = testName + "_32bit.ref"
    else:
        # Something unexpected. How should we signal an error here? Rasing a
        # string might not be the best idea?
        raise "Unknown architecture, not 64 or 32 bit?"

    return tracediff.run_test(verbose, generate,
        testName, arguments=arguments, refTestName=traceDirName)