forked from mozilla/stoneridge
-
Notifications
You must be signed in to change notification settings - Fork 0
/
srarpfixer.py
32 lines (25 loc) · 948 Bytes
/
srarpfixer.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/usr/bin/env python
# This Source Code Form is subject to the terms of the Mozilla Public License,
# v. 2.0. If a copy of the MPL was not distributed with this file, You can
# obtain one at http://mozilla.org/MPL/2.0/.
import logging
import stoneridge
@stoneridge.main
def main():
parser = stoneridge.TestRunArgumentParser()
parser.parse_args()
netconfig = stoneridge.get_config('run', 'netconfig')
server = stoneridge.get_config('dns', netconfig)
myos = stoneridge.get_config('machine', 'os')
logging.debug('netconfig: %s' % (netconfig,))
logging.debug('server: %s' % (server,))
logging.debug('os: %s' % (myos,))
if myos == 'windows':
countarg = '-n'
else:
countarg = '-c'
logging.debug('countarg: %s' % (countarg,))
logging.debug('Give me a ping, Vasili. One ping only, please.')
p = stoneridge.Process(['ping', countarg, '1', server])
p.communicate()
p.wait()