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

(-)a/test/dce-manager-test.cc (-7 / +17 lines)
 Lines 25-31    Link Here 
25
class DceManagerTestCase : public TestCase
25
class DceManagerTestCase : public TestCase
26
{
26
{
27
public:
27
public:
28
  DceManagerTestCase (std::string filename, Time maxDuration, std::string stdinFilename, bool useNet, bool useK);
28
  DceManagerTestCase (std::string filename, Time maxDuration, std::string stdinFilename, 
29
                      bool useNet, bool useK);
29
private:
30
private:
30
  virtual void DoRun (void);
31
  virtual void DoRun (void);
31
  static void Finished (int *pstatus, uint16_t pid, int status);
32
  static void Finished (int *pstatus, uint16_t pid, int status);
 Lines 37-45    Link Here 
37
  bool m_useNet;
38
  bool m_useNet;
38
};
39
};
39
40
40
DceManagerTestCase::DceManagerTestCase (std::string filename, Time maxDuration, std::string stdin, bool useNet, bool useK)
41
DceManagerTestCase::DceManagerTestCase (std::string filename, Time maxDuration, 
41
  : TestCase ("Check that process \"" + filename + "\" completes correctly."),
42
                                        std::string stdin, bool useNet, bool useK)
42
    m_filename (filename), m_stdinFilename ( stdin), m_maxDuration ( maxDuration ), m_useKernel (useK), m_useNet (useNet)
43
  : TestCase ("Check that process \"" + filename +
44
              (useK ? " (kernel" : " (ns3)") + 
45
              "\" completes correctly."),
46
    m_filename (filename), 
47
    m_stdinFilename (stdin),
48
    m_maxDuration (maxDuration),
49
    m_useKernel (useK),
50
    m_useNet (useNet)
43
{
51
{
44
//  mtrace ();
52
//  mtrace ();
45
}
53
}
 Lines 83-89    Link Here 
83
          apps = dce.Install (nodes.Get (0));
91
          apps = dce.Install (nodes.Get (0));
84
          apps.Start (Seconds (3.0));
92
          apps.Start (Seconds (3.0));
85
93
86
          //dceManager.SetTaskManagerAttribute( "FiberManagerType", StringValue ( "UcontextFiberManager" ) );
87
        } else
94
        } else
88
        {
95
        {
89
          dceManager.Install (nodes);
96
          dceManager.Install (nodes);
 Lines 164-170    Link Here 
164
      {  "test-random", 0, "", false },
171
      {  "test-random", 0, "", false },
165
      {  "test-local-socket", 0, "", false },
172
      {  "test-local-socket", 0, "", false },
166
      {  "test-poll", 3200, "", true },
173
      {  "test-poll", 3200, "", true },
167
      //      {  "test-tcp-socket", 320, "", true },
174
      {  "test-tcp-socket", 320, "", true },
168
      {  "test-exec", 0, "" , false},
175
      {  "test-exec", 0, "" , false},
169
      /* {  "test-raw-socket", 320, "", true },*/
176
      /* {  "test-raw-socket", 320, "", true },*/
170
      {  "test-iperf", 0, "" , false},
177
      {  "test-iperf", 0, "" , false},
 Lines 193-199    Link Here 
193
200
194
  for (unsigned int i = 0; i < sizeof(tests)/sizeof(testPair); i++)
201
  for (unsigned int i = 0; i < sizeof(tests)/sizeof(testPair); i++)
195
    {
202
    {
196
      AddTestCase (new DceManagerTestCase (tests[i].name,  Seconds (tests[i].duration), tests[i].stdinfile, tests[i].useNet, useKernel () ) );
203
      AddTestCase (new DceManagerTestCase (tests[i].name,  Seconds (tests[i].duration), 
204
                                           tests[i].stdinfile, 
205
                                           tests[i].useNet, 
206
                                           useKernel ()));
197
    }
207
    }
198
}
208
}
199
209
(-)9c972df8a320 (+20 lines)
Added Link Here 
1
#!/bin/sh
2
3
. ./utils/setenv.sh
4
#VERBOSE=""
5
6
echo -n "Cooja (non-vdl) + Pthread:  "
7
NS_ATTRIBUTE_DEFAULT='ns3::TaskManager::FiberManagerType=PthreadFiberManager' ./build/bin/ns3test-dce $VERBOSE
8
echo -n "Cooja (non-vdl) + Ucontext: "
9
NS_ATTRIBUTE_DEFAULT='ns3::TaskManager::FiberManagerType=UcontextFiberManager' ./build/bin/ns3test-dce $VERBOSE
10
11
echo -n "Cooja (vdl) + Pthread:      "
12
NS_ATTRIBUTE_DEFAULT='ns3::DceManagerHelper::LoaderFactory=ns3::CoojaLoaderFactory[];ns3::TaskManager::FiberManagerType=PthreadFiberManager' ./build/bin/ns3test-dce-vdl $VERBOSE
13
14
echo -n "Cooja (vdl) + Ucontext:     "
15
NS_ATTRIBUTE_DEFAULT='ns3::DceManagerHelper::LoaderFactory=ns3::CoojaLoaderFactory[];ns3::TaskManager::FiberManagerType=UcontextFiberManager' ./build/bin/ns3test-dce-vdl $VERBOSE
16
17
echo -n "Dlm (vdl) + Pthread:        "
18
NS_ATTRIBUTE_DEFAULT='ns3::DceManagerHelper::LoaderFactory=ns3::DlmLoaderFactory[];ns3::TaskManager::FiberManagerType=PthreadFiberManager' ./build/bin/ns3test-dce-vdl $VERBOSE
19
echo -n "Dlm (vdl) + Ucontext:       "
20
NS_ATTRIBUTE_DEFAULT='ns3::DceManagerHelper::LoaderFactory=ns3::DlmLoaderFactory[];ns3::TaskManager::FiberManagerType=UcontextFiberManager' ./build/bin/ns3test-dce-vdl $VERBOSE
(-)a/wscript (+4 lines)
 Lines 136-143    Link Here 
136
def build_dce_tests(module, kern):
136
def build_dce_tests(module, kern):
137
    if kern:
137
    if kern:
138
        module.add_runner_test(needed=['core', 'dce', 'internet'],  source=['test/dce-manager-test.cc', 'test/with-kernel.cc'])
138
        module.add_runner_test(needed=['core', 'dce', 'internet'],  source=['test/dce-manager-test.cc', 'test/with-kernel.cc'])
139
        module.add_runner_test(needed=['core', 'dce', 'internet'],  source=['test/dce-manager-test.cc', 'test/with-kernel.cc'],
140
                               linkflags = ['-Wl,--dynamic-linker=' + os.path.abspath ('../build/lib/ldso')], name='vdl')
139
    else:
141
    else:
140
        module.add_runner_test(needed=['core', 'dce', 'internet'], source=['test/dce-manager-test.cc','test/without-kernel.cc'])
142
        module.add_runner_test(needed=['core', 'dce', 'internet'], source=['test/dce-manager-test.cc','test/without-kernel.cc'])
143
        module.add_runner_test(needed=['core', 'dce', 'internet'], source=['test/dce-manager-test.cc','test/without-kernel.cc'],
144
                               linkflags = ['-Wl,--dynamic-linker=' + os.path.abspath ('../build/lib/ldso')], name='vdl')
141
    	    
145
    	    
142
    module.add_test(features='cxx cxxshlib', source=['test/test-macros.cc'], 
146
    module.add_test(features='cxx cxxshlib', source=['test/test-macros.cc'], 
143
                    target='lib/test', linkflags=['-Wl,-soname=libtest.so'])
147
                    target='lib/test', linkflags=['-Wl,-soname=libtest.so'])

Return to bug 1462