Custom Controller() constructor which updates its intf IP address
( *args, **kwargs)
| 972 | return RemoteOVSSwitch( name, *args, **params ) |
| 973 | |
| 974 | def ClusterController( *args, **kwargs): |
| 975 | "Custom Controller() constructor which updates its intf IP address" |
| 976 | intf = kwargs.pop( 'intf', '' ) |
| 977 | controller = Controller( *args, **kwargs ) |
| 978 | # Find out its IP address so that cluster switches can connect |
| 979 | if not intf: |
| 980 | output = controller.cmd( |
| 981 | r"ip a | egrep -o '\w+:\s\w+'" ).split( '\n' ) |
| 982 | for line in output: |
| 983 | intf = line.split()[ -1 ] |
| 984 | if intf != 'lo': |
| 985 | break |
| 986 | if intf == 'lo': |
| 987 | raise Exception( 'Could not find non-loopback interface' |
| 988 | 'for %s' % controller ) |
| 989 | Intf( intf, node=controller ).updateIP() |
| 990 | return controller |
| 991 | |
| 992 | def testRemoteTopo( link=RemoteGRELink ): |
| 993 | "Test remote Node classes using Mininet()/Topo() API" |
nothing calls this directly
no test coverage detected