def coreTest(vm, prompt=Prompt):
 log('* Making sure cgroups are mounted')
 vm.sendline('sudo -n service cgroup-lite restart')
 vm.expect(prompt)
 vm.sendline('sudo -n cgroups-mount')
 vm.expect(prompt)
 log('* Running make test')
 vm.sendline('cd ~/mininet; sudo make test')
 for test in range(0, 2):
  if (vm.expect(['OK.*\r\n', 'FAILED.*\r\n', pexpect.TIMEOUT], timeout=180) == 0):
   log('* Test', test, 'OK')
  else:
   log('* Test', test, 'FAILED')
   log('* Test', test, 'output:')
   log(vm.before)

def coreTest ( vm , prompt = Prompt ) : log ( '* Making sure cgroups are mounted' ) vm . sendline ( 'sudo -n service cgroup-lite restart' ) vm . expect ( prompt ) vm . sendline ( 'sudo -n cgroups-mount' ) vm . expect ( prompt ) log ( '* Running make test' ) vm . sendline ( 'cd ~/mininet; sudo make test' ) for test in range ( 0 , 2 ) : if ( vm . expect ( [ 'OK.*\r\n' , 'FAILED.*\r\n' , pexpect . TIMEOUT ] , timeout = 180 ) == 0 ) : log ( '* Test' , test , 'OK' ) else : log ( '* Test' , test , 'FAILED' ) log ( '* Test' , test , 'output:' ) log ( vm . before )
run core tests in vm .