Browse Source

Revert "add SalityBotnet tests"

This reverts commit c1ba3d746d2f22ff2dd4b2e1dd725972554e8d3e.
Jens Keim 6 years ago
parent
commit
df50ad667b
2 changed files with 1 additions and 33 deletions
  1. 1 2
      code/Attack/SalityBotnet.py
  2. 0 31
      code/Test/test_SalityBotnet.py

+ 1 - 2
code/Attack/SalityBotnet.py

@@ -4,7 +4,6 @@ from random import randint
 from scapy.utils import RawPcapReader
 from scapy.layers.inet import Ether
 
-from definitions import ROOT_DIR
 from Attack import BaseAttack
 from Attack.AttackParameters import Parameter as Param
 from Attack.AttackParameters import ParameterTypes
@@ -15,7 +14,7 @@ logging.getLogger("scapy.runtime").setLevel(logging.ERROR)
 
 
 class SalityBotnet(BaseAttack.BaseAttack):
-    template_attack_pcap_path = ROOT_DIR + "/../resources/sality_botnet.pcap"
+    template_attack_pcap_path = "resources/sality_botnet.pcap"
 
     def __init__(self):
         """

+ 0 - 31
code/Test/test_SalityBotnet.py

@@ -1,31 +0,0 @@
-import unittest
-import unittest.mock as mock
-
-import ID2TLib.TestLibrary as Lib
-import Test.GenericTest as GenericTest
-
-sha_botnet_basic = '8ff1e400dcf01d2d2cb97312cecdb71473ea140f6406ea935f74970aecdd7305'
-sha_botnet_most_used_ip_in_list = '8ff1e400dcf01d2d2cb97312cecdb71473ea140f6406ea935f74970aecdd7305'
-
-"""
-CURRENT COVERAGE
-Name                             Stmts   Miss  Cover   Missing (lines)
----------------------------------------------------------------------------
-Attack/SalityBotnet.py           77      0    100%
-"""
-# TODO: get 100% coverage
-
-
-class UnitTestSalityBotnet(GenericTest.GenericTest):
-
-    def test_botnet_basic(self):
-        self.generic_test([['SalityBotnet']], sha_botnet_basic)
-
-    @mock.patch('ID2TLib.Statistics.Statistics.get_most_used_ip_address')
-    def test_botnet_most_used_ips(self, mock_most_used_ip_address):
-        mock_most_used_ip_address.return_value = Lib.test_pcap_ips
-        self.generic_test([['SalityBotnet']], sha_botnet_most_used_ip_in_list)
-
-
-if __name__ == '__main__':
-    unittest.main()