def sanityTest(vm):
 vm.sendline('sudo -n mn --test pingall')
 if (vm.expect([' 0% dropped', pexpect.TIMEOUT], timeout=45) == 0):
  log('* Sanity check OK')
 else:
  log('* Sanity check FAILED')
  log('* Sanity check output:')
  log(vm.before)

def sanityTest ( vm ) : vm . sendline ( 'sudo -n mn --test pingall' ) if ( vm . expect ( [ ' 0% dropped' , pexpect . TIMEOUT ] , timeout = 45 ) == 0 ) : log ( '* Sanity check OK' ) else : log ( '* Sanity check FAILED' ) log ( '* Sanity check output:' ) log ( vm . before )
run mininet sanity test in vm .