Home | History | Annotate | Download | only in uptime
      1 AUTHOR="Vladimir Samarskiy <vsamarsk (a] google.com>"
      2 NAME="Uptime Test"
      3 TIME="MEDIUM"  ## ~3hrs
      4 TEST_CLASS="Kernel"
      5 TEST_CATEGORY="Stress"
      6 TEST_TYPE="CLIENT"
      7 
      8 DOC = """
      9 The test repeatedly executes kernbench during T=cycle_length seconds and then 
     10 sleeps for the same amount of time. Itterations continued
     11 until total elapsed time of the test reaches T=target_time
     12 """
     13 
     14 import time
     15 
     16 
     17 def uptime_test(cycle_length = 300, target_time = 3*60*60):
     18     test_started = time.time()
     19     counter = 0
     20     while time.time() < test_started + target_time:
     21         kernbench_started = time.time()
     22         while time.time() < kernbench_started + cycle_length:
     23                 counter += 1
     24                 job.run_test('kernbench', tag='%d' % counter)
     25         job.run_test('sleeptest', tag='%d' % counter, seconds=cycle_length)
     26 
     27 
     28 uptime_test()
     29 
     30