Commits

Joshua Bonsink  committed 4d1ee9e

Improved verbose_ping() function calls

  • Participants
  • Parent commits 6499e2c

Comments (0)

Files changed (3)

File core/real/node.py

     
     """Stoppable thread to perform pings in a separate thread."""
     
-    def __init__(self, para):
-        self.para = para
+    def __init__(self, data):
+        self.data = data
         StoppableThread.__init__(self)
 
     def run(self):
         """Ping hosts based on the given parameters."""        
-        verbose_ping(self.para.hostname)
+        verbose_ping(self.data.hostname, self.data.timeout,\
+                      self.data.num_pings, self.data.packet_size)
 
 class PhysicalNode(object):
     
             ping_th = PingThread(data)
             self.pings[sock] = ping_th
             ping_th.run()
-        else:
-            ping_para = dict()
-            for key, val in data.iteritems():
-                ping_para[key] = val[0]
-            verbose_ping(**ping_para)
+        else:            
+            verbose_ping(data.hostname, data.timeout, data.num_pings, data.packet_size)
 
     def ftp_upload(self, data, host, user, password):
         """Upload data to a ftp sever"""

File test_emulation.py

 import settings
 
 scenario_option =  get_availabe_scenarios()
-skip_scenario = ['infecting', 'ddos_ping_flooding']
+skip_scenario = ['infecting', 'spamming']
 
 fid = open ('test.out', 'w')
 

File test_simulation.py

 #!/usr/bin/env python
 """test all experiments and scenarios"""
+
 from subprocess import check_call
 from util.util import get_availabe_scenarios, get_available_experiments
 import settings
 exper_options = get_available_experiments()
 scenario_option =  get_availabe_scenarios()
 skip_expr = ['topo_exp', 'manual_topo_exp', 'complex_net_exp']
-skip_scen = ['ddos_ping_flooding', 'infecting']
+skip_scen = ['spamming', 'infecting']
 
 fid = open ('test.out', 'w')