* Added fixes and tests for #2092, #2093, and #2094
* do not use interal __iter__ interface for av_pairs tests
---------
Co-authored-by: Kali <adrian.manrique@gmail.com>
* Fixed fragment_by_list() crash when child protocol is None
* removed the inline
* Added a regression test for IP.fragment_by_list() with Data payload
---------
Co-authored-by: herbenderbler <herbenderbler@users.noreply.github.com>
This was a pending change to:
- Use the same tagline, copyright and license notice across files.
- Remove authors' contacts that are no longer valid (due to affiliation changes).
- Update repository location.
- Update license file with missing licenses (althought those were already in source files).
This doesn't include any change on the source code, nor any change on current copyright or licenses. Just formatting and phrasing to make our and distro's maintainers life easier.
Continue refactor some of our test cases structure.
Main changes introduced are:
* Moved testing guide as a separate file and added some of the steps to configure the test environment.
* Leveraging unittest.main to catch command-line args and build the default suite.
* Only running GitHub actions workflow once for our own branches/PRs.
* Remote test config file can be specified via an env var now.
* Moved remote test config to a template and ignored config file.
Tests: First batch of changes on refactoring test cases
This is the first part of a larger effort to refactor some of our test cases structure.
Main changes introduced are:
- Using pytest as the testing framework to organize and mark test cases.
- Replacing custom bash scripts with test cases discovery.
- Integrating pytest-cov plugin to easier coverage collection and reporting.
- Marking remote test cases to being able to pick those during run.
- Abstracted remote test cases configuration in a base class.
- Consolidating pytest, coverage and tox configuration in a single tox.ini file.
- Removed some Python 2.5 support and replaced custom compat checks with six.
- Replace unittest.TextTestRunner.run by unittest.main (cherry-picked from f5dab5ca76, thanks @franferrax !)
Replaced some test alias that were deprecated long time ago and were showing some warnings in our tests:
- `assert_` with `assertTrue`
- `assertEquals` with `assertEqual`
As mentioned in #946 and #1054, one unit test of the `ImpactPacket` suite was using the `isAlive` method which was already deprecated in Python 3.8, and removed in Python 3.9. This changes its use to `is_alive`, introduced back in Python 2.6!
Now tox/coverage support should work. Just run tox from the main impacket directory and it should run all the test cases (you still need to complete all the parameters in tests/SMB_RPC/dcetests.cfg)
It will create a test/htmlcov directory, browse the index.html file to get all the coverage stats. Right now we're at 64+% in coveragefor the whole library. Not bad and there are a quick easy wins there.
Testing and tweaking needed!
* Check tox.ini in case you need to change something
* Don't forget to edit/configure tests/SMB_RPC/dcetests.cfg for all the SMB_RPC test cases
* Still need to analyze code coverage