Fixes #1317: BIGIP> Add support for lsnpool (CGNAT) #1321
Fixes #1317: BIGIP> Add support for lsnpool (CGNAT) #1321caphrim007 merged 5 commits intoF5Networks:developmentfrom
Conversation
Problem: Add support for lsnpool(CGNAT) Analysis: Added two things: - LSN log profile collection and resource + corresponding tests - Add missing ALG profile - IPsecALG Tests: - Added functional tests for lsnpool and lsn log profile - Test results against BIGIP with 14.0.0 build cmd: py.test test_lsnpool.py --ignore=f5/ --bigip=172.27.77.41 -vs test_lsnpool.py::TestLSNPool::test_create_no_args PASSED test_lsnpool.py::TestLSNPool::test_create PASSED test_lsnpool.py::TestLSNPool::test_create_with_logProfile_without_logPub PASSED test_lsnpool.py::TestLSNPool::test_create_with_logProfile PASSED test_lsnpool.py::TestLSNPool::test_refresh PASSED test_lsnpool.py::TestLSNPool::test_update PASSED test_lsnpool.py::TestLSNPool::test_exists PASSED test_lsnpool.py::TestLSNPool::test_stats PASSED test_lsnpool.py::TestLSNPool::test_create_with_nondefault_mode PASSED test_lsnpool.py::TestLSNPool::test_create_with_invalid_mode PASSED test_lsnpool.py::TestLSNPool::test_create_with_member PASSED test_lsnpool.py::TestLSNPool::test_virtual_with_pool PASSED test_lsnpool.py::TestLSNPool::test_collection PASSED test_lsnpool.py::TestLSNPoolLogProfile::test_create_no_args PASSED test_lsnpool.py::TestLSNPoolLogProfile::test_create PASSED test_lsnpool.py::TestLSNPoolLogProfile::test_update PASSED test_lsnpool.py::TestLSNPoolLogProfile::test_exists PASSED
|
@PrashantSunkari PR has test failures |
Fixes F5Networks#1317 Problem: Fixing CI pipeline failures Analysis: Added following things: - Fixed test cases failures on 11.5.4 - Fixed the flake8 issues - Added unit tests Tests: -Ran functional and unit tests against 11.5.4, 11.6.1, 12.0.0, 14.0.0
Problem: 11.6.0 : Fixing CI pipeline failures Analysis: - LSN pool Stats functional test is fixed - 'Flake8 f5' failures are addressed - Syntax error corrected. Tests: -Ran functional and unit tests against 11.6.0. Tests passing now.
Problem: Fixing flake8 failures in python3 Analysis: - cmd: sed -i sed 's/\r$//' <file_name> - Ref: [H903] Use only UNIX style newlines (``n``), not Windows style (``rn``) Tests: -Ran functional and unit tests.
|
@PrashantSunkari are you satisfied with this? |
caphrim007
left a comment
There was a problem hiding this comment.
I'm fine with the PR once the class names have been changed.
There were two extra files included in the PR which I think can be removed; python3.6 and fakefile.txt.
| @@ -0,0 +1 @@ | |||
| /usr/bin/python No newline at end of file | |||
| from f5.bigip.resource import Resource | ||
|
|
||
|
|
||
| class LSNPools(Collection): |
There was a problem hiding this comment.
This class can be named Lsn_Pools to avoid the use of _format_resource_name later. The underscore is automatically replaced by a hyphen.
Be sure to reflect the name change of the class throughout the rest of this PR though
| self._meta_data['attribute_registry'] =\ | ||
| {'tm:ltm:lsn-pool:lsn-poolstate': LSNPool} | ||
|
|
||
| def _format_resource_name(self): |
There was a problem hiding this comment.
not needed after Lsn_Pools change
| return "lsn-pools" | ||
|
|
||
|
|
||
| class LSNPool(Resource): |
| 'tm:ltm:lsn-log-profile:lsn-log-profilestate': LSNLogProfile} | ||
|
|
||
|
|
||
| class LSNLogProfiles(Collection): |
There was a problem hiding this comment.
Rename to Lsn_Log_Profiles
| return "lsn-log-profiles" | ||
|
|
||
|
|
||
| class LSNLogProfile(Resource): |
There was a problem hiding this comment.
Rename to Lsn_Log_Profile
Problem: Addressing review comments Analysis: - Addressing review comments Tests: - Ran functional and unit tests. - Ran flake8 f5
|
@caphrim007: Thanks for review comments. Added a new commit addressing the feedback. |
|
lgtm |
@caphrim007
Fixes #1317
Adds support for following CGNAT related resources. These are needed to address basic cgnat usecase.
LSNpool collection and resource + tests
LSN log profile collection and resource + tests
Add missing ALG profile - IPsecALG
Helps with following user stories:
User is able to create LSN pool without lsn log profile
User is able to create LSN pool with lsn log profile
User is able to create a virtual and attach a lsn pool and ALG profile
This work adds new functionality and can be reviewed in any order.
Recommended path:
LSN pool code(f5/bigip/tm/ltm/lsnpool.py) covered lsnpool + lsnpool log profile
Looking at tests (f5/bigip/tm/ltm/test/functional/test_lsnpool.py)
New profile added - f5/bigip/tm/ltm/profile.py
I work at F5 networks in CGNAT test org.
cmd: py.test test_lsnpool.py --ignore=f5/ --bigip=172.27.77.41 -vs
test_lsnpool.py::TestLSNPool::test_create_no_args PASSED
test_lsnpool.py::TestLSNPool::test_create PASSED
test_lsnpool.py::TestLSNPool::test_create_with_logProfile_without_logPub PASSED
test_lsnpool.py::TestLSNPool::test_create_with_logProfile PASSED
test_lsnpool.py::TestLSNPool::test_refresh PASSED
test_lsnpool.py::TestLSNPool::test_update PASSED
test_lsnpool.py::TestLSNPool::test_exists PASSED
test_lsnpool.py::TestLSNPool::test_stats PASSED
test_lsnpool.py::TestLSNPool::test_create_with_nondefault_mode PASSED
test_lsnpool.py::TestLSNPool::test_create_with_invalid_mode PASSED
test_lsnpool.py::TestLSNPool::test_create_with_member PASSED
test_lsnpool.py::TestLSNPool::test_virtual_with_pool PASSED
test_lsnpool.py::TestLSNPool::test_collection PASSED
test_lsnpool.py::TestLSNPoolLogProfile::test_create_no_args PASSED
test_lsnpool.py::TestLSNPoolLogProfile::test_create PASSED
test_lsnpool.py::TestLSNPoolLogProfile::test_update PASSED
test_lsnpool.py::TestLSNPoolLogProfile::test_exists PASSED