improve test-case to cover pthread/ucontext, dlm/cooja, with vdl/no-vdl
diff -r 9c972df8a320 test/dce-manager-test.cc
--- a/test/dce-manager-test.cc Mon Jul 09 17:35:31 2012 +0200
+++ b/test/dce-manager-test.cc Tue Jul 10 00:56:45 2012 +0900
@@ -25,7 +25,8 @@
class DceManagerTestCase : public TestCase
{
public:
- DceManagerTestCase (std::string filename, Time maxDuration, std::string stdinFilename, bool useNet, bool useK);
+ DceManagerTestCase (std::string filename, Time maxDuration, std::string stdinFilename,
+ bool useNet, bool useK);
private:
virtual void DoRun (void);
static void Finished (int *pstatus, uint16_t pid, int status);
@@ -37,9 +38,16 @@
bool m_useNet;
};
-DceManagerTestCase::DceManagerTestCase (std::string filename, Time maxDuration, std::string stdin, bool useNet, bool useK)
- : TestCase ("Check that process \"" + filename + "\" completes correctly."),
- m_filename (filename), m_stdinFilename ( stdin), m_maxDuration ( maxDuration ), m_useKernel (useK), m_useNet (useNet)
+DceManagerTestCase::DceManagerTestCase (std::string filename, Time maxDuration,
+ std::string stdin, bool useNet, bool useK)
+ : TestCase ("Check that process \"" + filename +
+ (useK ? " (kernel" : " (ns3)") +
+ "\" completes correctly."),
+ m_filename (filename),
+ m_stdinFilename (stdin),
+ m_maxDuration (maxDuration),
+ m_useKernel (useK),
+ m_useNet (useNet)
{
// mtrace ();
}
@@ -83,7 +91,6 @@
apps = dce.Install (nodes.Get (0));
apps.Start (Seconds (3.0));
- //dceManager.SetTaskManagerAttribute( "FiberManagerType", StringValue ( "UcontextFiberManager" ) );
} else
{
dceManager.Install (nodes);
@@ -164,7 +171,7 @@
{ "test-random", 0, "", false },
{ "test-local-socket", 0, "", false },
{ "test-poll", 3200, "", true },
- // { "test-tcp-socket", 320, "", true },
+ { "test-tcp-socket", 320, "", true },
{ "test-exec", 0, "" , false},
/* { "test-raw-socket", 320, "", true },*/
{ "test-iperf", 0, "" , false},
@@ -193,7 +200,10 @@
for (unsigned int i = 0; i < sizeof(tests)/sizeof(testPair); i++)
{
- AddTestCase (new DceManagerTestCase (tests[i].name, Seconds (tests[i].duration), tests[i].stdinfile, tests[i].useNet, useKernel () ) );
+ AddTestCase (new DceManagerTestCase (tests[i].name, Seconds (tests[i].duration),
+ tests[i].stdinfile,
+ tests[i].useNet,
+ useKernel ()));
}
}
diff -r 9c972df8a320 utils/test.sh
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/utils/test.sh Tue Jul 10 00:56:45 2012 +0900
@@ -0,0 +1,20 @@
+#!/bin/sh
+
+. ./utils/setenv.sh
+#VERBOSE=""
+
+echo -n "Cooja (non-vdl) + Pthread: "
+NS_ATTRIBUTE_DEFAULT='ns3::TaskManager::FiberManagerType=PthreadFiberManager' ./build/bin/ns3test-dce $VERBOSE
+echo -n "Cooja (non-vdl) + Ucontext: "
+NS_ATTRIBUTE_DEFAULT='ns3::TaskManager::FiberManagerType=UcontextFiberManager' ./build/bin/ns3test-dce $VERBOSE
+
+echo -n "Cooja (vdl) + Pthread: "
+NS_ATTRIBUTE_DEFAULT='ns3::DceManagerHelper::LoaderFactory=ns3::CoojaLoaderFactory[];ns3::TaskManager::FiberManagerType=PthreadFiberManager' ./build/bin/ns3test-dce-vdl $VERBOSE
+
+echo -n "Cooja (vdl) + Ucontext: "
+NS_ATTRIBUTE_DEFAULT='ns3::DceManagerHelper::LoaderFactory=ns3::CoojaLoaderFactory[];ns3::TaskManager::FiberManagerType=UcontextFiberManager' ./build/bin/ns3test-dce-vdl $VERBOSE
+
+echo -n "Dlm (vdl) + Pthread: "
+NS_ATTRIBUTE_DEFAULT='ns3::DceManagerHelper::LoaderFactory=ns3::DlmLoaderFactory[];ns3::TaskManager::FiberManagerType=PthreadFiberManager' ./build/bin/ns3test-dce-vdl $VERBOSE
+echo -n "Dlm (vdl) + Ucontext: "
+NS_ATTRIBUTE_DEFAULT='ns3::DceManagerHelper::LoaderFactory=ns3::DlmLoaderFactory[];ns3::TaskManager::FiberManagerType=UcontextFiberManager' ./build/bin/ns3test-dce-vdl $VERBOSE
diff -r 9c972df8a320 wscript
--- a/wscript Mon Jul 09 17:35:31 2012 +0200
+++ b/wscript Tue Jul 10 00:56:45 2012 +0900
@@ -136,8 +136,12 @@
def build_dce_tests(module, kern):
if kern:
module.add_runner_test(needed=['core', 'dce', 'internet'], source=['test/dce-manager-test.cc', 'test/with-kernel.cc'])
+ module.add_runner_test(needed=['core', 'dce', 'internet'], source=['test/dce-manager-test.cc', 'test/with-kernel.cc'],
+ linkflags = ['-Wl,--dynamic-linker=' + os.path.abspath ('../build/lib/ldso')], name='vdl')
else:
module.add_runner_test(needed=['core', 'dce', 'internet'], source=['test/dce-manager-test.cc','test/without-kernel.cc'])
+ module.add_runner_test(needed=['core', 'dce', 'internet'], source=['test/dce-manager-test.cc','test/without-kernel.cc'],
+ linkflags = ['-Wl,--dynamic-linker=' + os.path.abspath ('../build/lib/ldso')], name='vdl')
module.add_test(features='cxx cxxshlib', source=['test/test-macros.cc'],
target='lib/test', linkflags=['-Wl,-soname=libtest.so'])