コード例 #1
0
 def test_reset(self):
     # the value got up the counter and dropped. must calc the diff.
     uptime1, uptime2 =9, 10
     # find the last value of the system before reset
     if ARCH == 32:
         value1 = 2**32 - 1
     if ARCH == 64:
         value1 = 2**64 - 1
     value2 = 0
     self.assertEqual(myscript.calc_diff(value1, uptime1, value2, uptime2), 1)
コード例 #2
0
 def test_reset(self):
     # the value got up the counter and dropped. must calc the diff.
     uptime1, uptime2 = 9, 10
     # find the last value of the system before reset
     if ARCH == 32:
         value1 = 2**32 - 1
     if ARCH == 64:
         value1 = 2**64 - 1
     value2 = 0
     self.assertEqual(myscript.calc_diff(value1, uptime1, value2, uptime2),
                      1)
コード例 #3
0
 def test_reboot(self):
     # the host rebooted, uptime2 is smaller than uptime1: must take latest value possible
     value1, uptime1, value2, uptime2 = 123, 10, 345, 5
     self.assertEqual(myscript.calc_diff(value1, uptime1, value2, uptime2),
                      345)
コード例 #4
0
 def test_normal(self):
     value1, uptime1, value2, uptime2 = 1, 1, 2, 2
     self.assertEqual(myscript.calc_diff(value1, uptime1, value2, uptime2),
                      1)
コード例 #5
0
 def test_reboot(self):
     # the host rebooted, uptime2 is smaller than uptime1: must take latest value possible
     value1, uptime1, value2, uptime2 = 123, 10, 345, 5
     self.assertEqual(myscript.calc_diff(value1, uptime1, value2, uptime2), 345)
コード例 #6
0
 def test_normal(self):
     value1, uptime1, value2, uptime2 = 1, 1, 2, 2
     self.assertEqual(myscript.calc_diff(value1, uptime1, value2, uptime2), 1)