efficiency_testing.py 805 B

123456789101112131415161718
  1. import ID2TLib.TestLibrary as Lib
  2. import Test.ID2TAttackTest as Test
  3. sha_10_000_packets = '1433f4f69e9311ca7f64920f94992a8e8fbd045433fc0143dc47dfd25a6a02c1'
  4. sha_100_000_packets = '4891720093ba32f9794431ee16815931b1866bccac58b8ef750b669742875fb0'
  5. class EfficiencyTests(Test.ID2TAttackTest):
  6. def test_SMBLoris_10_000(self):
  7. self.checksum_test([['SMBLorisAttack', 'attackers.count=30', 'packets.per-second=7.7']], sha_10_000_packets,
  8. time=True)
  9. self.assertLessEqual(self.controller.durations[0], 15)
  10. def test_SMBLoris_100_000(self):
  11. self.checksum_test([['SMBLorisAttack', 'attackers.count=30', 'packets.per-second=95']], sha_100_000_packets,
  12. time=True)
  13. self.assertLessEqual(self.controller.durations[0], 150)