Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Update rtt_fair to use multiple -H invocations for hostnames, and cha…

…nge how

this works slightly (admit default values).
  • Loading branch information...
commit 6491efb0c5f6141fc45e08d5ffd9a65ec173b35b 1 parent 4a8e612
Toke Høiland-Jørgensen authored

Showing 2 changed files with 74 additions and 59 deletions. Show diff stats Hide diff stats

  1. +14 3 netperf_wrapper/settings.py
  2. +60 56 tests/rtt_fair.conf
17 netperf_wrapper/settings.py
@@ -124,8 +124,18 @@ def include_test(self, name, env=None):
124 124 self.execute(os.path.join(TEST_PATH, name))
125 125
126 126 def require_host_count(self, count):
127   - if len(self.env['HOSTS']) < count and not self.env['INPUT']:
128   - raise RuntimeError("Need %d hosts, only %d specified" % (count, len(self.env['HOSTS'])))
  127 + if len(self.env['HOSTS']) < count:
  128 + if 'DEFAULTS' in self.env and 'HOSTS' in self.env['DEFAULTS'] and self.env['DEFAULTS']['HOSTS']:
  129 + # If a default HOSTS list is set, populate the HOSTS list with
  130 + # values from this list, repeating as necessary up to count
  131 + def_hosts = self.env['DEFAULTS']['HOSTS']
  132 + host_c = len(self.env['HOSTS'])
  133 + missing_c = count-host_c
  134 + self.env['HOSTS'].extend((def_hosts * (missing_c//len(def_hosts)+1))[:missing_c])
  135 + if not self.env['HOST']:
  136 + self.env['HOST'] = self.env['HOSTS'][0]
  137 + else:
  138 + raise RuntimeError("Need %d hosts, only %d specified" % (count, len(self.env['HOSTS'])))
129 139
130 140 parser = optparse.OptionParser(description='Wrapper to run concurrent netperf-style tests',
131 141 usage="usage: %prog [options] -H <host> test")
@@ -225,8 +235,8 @@ def load():
225 235 results.append(r)
226 236
227 237
228   - settings.load_test(test_name)
229 238 settings.update(results[0].meta())
  239 + settings.load_test(test_name)
230 240 else:
231 241 if len(args) < 1:
232 242 parser.error("Missing test name.")
@@ -236,6 +246,7 @@ def load():
236 246 settings.load_test(test_name)
237 247 results = [ResultSet(NAME=settings.NAME,
238 248 HOST=settings.HOST,
  249 + HOSTS=settings.HOSTS,
239 250 TIME=settings.TIME,
240 251 LOCAL_HOST=settings.LOCAL_HOST,
241 252 TITLE=settings.TITLE,
116 tests/rtt_fair.conf
@@ -4,30 +4,34 @@
4 4
5 5 include("netperf_definitions.inc")
6 6 DESCRIPTION="RTT Fair Realtime Response Under Load"
7   -DEFAULTS={'PLOT': "all_scaled"}
8   -HOST1='snapon.lab.bufferbloat.net'
9   -HOST2='demo.tohojo.dk'
10   -HOST3='snapon.lab.bufferbloat.net'
11   -HOST4='demo.tohojo.dk'
  7 +DEFAULTS={'PLOT': "all_scaled",
  8 + 'HOSTS': [
  9 + 'snapon.lab.bufferbloat.net',
  10 + 'demo.tohojo.dk']}
  11 +
  12 +# This makes sure that four hosts are specified on the command line, and if not
  13 +# filles up the HOSTS list with input from the DEFAULTS above (repeating them if
  14 +# necessary).
  15 +min_host_count(4)
12 16
13 17 DATA_SETS = o([
14   - ('TCP upload BE %s' % HOST1,
15   - {'command': "%s -Y CS0,CS0 -H %s -t TCP_STREAM -l %d -f m" % (GLOBAL_COMMAND, HOST1, LENGTH),
  18 + ('TCP upload BE %s' % HOSTS[0],
  19 + {'command': "%s -Y CS0,CS0 -H %s -t TCP_STREAM -l %d -f m" % (GLOBAL_COMMAND, HOSTS[0], LENGTH),
16 20 'delay': DELAY,
17 21 'units': 'Mbits/s',
18 22 'runner': 'netperf_demo',}),
19   - ('TCP upload BE %s' % HOST2,
20   - {'command': "%s -Y CS0,CS0 -H %s -t TCP_STREAM -l %d -f m" % (GLOBAL_COMMAND, HOST2, LENGTH),
  23 + ('TCP upload BE %s' % HOSTS[1],
  24 + {'command': "%s -Y CS0,CS0 -H %s -t TCP_STREAM -l %d -f m" % (GLOBAL_COMMAND, HOSTS[1], LENGTH),
21 25 'delay': DELAY,
22 26 'units': 'Mbits/s',
23 27 'runner': 'netperf_demo',}),
24   - ('TCP upload BK %s' % HOST3,
25   - {'command': "%s -Y CS1,CS1 -H %s -t TCP_STREAM -l %d -f m" % (GLOBAL_COMMAND, HOST3, LENGTH),
  28 + ('TCP upload BK %s' % HOSTS[2],
  29 + {'command': "%s -Y CS1,CS1 -H %s -t TCP_STREAM -l %d -f m" % (GLOBAL_COMMAND, HOSTS[2], LENGTH),
26 30 'delay': DELAY,
27 31 'units': 'Mbits/s',
28 32 'runner': 'netperf_demo',}),
29   - ('TCP upload BK %s' % HOST4,
30   - {'command': "%s -Y CS1,CS1 -H %s -t TCP_STREAM -l %d -f m" % (GLOBAL_COMMAND, HOST4, LENGTH),
  33 + ('TCP upload BK %s' % HOSTS[3],
  34 + {'command': "%s -Y CS1,CS1 -H %s -t TCP_STREAM -l %d -f m" % (GLOBAL_COMMAND, HOSTS[3], LENGTH),
31 35 'delay': DELAY,
32 36 'units': 'Mbits/s',
33 37 'runner': 'netperf_demo',}),
@@ -40,23 +44,23 @@ DATA_SETS = o([
40 44 'units': 'Mbits/s',
41 45 'runner': 'sum',}),
42 46
43   - ('TCP download BE %s' % HOST1,
44   - {'command': "%s -Y CS0,CS0 -H %s -t TCP_MAERTS -l %d -f m" % (GLOBAL_COMMAND, HOST1, LENGTH),
  47 + ('TCP download BE %s' % HOSTS[0],
  48 + {'command': "%s -Y CS0,CS0 -H %s -t TCP_MAERTS -l %d -f m" % (GLOBAL_COMMAND, HOSTS[0], LENGTH),
45 49 'delay': DELAY,
46 50 'units': 'Mbits/s',
47 51 'runner': 'netperf_demo',}),
48   - ('TCP download BE %s' % HOST2,
49   - {'command': "%s -Y CS0,CS0 -H %s -t TCP_MAERTS -l %d -f m" % (GLOBAL_COMMAND, HOST2, LENGTH),
  52 + ('TCP download BE %s' % HOSTS[1],
  53 + {'command': "%s -Y CS0,CS0 -H %s -t TCP_MAERTS -l %d -f m" % (GLOBAL_COMMAND, HOSTS[1], LENGTH),
50 54 'delay': DELAY,
51 55 'units': 'Mbits/s',
52 56 'runner': 'netperf_demo',}),
53   - ('TCP download BK %s' % HOST3,
54   - {'command': "%s -Y CS1,CS1 -H %s -t TCP_MAERTS -l %d -f m" % (GLOBAL_COMMAND, HOST3, LENGTH),
  57 + ('TCP download BK %s' % HOSTS[2],
  58 + {'command': "%s -Y CS1,CS1 -H %s -t TCP_MAERTS -l %d -f m" % (GLOBAL_COMMAND, HOSTS[2], LENGTH),
55 59 'delay': DELAY,
56 60 'units': 'Mbits/s',
57 61 'runner': 'netperf_demo',}),
58   - ('TCP download BK %s' % HOST4 ,
59   - {'command': "%s -Y CS1,CS1 -H %s -t TCP_MAERTS -l %d -f m" % (GLOBAL_COMMAND, HOST4, LENGTH),
  62 + ('TCP download BK %s' % HOSTS[3] ,
  63 + {'command': "%s -Y CS1,CS1 -H %s -t TCP_MAERTS -l %d -f m" % (GLOBAL_COMMAND, HOSTS[3], LENGTH),
60 64 'delay': DELAY,
61 65 'units': 'Mbits/s',
62 66 'runner': 'netperf_demo',}),
@@ -69,24 +73,24 @@ DATA_SETS = o([
69 73 'units': 'Mbits/s',
70 74 'runner': 'sum',}),
71 75
72   - ('Ping (ms) ICMP %s' % HOST,
  76 + ('Ping (ms) ICMP %s' % HOSTS[0],
73 77 {'command': '%s -D -i %.2f -w %d %s' % (PING, max(0.2,STEP_SIZE), TOTAL_LENGTH, HOST),
74 78 'units': 'ms',
75 79 'runner': 'ping',}),
76   - ('Ping (ms) ICMP %s' % HOST1,
77   - {'command': '%s -D -i %.2f -w %d %s' % (PING, max(0.2,STEP_SIZE), TOTAL_LENGTH, HOST1),
  80 + ('Ping (ms) ICMP %s' % HOSTS[0],
  81 + {'command': '%s -D -i %.2f -w %d %s' % (PING, max(0.2,STEP_SIZE), TOTAL_LENGTH, HOSTS[0]),
78 82 'units': 'ms',
79 83 'runner': 'ping',}),
80   - ('Ping (ms) ICMP %s' % HOST2,
81   - {'command': '%s -D -i %.2f -w %d %s' % (PING, max(0.2,STEP_SIZE), TOTAL_LENGTH, HOST2),
  84 + ('Ping (ms) ICMP %s' % HOSTS[1],
  85 + {'command': '%s -D -i %.2f -w %d %s' % (PING, max(0.2,STEP_SIZE), TOTAL_LENGTH, HOSTS[1]),
82 86 'units': 'ms',
83 87 'runner': 'ping',}),
84   - ('Ping (ms) ICMP %s' % HOST3,
85   - {'command': '%s -D -i %.2f -w %d %s' % (PING, max(0.2,STEP_SIZE), TOTAL_LENGTH, HOST3),
  88 + ('Ping (ms) ICMP %s' % HOSTS[2],
  89 + {'command': '%s -D -i %.2f -w %d %s' % (PING, max(0.2,STEP_SIZE), TOTAL_LENGTH, HOSTS[2]),
86 90 'units': 'ms',
87 91 'runner': 'ping',}),
88   - ('Ping (ms) ICMP %s' % HOST4,
89   - {'command': '%s -D -i %.2f -w %d %s' % (PING, max(0.2,STEP_SIZE), TOTAL_LENGTH, HOST4),
  92 + ('Ping (ms) ICMP %s' % HOSTS[3],
  93 + {'command': '%s -D -i %.2f -w %d %s' % (PING, max(0.2,STEP_SIZE), TOTAL_LENGTH, HOSTS[3]),
90 94 'units': 'ms',
91 95 'runner': 'ping',}),
92 96 ('Ping (ms) avg',
@@ -100,15 +104,15 @@ PLOTS = o([
100 104 {'description': 'Download bandwidth plot',
101 105 'type': 'timeseries',
102 106 'legend_title': 'TCP download',
103   - 'series': [{'data': 'TCP download BE %s' % HOST1,
104   - 'label': 'BE %s' %HOST1,
  107 + 'series': [{'data': 'TCP download BE %s' % HOSTS[0],
  108 + 'label': 'BE %s' %HOSTS[0],
105 109 'linewidth': 2.0},
106   - {'data': 'TCP download BE %s' % HOST2,
107   - 'label': 'BE %s' % HOST2 },
108   - {'data': 'TCP download BK %s' % HOST3,
109   - 'label': 'BK %s' % HOST3 },
110   - {'data': 'TCP download BK %s' % HOST4,
111   - 'label': 'BK %s' % HOST4},
  110 + {'data': 'TCP download BE %s' % HOSTS[1],
  111 + 'label': 'BE %s' % HOSTS[1] },
  112 + {'data': 'TCP download BK %s' % HOSTS[2],
  113 + 'label': 'BK %s' % HOSTS[2] },
  114 + {'data': 'TCP download BK %s' % HOSTS[3],
  115 + 'label': 'BK %s' % HOSTS[3]},
112 116 {'data': 'TCP download avg',
113 117 'label': 'Avg',
114 118 'smoothing': 10,
@@ -124,15 +128,15 @@ PLOTS = o([
124 128 {'description': 'Upload bandwidth plot',
125 129 'type': 'timeseries',
126 130 'legend_title': 'TCP upload',
127   - 'series': [{'data': 'TCP upload BE %s' % HOST1,
128   - 'label': 'BE %s' % HOST1,
  131 + 'series': [{'data': 'TCP upload BE %s' % HOSTS[0],
  132 + 'label': 'BE %s' % HOSTS[0],
129 133 'linewidth': 2.0},
130   - {'data': 'TCP upload BE %s' % HOST2,
131   - 'label': 'BE %s' % HOST2},
132   - {'data': 'TCP upload BK %s' % HOST3,
133   - 'label': 'BK %s' % HOST3},
134   - {'data': 'TCP upload BK %s' % HOST4,
135   - 'label': 'BK %s' % HOST4},
  134 + {'data': 'TCP upload BE %s' % HOSTS[1],
  135 + 'label': 'BE %s' % HOSTS[1]},
  136 + {'data': 'TCP upload BK %s' % HOSTS[2],
  137 + 'label': 'BK %s' % HOSTS[2]},
  138 + {'data': 'TCP upload BK %s' % HOSTS[3],
  139 + 'label': 'BK %s' % HOSTS[3]},
136 140 {'data': 'TCP upload avg',
137 141 'label': 'Avg',
138 142 'smoothing': 10,
@@ -149,16 +153,16 @@ PLOTS = o([
149 153 'type': 'timeseries',
150 154 'legend_title': 'Ping (ms)',
151 155 'series': [
152   - {'data': 'Ping (ms) ICMP %s' % HOST,
153   - 'label': 'ICMP %s' % HOST },
154   - {'data': 'Ping (ms) ICMP %s' % HOST1,
155   - 'label': 'ICMP %s' % HOST1 },
156   - {'data': 'Ping (ms) ICMP %s' % HOST2,
157   - 'label': 'ICMP %s' % HOST2 },
158   - {'data': 'Ping (ms) ICMP %s' % HOST3,
159   - 'label': 'ICMP %s' % HOST3 },
160   - {'data': 'Ping (ms) ICMP %s' % HOST4,
161   - 'label': 'ICMP %s' % HOST4 },
  156 + {'data': 'Ping (ms) ICMP %s' % HOSTS[0],
  157 + 'label': 'ICMP %s' % HOSTS[0] },
  158 + {'data': 'Ping (ms) ICMP %s' % HOSTS[0],
  159 + 'label': 'ICMP %s' % HOSTS[0] },
  160 + {'data': 'Ping (ms) ICMP %s' % HOSTS[1],
  161 + 'label': 'ICMP %s' % HOSTS[1] },
  162 + {'data': 'Ping (ms) ICMP %s' % HOSTS[2],
  163 + 'label': 'ICMP %s' % HOSTS[2] },
  164 + {'data': 'Ping (ms) ICMP %s' % HOSTS[3],
  165 + 'label': 'ICMP %s' % HOSTS[3] },
162 166 {'data': 'Ping (ms) avg',
163 167 'label': 'Avg',
164 168 'smoothing': 10,

0 comments on commit 6491efb

Please sign in to comment.
Something went wrong with that request. Please try again.