cleanup validations for VPN connection creation
Description
This PR adds a validation when creating a VPN connection in a VPC to make sure the VPN gateway exists.
Fixes: #7250
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)
- [x] Cleanup (Code refactoring and cleanup, that may add test cases)
- [ ] build/CI
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
- [ ] Major
- [x] Minor
Bug Severity
- [ ] BLOCKER
- [ ] Critical
- [ ] Major
- [ ] Minor
- [x] Trivial
Screenshots (if appropriate):
How Has This Been Tested?
How did you try to break this feature and the system with this change?
Codecov Report
Attention: Patch coverage is 0% with 48 lines in your changes missing coverage. Please review.
Project coverage is 15.08%. Comparing base (
67ce326) to head (c9a722b). Report is 1 commits behind head on 4.19.
| Files with missing lines | Patch % | Lines |
|---|---|---|
| ...com/cloud/network/vpn/Site2SiteVpnManagerImpl.java | 0.00% | 48 Missing :warning: |
Additional details and impacted files
@@ Coverage Diff @@
## 4.19 #9195 +/- ##
============================================
- Coverage 15.08% 15.08% -0.01%
- Complexity 11182 11183 +1
============================================
Files 5402 5402
Lines 473137 473148 +11
Branches 61094 61020 -74
============================================
Hits 71364 71364
- Misses 393835 393846 +11
Partials 7938 7938
| Flag | Coverage Δ | |
|---|---|---|
| uitests | 4.30% <ø> (-0.01%) |
:arrow_down: |
| unittests | 15.80% <0.00%> (-0.01%) |
:arrow_down: |
Flags with carried forward coverage won't be shown. Click here to find out more.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
CLGTM.
Just one remark, maybe we can use a unique error message in the
getAndValidatemethods.
The calls have different messages passed (though only slightly). Can you specify what you would like to see there @hsato03 ?
CLGTM. Just one remark, maybe we can use a unique error message in the
getAndValidatemethods.The calls have different messages passed (though only slightly). Can you specify what you would like to see there @hsato03 ?
What about throw new InvalidParameterValueException(String.format("Unable to find the specified Site-to-Site VPN customer gateway: %s.", customerGatewayId)); in the getAndValidateSite2SiteCustomerGateway
and throw new InvalidParameterValueException(String.format("Unable to find the specified Site-to-Site VPN gateway %s.", vpnGatewayId)); in the getAndValidateSite2SiteVpnGateway?
This should cover all cases and the errMsg parameter can be removed.
@hsato03 applied your suggestion and did some extra cleanup.
@blueorangutan package
@blueorangutan package
@blueorangutan test
@blueorangutan test
@blueorangutan package
@blueorangutan test
@blueorangutan package
@blueorangutan test
The issue is not resolved. When I try creating a site to site VPN connection without enabling the VPN gateway of the VPC it doesn't throw any error.
thanks for testing @rajujith
The issue is not resolved. When I try creating a site to site VPN connection without enabling the VPN gateway of the VPC it doesn't throw any error.
hm, it has been a while and had some updates. I'll retest and see...
The issue is not resolved. When I try creating a site to site VPN connection without enabling the VPN gateway of the VPC it doesn't throw any error.
hm, it has been a while and had some updates. I'll retest and see...
@rajujith , this was probably due to some merge issues, It should work now. I.E. you should not be able to create a VPN connection without having a VPN gateway available. Can you try?
The issue is not resolved. When I try creating a site to site VPN connection without enabling the VPN gateway of the VPC it doesn't throw any error.
hm, it has been a while and had some updates. I'll retest and see...
@rajujith , this was probably due to some merge issues, It should work now. I.E. you should not be able to create a VPN connection without having a VPN gateway available. Can you try?
@DaanHoogland
I tried again with the packages from 17th Jul and the issue is not resolved.
When I try creating a site to site VPN connection without enabling the VPN gateway of the VPC it doesn't throw any error.
The issue is not resolved. When I try creating a site to site VPN connection without enabling the VPN gateway of the VPC it doesn't throw any error.
hm, it has been a while and had some updates. I'll retest and see...
@rajujith , this was probably due to some merge issues, It should work now. I.E. you should not be able to create a VPN connection without having a VPN gateway available. Can you try?
@DaanHoogland
I tried again with the packages from 17th Jul and the issue is not resolved.
When I try creating a site to site VPN connection without enabling the VPN gateway of the VPC it doesn't throw any error.
@kiranchavala it was only caught/solved in the API. It is now also the UI.
@blueorangutan package
@DaanHoogland a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 11208
[SF] Trillian test result (tid-11568) Environment: kvm-ol8 (x2), Advanced Networking with Mgmt server ol8 Total time taken: 51996 seconds Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr9195-t11568-kvm-ol8.zip Smoke tests completed. 132 look OK, 1 have errors, 0 did not run Only failed and skipped tests results shown below:
| Test | Result | Time (s) | Test File |
|---|---|---|---|
| ContextSuite context=TestISOUsage>:setup | Error |
0.00 | test_usage.py |
@blueorangutan package
@DaanHoogland a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 11242