blob: d9e54831062e2e0192ca68fdb29d62867ed673f1 [file] [log] [blame]
carlosmscabralf40ecd12013-02-01 18:15:58 -02001#!/usr/bin/python
2
3from subprocess import check_output as co
4from sys import exit
5
6# Actually run bin/mn rather than importing via python path
7version = 'Mininet ' + co( 'PYTHONPATH=. bin/mn --version', shell=True )
8version = version.strip()
9
10# Find all Mininet path references
11lines = co( "grep -or 'Mininet \w\.\w\.\w\w*' *", shell=True )
12
13error = False
14
15for line in lines.split( '\n' ):
16 if line and 'Binary' not in line:
17 fname, fversion = line.split( ':' )
18 if version != fversion:
19 print "%s: incorrect version '%s' (should be '%s')" % (
20 fname, fversion, version )
21 error = True
22
23if error:
24 exit( 1 )