blob: caaa86403fef021ffb54e7cbc00d6372f3d7a67c [file] [log] [blame]
kelvin-onlabe5239e52015-05-13 14:46:45 -07001"""
2 Wrapper functions for FuncIntent
3 This functions include Onosclidriver and Mininetclidriver driver functions
4"""
5def __init__( self ):
6 self.default = ''
7
kelvin-onlab2ccad6e2015-05-18 10:36:54 -07008def hostIntent( main,
9 name="",
10 host1="",
11 host2="",
12 host1Id="",
13 host2Id="",
14 mac1="",
15 mac2="",
16 vlan1="-1",
17 vlan2="-1",
18 sw1="",
19 sw2="",
20 expectedLink=0 ):
kelvin-onlabe5239e52015-05-13 14:46:45 -070021 """
22 Add host intents
23 """
24 import time
kelvin-onlab2ccad6e2015-05-18 10:36:54 -070025
26 # Assert variables
27 assert main, "There is no main variable"
28 assert name, "variable name is empty"
29 assert host1 and host2, "You must specify hosts"
30
kelvin-onlabe5239e52015-05-13 14:46:45 -070031 global itemName
kelvin-onlab2ccad6e2015-05-18 10:36:54 -070032 itemName = name
33 h1Name = host1
34 h2Name = host2
35 h1Id = host1Id
36 h2Id = host2Id
37 h1Mac = mac1
38 h2Mac = mac2
39 vlan1 = vlan1
40 vlan2 = vlan2
kelvin-onlabe5239e52015-05-13 14:46:45 -070041 intentsId = []
kelvin-onlab2ccad6e2015-05-18 10:36:54 -070042 stepResult = main.TRUE
kelvin-onlabe5239e52015-05-13 14:46:45 -070043 pingResult = main.TRUE
44 intentResult = main.TRUE
45 flowResult = main.TRUE
46 topoResult = main.TRUE
47 linkDownResult = main.TRUE
48 linkUpResult = main.TRUE
49
kelvin-onlab2ccad6e2015-05-18 10:36:54 -070050 if main.hostsData:
51 if not h1Mac:
52 h1Mac = main.hostsData[ h1Name ][ 'mac' ]
53 if not h2Mac:
54 h2Mac = main.hostsData[ h2Name ][ 'mac' ]
kelvin-onlabe7270fa2015-05-18 14:35:03 -070055 print '1', main.hostsData[ h1Name ]
56 print '2', main.hostsData[ h2Name ]
kelvin-onlab2ccad6e2015-05-18 10:36:54 -070057 if main.hostsData[ h1Name ][ 'vlan' ] != '-1':
kelvin-onlabe7270fa2015-05-18 14:35:03 -070058 print 'vlan1', main.hostsData[ h1Name ][ 'vlan' ]
kelvin-onlab2ccad6e2015-05-18 10:36:54 -070059 vlan1 = main.hostsData[ h1Name ][ 'vlan' ]
60 if main.hostsData[ h2Name ][ 'vlan' ] != '-1':
kelvin-onlabe7270fa2015-05-18 14:35:03 -070061 print 'vlan2', main.hostsData[ h2Name ][ 'vlan' ]
kelvin-onlab2ccad6e2015-05-18 10:36:54 -070062 vlan2 = main.hostsData[ h2Name ][ 'vlan' ]
63 if not h1Id:
64 h1Id = main.hostsData[ h1Name ][ 'id' ]
65 if not h2Id:
66 h2Id = main.hostsData[ h2Name ][ 'id' ]
67
68 assert h1Id and h2Id, "You must specify host IDs"
69 if not ( h1Id and h2Id ):
70 main.log.info( "There are no host IDs" )
71 return main.FALSE
72
kelvin-onlabe5239e52015-05-13 14:46:45 -070073 # Discover hosts using arping
74 main.log.info( itemName + ": Discover host using arping" )
75 main.Mininet1.arping( host=h1Name )
76 main.Mininet1.arping( host=h2Name )
77 host1 = main.CLIs[ 0 ].getHost( mac=h1Mac )
78 host2 = main.CLIs[ 0 ].getHost( mac=h2Mac )
79
80 # Adding host intents
81 main.log.info( itemName + ": Adding host intents" )
82 intent1 = main.CLIs[ 0 ].addHostIntent( hostIdOne=h1Id,
83 hostIdTwo=h2Id )
84 intentsId.append( intent1 )
85 time.sleep( 5 )
86 intent2 = main.CLIs[ 0 ].addHostIntent( hostIdOne=h2Id,
87 hostIdTwo=h1Id )
88 intentsId.append( intent2 )
89
90 # Check intents state
91 time.sleep( 50 )
92 intentResult = checkIntentState( main, intentsId )
93
94 # Verify flows
95 checkFlowsState( main )
96
97 # Ping hosts
98 pingHost( main, h1Name, h2Name )
99 # Ping hosts again...
100 pingResult = pingHost( main, h1Name, h2Name )
101 time.sleep( 5 )
102
kelvin-onlab2ccad6e2015-05-18 10:36:54 -0700103 # Test rerouting if these variables exist
104 if sw1 and sw2 and expectedLink:
105 # link down
106 link( main, sw1, sw2, "down" )
107 intentResult = intentResult and checkIntentState( main, intentsId )
kelvin-onlabe5239e52015-05-13 14:46:45 -0700108
kelvin-onlab2ccad6e2015-05-18 10:36:54 -0700109 # Verify flows
110 checkFlowsState( main )
kelvin-onlabe5239e52015-05-13 14:46:45 -0700111
kelvin-onlab2ccad6e2015-05-18 10:36:54 -0700112 # Check OnosTopology
113 topoResult = checkTopology( main, expectedLink )
kelvin-onlabe5239e52015-05-13 14:46:45 -0700114
kelvin-onlab2ccad6e2015-05-18 10:36:54 -0700115 # Ping hosts
116 pingResult = pingResult and pingHost( main, h1Name, h2Name )
kelvin-onlabe5239e52015-05-13 14:46:45 -0700117
kelvin-onlab2ccad6e2015-05-18 10:36:54 -0700118 intentResult = checkIntentState( main, intentsId )
kelvin-onlabe5239e52015-05-13 14:46:45 -0700119
kelvin-onlab2ccad6e2015-05-18 10:36:54 -0700120 # link up
121 link( main, sw1, sw2, "up" )
122 time.sleep( 5 )
kelvin-onlabe5239e52015-05-13 14:46:45 -0700123
kelvin-onlab2ccad6e2015-05-18 10:36:54 -0700124 # Verify flows
125 checkFlowsState( main )
kelvin-onlabe5239e52015-05-13 14:46:45 -0700126
kelvin-onlab2ccad6e2015-05-18 10:36:54 -0700127 # Check OnosTopology
128 topoResult = checkTopology( main, expectedLink )
kelvin-onlabe5239e52015-05-13 14:46:45 -0700129
kelvin-onlab2ccad6e2015-05-18 10:36:54 -0700130 # Ping hosts
131 pingResult = pingResult and pingHost( main, h1Name, h2Name )
kelvin-onlabe5239e52015-05-13 14:46:45 -0700132
133 # Remove intents
134 for intent in intentsId:
135 main.CLIs[ 0 ].removeIntent( intentId=intent, purge=True )
136
137 print main.CLIs[ 0 ].intents()
138 stepResult = pingResult and linkDownResult and linkUpResult \
139 and intentResult
140
141 return stepResult
142
kelvin-onlab2ccad6e2015-05-18 10:36:54 -0700143def pointIntent( main,
144 name="",
145 host1="",
146 host2="",
147 deviceId1="",
148 deviceId2="",
149 port1="",
150 port2="",
151 ethType="",
152 mac1="",
153 mac2="",
154 bandwidth="",
155 lambdaAlloc=False,
156 ipProto="",
157 ip1="",
158 ip2="",
159 tcp1="",
160 tcp2="",
161 sw1="",
162 sw2="",
163 expectedLink=0 ):
kelvin-onlabe5239e52015-05-13 14:46:45 -0700164 """
165 Add Point intents
166 """
167 import time
kelvin-onlab2ccad6e2015-05-18 10:36:54 -0700168 assert main, "There is no main variable"
169 assert name, "variable name is empty"
170 assert host1 and host2, "You must specify hosts"
171
kelvin-onlabe5239e52015-05-13 14:46:45 -0700172 global itemName
kelvin-onlab2ccad6e2015-05-18 10:36:54 -0700173 itemName = name
174 h1Name = host1
175 h2Name = host2
kelvin-onlabe5239e52015-05-13 14:46:45 -0700176 intentsId = []
kelvin-onlabb2235602015-05-13 17:51:06 -0700177
kelvin-onlabe5239e52015-05-13 14:46:45 -0700178 pingResult = main.TRUE
179 intentResult = main.TRUE
180 flowResult = main.TRUE
181 topoResult = main.TRUE
182 linkDownResult = main.TRUE
183 linkUpResult = main.TRUE
184
kelvin-onlabb2235602015-05-13 17:51:06 -0700185 # Adding bidirectional point intents
kelvin-onlabe5239e52015-05-13 14:46:45 -0700186 main.log.info( itemName + ": Adding host intents" )
kelvin-onlab2ccad6e2015-05-18 10:36:54 -0700187 intent1 = main.CLIs[ 0 ].addPointIntent( ingressDevice=deviceId1,
188 egressDevice=deviceId2,
189 portIngress=port1,
190 portEgress=port2,
kelvin-onlabb2235602015-05-13 17:51:06 -0700191 ethType=ethType,
kelvin-onlab2ccad6e2015-05-18 10:36:54 -0700192 ethSrc=mac1,
193 ethDst=mac2,
kelvin-onlabb2235602015-05-13 17:51:06 -0700194 bandwidth=bandwidth,
195 lambdaAlloc=lambdaAlloc,
196 ipProto=ipProto,
kelvin-onlab2ccad6e2015-05-18 10:36:54 -0700197 ipSrc=ip1,
198 ipDst=ip2,
199 tcpSrc=tcp1,
200 tcpDst=tcp2 )
kelvin-onlabb2235602015-05-13 17:51:06 -0700201
kelvin-onlabe5239e52015-05-13 14:46:45 -0700202 intentsId.append( intent1 )
203 time.sleep( 5 )
kelvin-onlab2ccad6e2015-05-18 10:36:54 -0700204 intent2 = main.CLIs[ 0 ].addPointIntent( ingressDevice=deviceId2,
205 egressDevice=deviceId1,
206 portIngress=port2,
207 portEgress=port1,
kelvin-onlabb2235602015-05-13 17:51:06 -0700208 ethType=ethType,
kelvin-onlab2ccad6e2015-05-18 10:36:54 -0700209 ethSrc=mac2,
210 ethDst=mac1,
kelvin-onlabb2235602015-05-13 17:51:06 -0700211 bandwidth=bandwidth,
212 lambdaAlloc=lambdaAlloc,
213 ipProto=ipProto,
kelvin-onlab2ccad6e2015-05-18 10:36:54 -0700214 ipSrc=ip2,
215 ipDst=ip1,
216 tcpSrc=tcp2,
217 tcpDst=tcp1 )
kelvin-onlabe5239e52015-05-13 14:46:45 -0700218 intentsId.append( intent2 )
219
220 # Check intents state
221 time.sleep( 50 )
222 intentResult = checkIntentState( main, intentsId )
223
224 # Verify flows
225 checkFlowsState( main )
226
227 # Ping hosts
228 pingHost( main, h1Name, h2Name )
229 # Ping hosts again...
230 pingResult = pingHost( main, h1Name, h2Name )
231 time.sleep( 5 )
232
kelvin-onlab2ccad6e2015-05-18 10:36:54 -0700233 if sw1 and sw2 and expectedLink:
234 # link down
235 link( main, sw1, sw2, "down" )
236 intentResult = intentResult and checkIntentState( main, intentsId )
kelvin-onlabe5239e52015-05-13 14:46:45 -0700237
kelvin-onlab2ccad6e2015-05-18 10:36:54 -0700238 # Verify flows
239 checkFlowsState( main )
kelvin-onlabe5239e52015-05-13 14:46:45 -0700240
kelvin-onlab2ccad6e2015-05-18 10:36:54 -0700241 # Check OnosTopology
242 topoResult = checkTopology( main, expectedLink )
kelvin-onlabe5239e52015-05-13 14:46:45 -0700243
kelvin-onlab2ccad6e2015-05-18 10:36:54 -0700244 # Ping hosts
245 pingResult = pingResult and pingHost( main, h1Name, h2Name )
kelvin-onlabe5239e52015-05-13 14:46:45 -0700246
kelvin-onlab2ccad6e2015-05-18 10:36:54 -0700247 intentResult = checkIntentState( main, intentsId )
kelvin-onlabe5239e52015-05-13 14:46:45 -0700248
kelvin-onlab2ccad6e2015-05-18 10:36:54 -0700249 # link up
250 link( main, sw1, sw2, "up" )
251 time.sleep( 5 )
kelvin-onlabe5239e52015-05-13 14:46:45 -0700252
kelvin-onlab2ccad6e2015-05-18 10:36:54 -0700253 # Verify flows
254 checkFlowsState( main )
kelvin-onlabe5239e52015-05-13 14:46:45 -0700255
kelvin-onlab2ccad6e2015-05-18 10:36:54 -0700256 # Check OnosTopology
257 topoResult = checkTopology( main, expectedLink )
kelvin-onlabe5239e52015-05-13 14:46:45 -0700258
kelvin-onlab2ccad6e2015-05-18 10:36:54 -0700259 # Ping hosts
260 pingResult = pingResult and pingHost( main, h1Name, h2Name )
kelvin-onlabe5239e52015-05-13 14:46:45 -0700261
262 # Remove intents
263 for intent in intentsId:
264 main.CLIs[ 0 ].removeIntent( intentId=intent, purge=True )
265
266 print main.CLIs[ 0 ].intents()
267 stepResult = pingResult and linkDownResult and linkUpResult \
268 and intentResult
269
270 return stepResult
271
kelvin-onlabe7270fa2015-05-18 14:35:03 -0700272def singleToMultiIntent( main,
273 name="",
kelvin-onlab90b6b042015-05-18 20:57:13 -0700274 hostNames="",
275 devices="",
kelvin-onlabe7270fa2015-05-18 14:35:03 -0700276 ports=None,
277 ethType="",
278 macs=None,
279 bandwidth="",
280 lambdaAlloc=False,
281 ipProto="",
282 ipAddresses="",
283 tcp="",
284 sw1="",
285 sw2="",
286 expectedLink=0 ):
287 """
288 Add Single to Multi Point intents
kelvin-onlab90b6b042015-05-18 20:57:13 -0700289 If main.hostsData is not defined, variables data should be passed in the
290 same order index wise.
291 eg. hostName = [ 'h1', 'h2' ,.. ]
292 devices = [ 'of:0000000000000001', 'of:0000000000000002', ...]
293 ports = [ '1', '1', ..]
294 ...
kelvin-onlabe7270fa2015-05-18 14:35:03 -0700295 """
296 import time
297 assert main, "There is no main variable"
298 assert name, "variable name is empty"
299 assert hostNames, "You must specify hosts"
300 assert devices or main.hostsData, "You must specify devices"
301
302 global itemName
303 itemName = name
kelvin-onlab90b6b042015-05-18 20:57:13 -0700304 tempHostsData = {}
kelvin-onlabe7270fa2015-05-18 14:35:03 -0700305 intentsId = []
306
kelvin-onlab90b6b042015-05-18 20:57:13 -0700307 if hostNames and devices:
308 if len( hostNames ) != len( devices ):
309 main.log.error( "hosts and devices does not have the same length" )
310 print "hostNames = ", len( hostNames )
311 print "devices = ", len( devices )
312 return main.FALSE
313 if ports:
314 if len( ports ) != len( devices ):
315 main.log.error( "Ports and devices does " +
316 "not have the same length" )
317 print "devices = ", len( devices )
318 print "ports = ", len( ports )
319 return main.FALSE
320 else:
321 main.log.info( "Device Ports are not specified" )
322 elif hostNames and not devices and main.hostsData:
323 main.log.info( "singleToMultiIntent function is using main.hostsData" )
324 print main.hostsData
kelvin-onlabe7270fa2015-05-18 14:35:03 -0700325
326 pingResult = main.TRUE
327 intentResult = main.TRUE
328 flowResult = main.TRUE
329 topoResult = main.TRUE
330 linkDownResult = main.TRUE
331 linkUpResult = main.TRUE
332
333 # Adding bidirectional point intents
334 main.log.info( itemName + ": Adding host intents" )
kelvin-onlab90b6b042015-05-18 20:57:13 -0700335 intent1 = main.CLIs[ 0 ].addSinglepointToMultipointIntent(
336 ingressDevice=deviceId1,
337 egressDevice=deviceId2,
338 portIngress=port1,
339 portEgress=port2,
340 ethType=ethType,
341 ethSrc=mac1,
342 ethDst=mac2,
343 bandwidth=bandwidth,
344 lambdaAlloc=lambdaAlloc,
345 ipProto=ipProto,
346 ipSrc=ip1,
347 ipDst=ip2,
348 tcpSrc=tcp1,
349 tcpDst=tcp2 )
kelvin-onlabe7270fa2015-05-18 14:35:03 -0700350
351 intentsId.append( intent1 )
352 time.sleep( 5 )
353 intent2 = main.CLIs[ 0 ].addPointIntent( ingressDevice=deviceId2,
354 egressDevice=deviceId1,
355 portIngress=port2,
356 portEgress=port1,
357 ethType=ethType,
358 ethSrc=mac2,
359 ethDst=mac1,
360 bandwidth=bandwidth,
361 lambdaAlloc=lambdaAlloc,
362 ipProto=ipProto,
363 ipSrc=ip2,
364 ipDst=ip1,
365 tcpSrc=tcp2,
366 tcpDst=tcp1 )
367 intentsId.append( intent2 )
368
369 # Check intents state
370 time.sleep( 50 )
371 intentResult = checkIntentState( main, intentsId )
372
373 # Verify flows
374 checkFlowsState( main )
375
376 # Ping hosts
377 pingHost( main, h1Name, h2Name )
378 # Ping hosts again...
379 pingResult = pingHost( main, h1Name, h2Name )
380 time.sleep( 5 )
381
382 if sw1 and sw2 and expectedLink:
383 # link down
384 link( main, sw1, sw2, "down" )
385 intentResult = intentResult and checkIntentState( main, intentsId )
386
387 # Verify flows
388 checkFlowsState( main )
389
390 # Check OnosTopology
391 topoResult = checkTopology( main, expectedLink )
392
393 # Ping hosts
394 pingResult = pingResult and pingHost( main, h1Name, h2Name )
395
396 intentResult = checkIntentState( main, intentsId )
397
398 # link up
399 link( main, sw1, sw2, "up" )
400 time.sleep( 5 )
401
402 # Verify flows
403 checkFlowsState( main )
404
405 # Check OnosTopology
406 topoResult = checkTopology( main, expectedLink )
407
408 # Ping hosts
409 pingResult = pingResult and pingHost( main, h1Name, h2Name )
410
411 # Remove intents
412 for intent in intentsId:
413 main.CLIs[ 0 ].removeIntent( intentId=intent, purge=True )
414
415 print main.CLIs[ 0 ].intents()
416 stepResult = pingResult and linkDownResult and linkUpResult \
417 and intentResult
418
419 return stepResult
420
kelvin-onlabe5239e52015-05-13 14:46:45 -0700421def link( main, sw1, sw2, option):
422
423 # link down
424 main.log.info( itemName + ": Bring link " + option + "between " +
425 sw1 + " and " + sw2 )
426 main.Mininet1.link( end1=sw1, end2=sw2, option=option )
427
kelvin-onlabe7270fa2015-05-18 14:35:03 -0700428def pingAllHost( main, hosts ):
429 # Ping all host in the hosts list variable
430 import itertools
431
432 main.log.info( itemName + ": Ping host list - " + hosts )
433 hostCombination = itertools.permutation( hosts, 2 )
434 pingResult = main.TRUE
435 for hostPair in hostCombination:
436 pingResult = pingResult and main.Mininet.pingHost(
437 src=hostPair[ 0 ],
438 target=hostPair[ 1 ] )
439 return pingResult
440
kelvin-onlabe5239e52015-05-13 14:46:45 -0700441def pingHost( main, h1Name, h2Name ):
442
443 # Ping hosts
444 main.log.info( itemName + ": Ping " + h1Name + " and " +
445 h2Name )
446 pingResult1 = main.Mininet1.pingHost( src=h1Name , target=h2Name )
447 if not pingResult1:
448 main.log.info( itemName + ": " + h1Name + " cannot ping "
449 + h2Name )
450 pingResult2 = main.Mininet1.pingHost( src=h2Name , target=h1Name )
451 if not pingResult2:
452 main.log.info( itemName + ": " + h2Name + " cannot ping "
453 + h1Name )
454 pingResult = pingResult1 and pingResult2
455 if pingResult:
456 main.log.info( itemName + ": Successfully pinged " +
457 "both hosts" )
458 else:
459 main.log.info( itemName + ": Failed to ping " +
460 "both hosts" )
461 return pingResult
462
kelvin-onlab2ccad6e2015-05-18 10:36:54 -0700463def getHostsData( main ):
kelvin-onlabe5239e52015-05-13 14:46:45 -0700464 """
kelvin-onlab2ccad6e2015-05-18 10:36:54 -0700465 Use fwd app and pingall to discover all the hosts
kelvin-onlabe5239e52015-05-13 14:46:45 -0700466 """
kelvin-onlab2ccad6e2015-05-18 10:36:54 -0700467 """
468 hosts json format:
469 """
470 import json
471 activateResult = main.TRUE
472 appCheck = main.TRUE
473 main.log.info( "Activating reactive forwarding app " )
474 activateResult = main.CLIs[ 0 ].activateApp( "org.onosproject.fwd" )
475
476 for i in range( main.numCtrls ):
477 appCheck = appCheck and main.CLIs[ i ].appToIDCheck()
478
479 if appCheck != main.TRUE:
480 main.log.warn( main.CLIs[ 0 ].apps() )
481 main.log.warn( main.CLIs[ 0 ].appIDs() )
482
483 pingResult = main.Mininet1.pingall()
484 hostsJson = json.loads( main.CLIs[ 0 ].hosts() )
485 hosts = main.Mininet1.getHosts()
486 for host in hosts:
487 main.hostsData[ host ] = {}
kelvin-onlabe7270fa2015-05-18 14:35:03 -0700488 main.hostsData[ host ][ 'mac' ] = \
489 main.Mininet1.getMacAddress( host ).upper()
kelvin-onlab2ccad6e2015-05-18 10:36:54 -0700490 for hostj in hostsJson:
491 if main.hostsData[ host ][ 'mac' ] == hostj[ 'mac' ]:
492 main.hostsData[ host ][ 'id' ] = hostj[ 'id' ]
493 main.hostsData[ host ][ 'vlan' ] = hostj[ 'vlan' ]
494 main.hostsData[ host ][ 'location' ] = \
495 hostj[ 'location' ][ 'elementId' ] + '/' + \
496 hostj[ 'location' ][ 'port' ]
497 main.hostsData[ host ][ 'ipAddresses' ] = hostj[ 'ipAddresses' ]
498
kelvin-onlabe7270fa2015-05-18 14:35:03 -0700499 main.log.info( "Deactivating reactive forwarding app " )
500 activateResult = main.CLIs[ 0 ].deactivateApp( "org.onosproject.fwd" )
kelvin-onlab2ccad6e2015-05-18 10:36:54 -0700501 print main.hostsData
502 return pingResult
kelvin-onlabe5239e52015-05-13 14:46:45 -0700503
504def checkTopology( main, expectedLink ):
505 statusResult = main.TRUE
506 # Check onos topology
507 main.log.info( itemName + ": Checking ONOS topology " )
508
509 for i in range( main.numCtrls ):
510 topologyResult = main.CLIs[ i ].topology()
511 statusResult = main.ONOSbench.checkStatus( topologyResult,
512 main.numSwitch,
513 expectedLink )\
514 and statusResult
515 if not statusResult:
516 main.log.info( itemName + ": Topology mismatch" )
517 else:
518 main.log.info( itemName + ": Topology match" )
519 return statusResult
520
521def checkIntentState( main, intentsId ):
522
523 main.log.info( itemName + ": Check host intents state" )
524 for i in range( main.numCtrls ):
525 intentResult = main.CLIs[ i ].checkIntentState( intentsId=intentsId )
526 if not intentResult:
527 main.log.info( itemName + ": Check host intents state again")
528 for i in range( main.numCtrls ):
529 intentResult = main.CLIs[ i ].checkIntentState(
530 intentsId=intentsId )
531 return intentResult
532
533def checkFlowsState( main ):
534
535 main.log.info( itemName + ": Check flows state" )
536 checkFlowsResult = main.CLIs[ 0 ].checkFlowsState()
537 return checkFlowsResult
538
539def printMsg( main, h1Name, h2Name ):
540 main.log.info("PINGING HOST INSIDE printMSG")
541 pingHost( main, itemName, h1Name, h2Name )
542 print 'lala'
543