Skip to content

api, server: fix add-remove vpn user without vpn owner#5850

Merged
sureshanaparti merged 4 commits into
apache:4.16from
shapeblue:fix-add-remove-vpn-user-wo-vpnaccess
Feb 10, 2022
Merged

api, server: fix add-remove vpn user without vpn owner#5850
sureshanaparti merged 4 commits into
apache:4.16from
shapeblue:fix-add-remove-vpn-user-wo-vpnaccess

Conversation

@shwstppr
Copy link
Copy Markdown
Contributor

@shwstppr shwstppr commented Jan 11, 2022

Description

Fixes #5711

  • When the owner account does not have VPN access, VPN user should be added in Add state
  • While removing VPN user when the owner account has no VPN, VPN user should be deleted from the database.

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

  • Major
  • Minor

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

Screenshots (if appropriate):

How Has This Been Tested?

Fixes apache#5711

ACS should not add a new user in Add state when the owner account does not have VPN access.
While removing VPN user ACS should not fail completely when owner account ahs no VPN.

Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
@shwstppr
Copy link
Copy Markdown
Contributor Author

@blueorangutan package

@blueorangutan
Copy link
Copy Markdown

@shwstppr a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.

@blueorangutan
Copy link
Copy Markdown

Packaging result: ✔️ el7 ✔️ el8 ✔️ debian ✔️ suse15. SL-JID 2249

@sureshanaparti
Copy link
Copy Markdown
Contributor

@blueorangutan test

@blueorangutan
Copy link
Copy Markdown

@sureshanaparti a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests

@apache apache deleted a comment from sureshanaparti Jan 19, 2022
@apache apache deleted a comment from blueorangutan Jan 19, 2022
@apache apache deleted a comment from blueorangutan Jan 19, 2022
@apache apache deleted a comment from sureshanaparti Jan 19, 2022
@apache apache deleted a comment from shwstppr Jan 19, 2022
@apache apache deleted a comment from blueorangutan Jan 19, 2022
@apache apache deleted a comment from blueorangutan Jan 19, 2022
@sureshanaparti
Copy link
Copy Markdown
Contributor

@blueorangutan package

@blueorangutan
Copy link
Copy Markdown

@sureshanaparti a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.

@blueorangutan
Copy link
Copy Markdown

Packaging result: ✔️ el7 ✔️ el8 ✖️ debian ✔️ suse15. SL-JID 2260

@shwstppr
Copy link
Copy Markdown
Contributor Author

@blueorangutan package

@blueorangutan
Copy link
Copy Markdown

@shwstppr a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.

@blueorangutan
Copy link
Copy Markdown

Packaging result: ✔️ el7 ✔️ el8 ✔️ debian ✔️ suse15. SL-JID 2282

@shwstppr
Copy link
Copy Markdown
Contributor Author

@blueorangutan test

@blueorangutan
Copy link
Copy Markdown

@shwstppr a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests

@blueorangutan
Copy link
Copy Markdown

Packaging result: ✖️ el7 ✔️ el8 ✔️ debian ✔️ suse15. SL-JID 2514

@shwstppr
Copy link
Copy Markdown
Contributor Author

shwstppr commented Feb 8, 2022

@blueorangutan package

@blueorangutan
Copy link
Copy Markdown

@shwstppr a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.

@blueorangutan
Copy link
Copy Markdown

Packaging result: ✖️ el7 ✖️ el8 ✖️ debian ✖️ suse15. SL-JID 2518

@weizhouapache
Copy link
Copy Markdown
Member

@blueorangutan package

@blueorangutan
Copy link
Copy Markdown

@weizhouapache a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.

@blueorangutan
Copy link
Copy Markdown

Packaging result: ✖️ el7 ✖️ el8 ✖️ debian ✔️ suse15. SL-JID 2521

@DaanHoogland
Copy link
Copy Markdown
Contributor

@blueorangutan package

@blueorangutan
Copy link
Copy Markdown

@DaanHoogland a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.


List<? extends VpnUser> listVpnUsers(long vpnOwnerId, String userName);

void removeVpnUserWithoutValidVpnOwner(long id);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@shwstppr is removeVpnUserWithoutValidVpnOwner used somethere ?

Copy link
Copy Markdown
Contributor Author

@shwstppr shwstppr Feb 9, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@weizhouapache
--edit--
removed unused method

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@shwstppr it uses another method removeVpnUserWithoutRemoteAccessVpn

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@weizhouapache sorry realized that. I've removed the unused method now

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@shwstppr good !

@blueorangutan
Copy link
Copy Markdown

Packaging result: ✔️ el7 ✔️ el8 ✔️ debian ✔️ suse15. SL-JID 2531

@DaanHoogland
Copy link
Copy Markdown
Contributor

@blueorangutan test

@blueorangutan
Copy link
Copy Markdown

@DaanHoogland a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests

Copy link
Copy Markdown
Member

