Skip to content
Snippets Groups Projects
Commit 1bae1aab authored by Bob Lantz's avatar Bob Lantz
Browse files

Turn of ntpd and set date manually before tests

This should fix the problem where we see the first test
taking negative time, as well as possibly other issues
with performance tests which may be sensitive to changes
in wall clock time.

Fixes #398
parent 01a1e8e4
No related branches found
No related tags found
No related merge requests found
......@@ -484,6 +484,15 @@ def login( vm, user='mininet', password='mininet' ):
log( '* Waiting for login...' )
def disableNtpd( vm, prompt=Prompt, ntpserver='pool.ntp.org' ):
"Turn off ntpd and set clock from pool.ntp.org"
log( '* Turning off ntpd' )
vm.sendline( 'sudo -n service ntp stop' )
vm.expect( prompt )
log( '* Setting clock from', ntpserver )
vm.sendline( 'sudo -n ntpdate ' + ntpserver )
def sanityTest( vm ):
"Run Mininet sanity test (pingall) in vm"
vm.sendline( 'sudo mn --test pingall' )
......@@ -802,6 +811,10 @@ def build( flavor='raring32server', tests=None, pre='', post='', memory=1024 ):
def runTests( vm, tests=None, pre='', post='', prompt=Prompt ):
"Run tests (list) in vm (pexpect object)"
# We disable ntpd and set the time so that it won't be
# messing with the time during tests
disableNtpd( vm )
vm.expect( prompt )
if Branch:
checkOutBranch( vm, branch=Branch )
vm.expect( prompt )
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment