#152 time zone dependent tests

Zavřený
otevřeno před 5 roky uživatelem jens.klein · 1 komentářů
Jens Keim okomentoval před 5 roky

There are tests, which are time zone dependent. Would be nice to enhance that, so people beyond the CEST Time Zone can use the tests to validate the correctness of the code.

I'm not even sure if it might also produce issues during winter since then we'll use CET.

$ ./run_tests 
.....................................................................................................................................................................F......................................................................F............FF.................
======================================================================
FAIL: test_smbscan_smb2 (test_SMBScanAttack.UnitTestSMBScan)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/pepper-jk/code/ID2T-toolkit/code/Test/test_SMBScanAttack.py", line 64, in test_smbscan_smb2
    'hosting.ip=192.168.178.5', 'protocol.version=2.1', 'hosting.version=2.1']], sha_smb2)
  File "/home/pepper-jk/code/ID2T-toolkit/code/Test/ID2TAttackTest.py", line 42, in checksum_test
    self.assertEqual(sha256_checksum, Lib.get_sha256(controller.pcap_dest_path))
AssertionError: 'ef525fb61612a3db90bd0bbfaf4412f682933954357c941e1d8ac05c9ec373d4' != '87c5178042f3ef37a9385e45e7cc96afb3aa3ea0050fa0acb57d1de54517affa'
- ef525fb61612a3db90bd0bbfaf4412f682933954357c941e1d8ac05c9ec373d4
+ 87c5178042f3ef37a9385e45e7cc96afb3aa3ea0050fa0acb57d1de54517affa


======================================================================
FAIL: test_get_file_information (test_internalQueries.UnitTestInternalQueries)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/pepper-jk/code/ID2T-toolkit/code/Test/test_internalQueries.py", line 28, in test_get_file_information
    ('Capture end', '\t1970-01-01 01:08:10.102034')])
AssertionError: Lists differ: [('Pc[349 chars], '1969-12-31 16:07:39.604899'), ('Capture dur[134 chars]34')] != [('Pc[349 chars], '1970-01-01 01:07:39.604899'), ('Capture dur[134 chars]34')]

First differing element 6:
('Last unknown PDU', '1969-12-31 16:07:39.604899')
('Last unknown PDU', '1970-01-01 01:07:39.604899')

Diff is 963 characters long. Set self.maxDiff to None to see it.

======================================================================
FAIL: test_get_pcap_timestamp_end (test_internalQueries.UnitTestInternalQueries)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/pepper-jk/code/ID2T-toolkit/code/Test/test_internalQueries.py", line 40, in test_get_pcap_timestamp_end
    self.assertEqual(controller.statistics.get_pcap_timestamp_end(), '1970-01-01 01:08:10.102034')
AssertionError: '1969-12-31 16:08:10.102034' != '1970-01-01 01:08:10.102034'
- 1969-12-31 16:08:10.102034
?   ^^  - ^   -
+ 1970-01-01 01:08:10.102034
?   ^^ +  ^  +


======================================================================
FAIL: test_get_pcap_timestamp_start (test_internalQueries.UnitTestInternalQueries)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/pepper-jk/code/ID2T-toolkit/code/Test/test_internalQueries.py", line 37, in test_get_pcap_timestamp_start
    self.assertEqual(controller.statistics.get_pcap_timestamp_start(), '1970-01-01 01:01:45.647675')
AssertionError: '1969-12-31 16:01:45.647675' != '1970-01-01 01:01:45.647675'
- 1969-12-31 16:01:45.647675
?   ^^  - ^   -
+ 1970-01-01 01:01:45.647675
?   ^^ +  ^  +


----------------------------------------------------------------------
Ran 268 tests in 107.761s

FAILED (failures=4)
There are tests, which are time zone dependent. Would be nice to enhance that, so people beyond the CEST Time Zone can use the tests to validate the correctness of the code. I'm not even sure if it might also produce issues during winter since then we'll use CET. $ ./run_tests .....................................................................................................................................................................F......................................................................F............FF................. ====================================================================== FAIL: test_smbscan_smb2 (test_SMBScanAttack.UnitTestSMBScan) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pepper-jk/code/ID2T-toolkit/code/Test/test_SMBScanAttack.py", line 64, in test_smbscan_smb2 'hosting.ip=192.168.178.5', 'protocol.version=2.1', 'hosting.version=2.1']], sha_smb2) File "/home/pepper-jk/code/ID2T-toolkit/code/Test/ID2TAttackTest.py", line 42, in checksum_test self.assertEqual(sha256_checksum, Lib.get_sha256(controller.pcap_dest_path)) AssertionError: 'ef525fb61612a3db90bd0bbfaf4412f682933954357c941e1d8ac05c9ec373d4' != '87c5178042f3ef37a9385e45e7cc96afb3aa3ea0050fa0acb57d1de54517affa' - ef525fb61612a3db90bd0bbfaf4412f682933954357c941e1d8ac05c9ec373d4 + 87c5178042f3ef37a9385e45e7cc96afb3aa3ea0050fa0acb57d1de54517affa ====================================================================== FAIL: test_get_file_information (test_internalQueries.UnitTestInternalQueries) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pepper-jk/code/ID2T-toolkit/code/Test/test_internalQueries.py", line 28, in test_get_file_information ('Capture end', '\t1970-01-01 01:08:10.102034')]) AssertionError: Lists differ: [('Pc[349 chars], '1969-12-31 16:07:39.604899'), ('Capture dur[134 chars]34')] != [('Pc[349 chars], '1970-01-01 01:07:39.604899'), ('Capture dur[134 chars]34')] First differing element 6: ('Last unknown PDU', '1969-12-31 16:07:39.604899') ('Last unknown PDU', '1970-01-01 01:07:39.604899') Diff is 963 characters long. Set self.maxDiff to None to see it. ====================================================================== FAIL: test_get_pcap_timestamp_end (test_internalQueries.UnitTestInternalQueries) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pepper-jk/code/ID2T-toolkit/code/Test/test_internalQueries.py", line 40, in test_get_pcap_timestamp_end self.assertEqual(controller.statistics.get_pcap_timestamp_end(), '1970-01-01 01:08:10.102034') AssertionError: '1969-12-31 16:08:10.102034' != '1970-01-01 01:08:10.102034' - 1969-12-31 16:08:10.102034 ? ^^ - ^ - + 1970-01-01 01:08:10.102034 ? ^^ + ^ + ====================================================================== FAIL: test_get_pcap_timestamp_start (test_internalQueries.UnitTestInternalQueries) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pepper-jk/code/ID2T-toolkit/code/Test/test_internalQueries.py", line 37, in test_get_pcap_timestamp_start self.assertEqual(controller.statistics.get_pcap_timestamp_start(), '1970-01-01 01:01:45.647675') AssertionError: '1969-12-31 16:01:45.647675' != '1970-01-01 01:01:45.647675' - 1969-12-31 16:01:45.647675 ? ^^ - ^ - + 1970-01-01 01:01:45.647675 ? ^^ + ^ + ---------------------------------------------------------------------- Ran 268 tests in 107.761s FAILED (failures=4)
Jens Keim okomentoval před 5 roky
Spolupracovník

Fixed by pull request #153.

Fixed by pull request #153.
Přihlaste se pro zapojení do konverzace.
Bez milníku
Bez zpracovatele
1 účastníků
Načítání...
Zrušit
Uložit
Není zde žádný obsah.