@weizhouapache weizhouapache left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have tested some scenarios, the following are good.

create vpn users for other accounts (I believe same results when create vpn users for same account by api)
(1) has no isolated network
(2) has isolated network in Allocated state, and no remote access vpn
(3) has isolated network in Implemented state, and no remote access vpn
(4) has isolated network in Implemented state, and remote access vpn is enabled
(5) has isolated network in Allocated state, and remote access vpn is enabled

I did not test
(1) has multiple isolated networks, but fail to apply vpn user in one of the VRs.

@blueorangutan
Copy link
Copy Markdown

Trillian test result (tid-3240)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 36422 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr5850-t3240-kvm-centos7.zip
Smoke tests completed. 78 look OK, 2 have errors
Only failed tests results shown below:

Test Result Time (s) Test File
test_01_add_primary_storage_disabled_host Error 0.58 test_primary_storage.py
test_01_primary_storage_nfs Error 0.10 test_primary_storage.py
ContextSuite context=TestStorageTags>:setup Error 0.19 test_primary_storage.py
test_03_deploy_and_scale_kubernetes_cluster Failure 31.91 test_kubernetes_clusters.py
test_07_deploy_kubernetes_ha_cluster Failure 59.63 test_kubernetes_clusters.py
test_08_upgrade_kubernetes_ha_cluster Failure 34.94 test_kubernetes_clusters.py
test_09_delete_kubernetes_ha_cluster Failure 35.93 test_kubernetes_clusters.py
ContextSuite context=TestKubernetesCluster>:teardown Error 125.12 test_kubernetes_clusters.py

@weizhouapache
Copy link
Copy Markdown
Member

@blueorangutan test

@blueorangutan
Copy link
Copy Markdown

@weizhouapache a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests

@sureshanaparti
Copy link
Copy Markdown
Contributor

I have tested some scenarios, the following are good.

create vpn users for other accounts (I believe same results when create vpn users for same account by api) (1) has no isolated network (2) has isolated network in Allocated state, and no remote access vpn (3) has isolated network in Implemented state, and no remote access vpn (4) has isolated network in Implemented state, and remote access vpn is enabled (5) has isolated network in Allocated state, and remote access vpn is enabled

I did not test (1) has multiple isolated networks, but fail to apply vpn user in one of the VRs.

Hi @shwstppr @weizhouapache what's the concensus here, is this PR good to go / merge?

@weizhouapache
Copy link
Copy Markdown
Member

I have tested some scenarios, the following are good.
create vpn users for other accounts (I believe same results when create vpn users for same account by api) (1) has no isolated network (2) has isolated network in Allocated state, and no remote access vpn (3) has isolated network in Implemented state, and no remote access vpn (4) has isolated network in Implemented state, and remote access vpn is enabled (5) has isolated network in Allocated state, and remote access vpn is enabled
I did not test (1) has multiple isolated networks, but fail to apply vpn user in one of the VRs.

Hi @shwstppr @weizhouapache what's the concensus here, is this PR good to go / merge?

@sureshanaparti
it is good to me. I have approved it.

Copy link
Copy Markdown
Contributor

@borisstoyanov borisstoyanov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, manually tested

@borisstoyanov borisstoyanov removed their assignment Feb 9, 2022
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
@sureshanaparti
Copy link
Copy Markdown
Contributor

@blueorangutan package

@blueorangutan
Copy link
Copy Markdown

@sureshanaparti a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.

@blueorangutan
Copy link
Copy Markdown

Packaging result: ✔️ el7 ✔️ el8 ✔️ debian ✔️ suse15. SL-JID 2538

@blueorangutan
Copy link
Copy Markdown

Trillian test result (tid-3257)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 30690 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr5850-t3257-kvm-centos7.zip
Smoke tests completed. 91 look OK, 1 have errors
Only failed tests results shown below:

Test Result Time (s) Test File
test_01_nic Error 145.22 test_nic.py

@sureshanaparti
Copy link
Copy Markdown
Contributor

Trillian test result (tid-3257) Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7 Total time taken: 30690 seconds Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr5850-t3257-kvm-centos7.zip Smoke tests completed. 91 look OK, 1 have errors Only failed tests results shown below:

Test Result Time (s) Test File
test_01_nic Error 145.22 test_nic.py

Not noticed this test failure in the last run, seems to be intermittent and is unrelated to this PR changes.

@sureshanaparti sureshanaparti merged commit f88f934 into apache:4.16 Feb 10, 2022
Pearl1594 pushed a commit to shapeblue/cloudstack that referenced this pull request Feb 14, 2022
* api, server: fix add-remove vpn user without vpn owner

Fixes apache#5711

ACS should not add a new user in Add state when the owner account does not have VPN access.
While removing VPN user ACS should not fail completely when owner account ahs no VPN.

* change , fixes

* remove unused method

Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

Error while create VPN user for another account

7 participants