mirror of
https://github.com/nfstream/nfstream.git
synced 2026-05-19 16:28:14 +00:00
Add tests for metadata extraction.
This commit is contained in:
parent
b3e6969af8
commit
4f7a0318e1
2 changed files with 10 additions and 1 deletions
4
.github/workflows/build_and_publish.yml
vendored
4
.github/workflows/build_and_publish.yml
vendored
|
|
@ -21,6 +21,10 @@ jobs:
|
|||
exclude:
|
||||
- os: macos-latest
|
||||
python-version: pypy3
|
||||
- os: macos-latest
|
||||
python-version: 3.8
|
||||
- os: macos-latest
|
||||
python-version: 3.6
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
|
|
|
|||
7
tests.py
7
tests.py
|
|
@ -86,7 +86,7 @@ class TestMethods(unittest.TestCase):
|
|||
self.assertEqual(len(flows), 60)
|
||||
print('PASS.')
|
||||
|
||||
def test_flow_str_representation(self):
|
||||
def test_flow_metadata_extraction(self):
|
||||
print("\n----------------------------------------------------------------------")
|
||||
print(".Testing Flow string representation:")
|
||||
streamer_test = NFStreamer(source='tests/pcap/facebook.pcap')
|
||||
|
|
@ -95,6 +95,11 @@ class TestMethods(unittest.TestCase):
|
|||
flows.append(flow)
|
||||
del streamer_test
|
||||
print(flows[0])
|
||||
self.assertEqual(flows[0].client_info, 'facebook.com')
|
||||
self.assertEqual(flows[0].server_info, '*.facebook.com,*.facebook.net,*.fb.com,*.fbcdn.net,*.fbsbx.com,*.m.facebook.com,*.messenger.com,*.xx.fbcdn.net,*.xy.fbcdn.net,*.xz.fbcdn.net,facebook.com,fb.com,messenger.com')
|
||||
self.assertEqual(flows[0].client_info, 'facebook.com')
|
||||
self.assertEqual(flows[0].j3a_client, 'bfcc1a3891601edb4f137ab7ab25b840')
|
||||
self.assertEqual(flows[0].j3a_server, '2d1eb5817ece335c24904f516ad5da12')
|
||||
print('PASS.')
|
||||
|
||||
def test_unfound_device(self):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue