cloudstack/test/integration/component
Manoj Kumar 7632814cd2
Instance lease: Allow deployment of instances with lease duration and leaseexpiry action (#10560)
* FR-248: Instance lease, WIP commit

* insert lease expiry into db and use that to filter exiring vms, add asyncjobmanager

* Add leaseDuration and leaseExpiryAction in Service offering create flow

* Update listVM cmd to allow listing only leased instances

* Add methods to fetch instances for which lease is expiring in next days

* Changes included:
config key setup and configured for alert email
lease options in create and update vm screen
handle delete protection, edit vm, create vm
validated stop and detroy, delete protection

* Update UI screens for leased properties coming from config and service offering

* use global lock before running scheduler

* Unit tests

* Flow changes done in UI based on discussion

* Include view changes in schema upgrade files and use feature in various UI elements

* Added integration test for vm deployment, UI enhancements for user persona, bug fixes

* validate integration tests, minor ui changes and log messages

* fix build: moving configkey from setup to test itself

* Disable testAlert to unblock build and trim whitespaces in integration tests

* Address review comments

* Minor changes in EditVM screen

* Use ExecutorService instead of Timer and TimerTask

* Additional review comments

* Incorporate following changes:
1. Execute lease action once on the instance
2. Cancel lease on instance when feature is disabled
3. Relevant events when lease gets disabled, cancelled, executed
4. Disable associating lease after deployment
5. UI elements and flow changes
6. Changes based on feedback from demo

* Handle pr review comments

* address review comments

* move instance.lease.enabled config to VMLeaseManager interface

* bug fix in edit instance flow and reject api request for invalid values

* max allowed lease is for 100 years

* log instance ids for expired instance

* Fix config validation for value range and code coverage improvement

* fix lease expiry request failures in async

* dont use forced: true for StopVmCmd

* Update server/src/main/java/org/apache/cloudstack/vm/lease/VMLeaseManager.java

Co-authored-by: Vishesh <vishesh92@gmail.com>

* handle review comments

---------

Co-authored-by: Rohit Yadav <rohityadav89@gmail.com>
Co-authored-by: Vishesh <vishesh92@gmail.com>
2025-05-28 17:40:09 +05:30
..
cpu_limits python3: Migrate Marvin and smoketests to python3 (#4727) 2021-05-04 23:19:37 +05:30
maint pre-commit: enable Python flake8 rule `E271` (#9358) 2024-07-09 10:17:53 +02:00
__init__.py Add Python flake8 linting for W291 trailing whitespace with Super-Linter (#4687) 2022-03-28 11:40:26 -03:00
find_hosts_for_migration.py python3: Migrate Marvin and smoketests to python3 (#4727) 2021-05-04 23:19:37 +05:30
test_VirtualRouter_alerts.py CLOUDSTACK-10163: Component tests sanity (#2344) 2018-01-01 16:44:18 +05:30
test_acl_isolatednetwork.py test: fix component tests test_acl_isolatednetwork and test_acl_isolatednetwork_delete (#9571) 2024-08-23 19:27:11 +02:00
test_acl_isolatednetwork_delete.py test: fix component tests test_acl_isolatednetwork and test_acl_isolatednetwork_delete (#9571) 2024-08-23 19:27:11 +02:00
test_acl_listsnapshot.py Fix spelling (#6898) 2022-12-13 14:58:14 +01:00
test_acl_listvm.py Fix spelling (#6898) 2022-12-13 14:58:14 +01:00
test_acl_listvolume.py Fix spelling (#6898) 2022-12-13 14:58:14 +01:00
test_acl_sharednetwork.py Fix spelling in docs, logs, exception messages etc (#9076) 2024-05-28 07:41:20 +02:00
test_acl_sharednetwork_deployVM-impersonation.py test(python): fix code comment typo; Valiate -> Validate (#10536) 2025-04-08 12:44:56 +02:00
test_acquire_specified_public_ip.py python3: Migrate Marvin and smoketests to python3 (#4727) 2021-05-04 23:19:37 +05:30
test_add_remove_network.py misc: fix spelling (#7206) 2023-05-23 11:06:16 +05:30
test_advancedsg_networks.py Shared Network Firewall (Security groups) in Advanced zone without security groups (#9415) 2024-09-05 10:35:05 +02:00
test_affinity_groups.py Add Python flake8 linting for W291 trailing whitespace with Super-Linter (#4687) 2022-03-28 11:40:26 -03:00
test_affinity_groups_projects.py cleanup call on super (#10807) 2025-05-09 12:54:32 +02:00
test_allocation_states.py Add Python flake8 linting for W291 trailing whitespace with Super-Linter (#4687) 2022-03-28 11:40:26 -03:00
test_asa1000v_fw.py Add Python flake8 linting for W291 trailing whitespace with Super-Linter (#4687) 2022-03-28 11:40:26 -03:00
test_assign_vm.py pre-commit: enable Python flake8 rule `E272` (#9361) 2024-07-10 09:17:25 +02:00
test_baremetal.py Enable Flake8 rule W391 (#6606) 2022-11-13 11:00:07 +01:00
test_base_image_updation.py Remove unneeded duplicate words (#7850) 2023-09-18 13:16:33 +02:00
test_bigswitch_bcf.py CLOUDSTACK-6697: bigswitch networking plugin update 2015-04-09 13:02:02 +05:30
test_blocker_bugs.py Add Python flake8 linting for W291 trailing whitespace with Super-Linter (#4687) 2022-03-28 11:40:26 -03:00
test_brocade_vcs.py Enable Flake8 rule W391 (#6606) 2022-11-13 11:00:07 +01:00
test_browse_templates.py Use lowercase HTTP header field names so we are compatible with HTTP/2 (#7006) 2023-01-23 11:17:54 +01:00
test_browse_templates2.py python3: Migrate Marvin and smoketests to python3 (#4727) 2021-05-04 23:19:37 +05:30
test_browse_volumes.py misc: fix spelling (#7549) 2023-11-02 09:23:53 +01:00
test_concurrent_create_volume_from_snapshot.py Enable Flake8 rule W391 (#6606) 2022-11-13 11:00:07 +01:00
test_concurrent_snapshots_limit.py spelling: Fix spelling `Occured` to `Occurred` (#6061) 2022-03-07 15:07:02 +05:30
test_configdrive.py Remove unneeded duplicate words (#7850) 2023-09-18 13:16:33 +02:00
test_cpu_domain_limits.py python3: Migrate Marvin and smoketests to python3 (#4727) 2021-05-04 23:19:37 +05:30
test_cpu_limits.py Fix spelling (#6860) 2022-11-13 10:56:15 +01:00
test_cpu_max_limits.py CLOUDSTACK-10163: Component tests sanity (#2344) 2018-01-01 16:44:18 +05:30
test_cpu_project_limits.py python3: Migrate Marvin and smoketests to python3 (#4727) 2021-05-04 23:19:37 +05:30
test_custom_hostname.py python3: Migrate Marvin and smoketests to python3 (#4727) 2021-05-04 23:19:37 +05:30
test_deploy_vgpu_vm.py Fix spelling (#6609) 2022-11-01 08:30:01 +01:00
test_deploy_vm_lease.py Instance lease: Allow deployment of instances with lease duration and leaseexpiry action (#10560) 2025-05-28 17:40:09 +05:30
test_deploy_vm_userdata_multi_nic.py docs: fix spelling in code comments (#8690) 2024-02-26 14:16:35 +01:00
test_deploy_vm_userdata_reg.py marvin: replace encodestring for encodebytes (#7027) 2023-05-08 12:51:12 +05:30
test_dhcp_dns_offload.py Enable Flake8 rule W391 (#6606) 2022-11-13 11:00:07 +01:00
test_dynamic_compute_offering.py Fix spelling (#6609) 2022-11-01 08:30:01 +01:00
test_edgezone_supportedoperations.py infra: edge zones (#6840) 2023-01-31 09:36:45 +01:00
test_egress_fw_rules.py pre-commit: enable Python flake8 rule `E272` (#9361) 2024-07-10 09:17:25 +02:00
test_egress_rules.py Enable Flake8 rule W391 (#6606) 2022-11-13 11:00:07 +01:00
test_eip_elb.py python3: Migrate Marvin and smoketests to python3 (#4727) 2021-05-04 23:19:37 +05:30
test_escalations_instances.py Remove unneeded duplicate words (#8358) 2023-12-15 17:13:32 +05:30
test_escalations_ipaddresses.py VM Autoscaling with virtual router (#6571) 2022-12-05 15:23:03 +01:00
test_escalations_isos.py python3: Migrate Marvin and smoketests to python3 (#4727) 2021-05-04 23:19:37 +05:30
test_escalations_networks.py tests: component test ports/fixes in python3 (#5082) 2021-09-02 16:03:49 +05:30
test_escalations_routers.py CLOUDSTACK-10163: Component tests sanity (#2344) 2018-01-01 16:44:18 +05:30
test_escalations_securitygroups.py python3: Migrate Marvin and smoketests to python3 (#4727) 2021-05-04 23:19:37 +05:30
test_escalations_snapshots.py python3: Migrate Marvin and smoketests to python3 (#4727) 2021-05-04 23:19:37 +05:30
test_escalations_templates.py Enable Flake8 rule W391 (#6606) 2022-11-13 11:00:07 +01:00
test_escalations_vmware.py Enable Flake8 rule W391 (#6606) 2022-11-13 11:00:07 +01:00
test_escalations_volumes.py tests: component test ports/fixes in python3 (#5082) 2021-09-02 16:03:49 +05:30
test_haproxy.py Fix spelling (#6860) 2022-11-13 10:56:15 +01:00
test_host.py Add `pre-commit` workflow with 3 Git hooks (#6273) 2023-01-11 12:25:31 +01:00
test_host_ha.py some component tests fixes (#5442) 2022-06-10 08:26:30 -03:00
test_host_ha.sh CLOUDSTACK-9782: Host HA and KVM HA provider 2017-08-30 18:06:48 +02:00
test_hypervisor_capabilities.py Enable Flake8 rule W391 (#6606) 2022-11-13 11:00:07 +01:00
test_implicit_planner.py CLOUDSTACK-7413: Adding required_hardware tag to regression test cases so that the test cases are picked up by simulator accordingly 2014-08-25 09:14:22 +05:30
test_interop_xd_ccp.py pre-commit: enable Python flake8 rule `E271` (#9358) 2024-07-09 10:17:53 +02:00
test_interpod_migration.py infra: edge zones (#6840) 2023-01-31 09:36:45 +01:00
test_invalid_gw_nm.py Enable Flake8 rule W391 (#6606) 2022-11-13 11:00:07 +01:00
test_ip_reservation.py user-shared networks: fix few issues (#6887) 2023-10-09 13:11:44 +05:30
test_lb_secondary_ip.py spelling: Fix spelling `Occured` to `Occurred` (#6061) 2022-03-07 15:07:02 +05:30
test_ldap.py Accept a role ID on linking an account to LDAP (#8236) 2024-06-26 01:26:28 +05:30
test_ldap_auto_import.py Remove unneeded duplicate words (#7850) 2023-09-18 13:16:33 +02:00
test_list_nics.py python3: Migrate Marvin and smoketests to python3 (#4727) 2021-05-04 23:19:37 +05:30
test_list_pod.py python3: Migrate Marvin and smoketests to python3 (#4727) 2021-05-04 23:19:37 +05:30
test_memory_limits.py python3: Migrate Marvin and smoketests to python3 (#4727) 2021-05-04 23:19:37 +05:30
test_migrate_vol_to_maintained_pool.py Fix spelling (#6272) 2022-07-05 09:08:53 +02:00
test_mm_domain_limits.py python3: Migrate Marvin and smoketests to python3 (#4727) 2021-05-04 23:19:37 +05:30
test_mm_max_limits.py python3: Migrate Marvin and smoketests to python3 (#4727) 2021-05-04 23:19:37 +05:30
test_mm_project_limits.py python3: Migrate Marvin and smoketests to python3 (#4727) 2021-05-04 23:19:37 +05:30
test_multi_tag_support.py Add `pre-commit` workflow with 3 Git hooks (#6273) 2023-01-11 12:25:31 +01:00
test_multiple_ip_ranges.py CLOUDSTACK-8062: test_multiple_ip_ranges.py - Fix the test case to avoid using same vlan IP range in each test case 2014-12-11 17:54:32 +05:30
test_multiple_ips_per_nic.py Remove unneeded duplicate words (#7850) 2023-09-18 13:16:33 +02:00
test_multiple_nic_support.py Fix spelling in code comments (#8866) 2024-04-23 12:11:56 +02:00
test_multiple_physical_network_creation.py misc: fix spelling (#7206) 2023-05-23 11:06:16 +05:30
test_multiple_public_interfaces.py tests: component test ports/fixes in python3 (#5082) 2021-09-02 16:03:49 +05:30
test_multiple_subnets_in_isolated_network.py cloudstack: make code more inclusive 2021-06-08 15:47:20 +05:30
test_multiple_subnets_in_isolated_network_rvr.py cloudstack: make code more inclusive 2021-06-08 15:47:20 +05:30
test_multiple_subnets_in_vpc.py cloudstack: make code more inclusive 2021-06-08 15:47:20 +05:30
test_multiple_subnets_in_vpc_rvr.py cloudstack: make code more inclusive 2021-06-08 15:47:20 +05:30
test_ncc_integration_dedicated.py Add `pre-commit` workflow with 3 Git hooks (#6273) 2023-01-11 12:25:31 +01:00
test_ncc_integration_shared.py Add `pre-commit` workflow with 3 Git hooks (#6273) 2023-01-11 12:25:31 +01:00
test_netscaler_configs.py Fix spelling (#6272) 2022-07-05 09:08:53 +02:00
test_netscaler_lb.py Fix spelling (#6272) 2022-07-05 09:08:53 +02:00
test_netscaler_lb_algo.py Add Python flake8 linting for W291 trailing whitespace with Super-Linter (#4687) 2022-03-28 11:40:26 -03:00
test_netscaler_lb_sticky.py CLOUDSTACK-8532: Modification in setupClass to skip testcases rather than throwing an exception on "Exceeding connection limit to Netscaler device" 2015-06-03 15:19:04 +05:30
test_netscaler_nw_off.py Fix spelling (#6272) 2022-07-05 09:08:53 +02:00
test_network_ipv6.py test: use normal user for createing networks, vpcs (#6988) 2022-12-19 11:19:56 +01:00
test_network_mtu.py Configurable MTU for VR (#6426) 2023-01-04 09:42:24 +01:00
test_network_offering.py python3: Migrate Marvin and smoketests to python3 (#4727) 2021-05-04 23:19:37 +05:30
test_network_vpc_custom_dns.py gha(python): fix `W391` blank line at end of file (#6897) 2022-11-13 11:44:07 +01:00
test_non_contiguous_vlan.py Add Python flake8 linting for W291 trailing whitespace with Super-Linter (#4687) 2022-03-28 11:40:26 -03:00
test_organization_states.py Fix spelling (#6609) 2022-11-01 08:30:01 +01:00
test_overcommit.py python3: Migrate Marvin and smoketests to python3 (#4727) 2021-05-04 23:19:37 +05:30
test_persistent_networks.py Synchronization of network devices on newly added hosts for Persistent Networks (#5977) 2022-04-11 23:12:05 -03:00
test_portable_ip.py spelling: Fix spelling `Occured` to `Occurred` (#6061) 2022-03-07 15:07:02 +05:30
test_project_configs.py Fix spelling (#7087) 2023-01-16 10:56:07 +01:00
test_project_limits.py Fix spelling in docs, logs, exception messages etc (#9076) 2024-05-28 07:41:20 +02:00
test_project_resources.py test,refactor: fix test_project_resources cleanup (#8097) 2023-10-16 16:24:59 +02:00
test_project_usage.py Add Python flake8 linting for W291 trailing whitespace with Super-Linter (#4687) 2022-03-28 11:40:26 -03:00
test_protocol_number_security_group.py python3: Migrate Marvin and smoketests to python3 (#4727) 2021-05-04 23:19:37 +05:30
test_ps_domain_limits.py tests: component test ports/fixes in python3 (#5082) 2021-09-02 16:03:49 +05:30
test_ps_limits.py tests: component test ports/fixes in python3 (#5082) 2021-09-02 16:03:49 +05:30
test_ps_max_limits.py Fix spelling (#6041) 2022-03-03 13:10:14 -03:00
test_ps_project_limits.py Fix spelling (#6041) 2022-03-03 13:10:14 -03:00
test_ps_resize_volume.py Fix spelling, word case, duplicate words in code comments only (#8987) 2024-04-30 10:58:26 +02:00
test_public_ip.py Fix spelling (#6597) 2022-08-03 15:43:47 +05:30
test_recurring_snapshots.py CLOUDSTACK-8394: Skipping recurring snapshot test cases for Hyperv and LXC 2015-05-20 11:36:15 +05:30
test_redundant_router_cleanups.py tests: component test ports/fixes in python3 (#5082) 2021-09-02 16:03:49 +05:30
test_redundant_router_services.py Enable Flake8 rule W391 (#6606) 2022-11-13 11:00:07 +01:00
test_redundant_router_upgrades.py cloudstack: make code more inclusive 2021-06-08 15:47:20 +05:30
test_region_vpc.py misc: fix spelling (#7206) 2023-05-23 11:06:16 +05:30
test_regions_accounts.py CLOUDSTACK-7413: Adding required_hardware tag to regression test cases so that the test cases are picked up by simulator accordingly 2014-08-25 09:14:22 +05:30
test_reset_ssh_keypair.py python3: Migrate Marvin and smoketests to python3 (#4727) 2021-05-04 23:19:37 +05:30
test_resource_count_running_vms.py New feature: Resource count (CPU/RAM) take only running vms into calculation (#3760) 2020-01-30 10:36:50 +01:00
test_resource_limit_tags.py Fix exceeding of resource limits with powerflex (#9008) 2024-05-08 20:55:19 +05:30
test_resource_limits.py Fix spelling in docs, logs, exception messages etc (#9076) 2024-05-28 07:41:20 +02:00
test_rootvolume_resize.py pre-commit: enable Python flake8 rule `E271` (#9358) 2024-07-09 10:17:53 +02:00
test_routers.py Health check feature for virtual router (#3575) 2020-01-30 12:39:03 +01:00
test_secsr_mount.py Add Python flake8 linting for W291 trailing whitespace with Super-Linter (#4687) 2022-03-28 11:40:26 -03:00
test_security_groups.py Shared Network Firewall (Security groups) in Advanced zone without security groups (#9415) 2024-09-05 10:35:05 +02:00
test_separate_backup_from_snapshot.py This feature separates the snapshot creation on primary and its backing up on secondary. 2017-10-04 14:39:03 +05:30
test_shared_networks.py misc: fix spelling (#7206) 2023-05-23 11:06:16 +05:30
test_snapshot_copy.py api,server,ui: snapshot copy, multi-zone replica (#7873) 2023-10-23 09:01:58 +02:00
test_snapshot_gc.py Fix spelling (#6041) 2022-03-03 13:10:14 -03:00
test_snapshot_limits.py python3: Migrate Marvin and smoketests to python3 (#4727) 2021-05-04 23:19:37 +05:30
test_snapshots.py tests: component test ports/fixes in python3 (#5082) 2021-09-02 16:03:49 +05:30
test_snapshots_improvement.py Fix spelling in docs, logs, exception messages etc (#9076) 2024-05-28 07:41:20 +02:00
test_ss_domain_limits.py tests: component test ports/fixes in python3 (#5082) 2021-09-02 16:03:49 +05:30
test_ss_limits.py tests: component test ports/fixes in python3 (#5082) 2021-09-02 16:03:49 +05:30
test_ss_max_limits.py tests: component test ports/fixes in python3 (#5082) 2021-09-02 16:03:49 +05:30
test_ss_volume_usage.py Cloudstack 10064: Secondary storage Usage for uploadedVolume is not collected (#2258) 2017-12-27 13:21:54 +05:30
test_stopped_vm.py Fix spelling (#6609) 2022-11-01 08:30:01 +01:00
test_storage_motion.py python3: Migrate Marvin and smoketests to python3 (#4727) 2021-05-04 23:19:37 +05:30
test_tags.py pre-commit: enable Python Flake8 rule `E713` (#9016) 2024-07-08 09:00:18 +02:00
test_template_access_across_domains.py Added configuration and Integration test to restrict public template … (#4774) 2022-04-21 23:10:21 -03:00
test_template_from_snapshot_with_template_details.py Fix spelling (#6609) 2022-11-01 08:30:01 +01:00
test_templates.py python3: Migrate Marvin and smoketests to python3 (#4727) 2021-05-04 23:19:37 +05:30
test_updateResourceCount.py Add Python flake8 linting for W291 trailing whitespace with Super-Linter (#4687) 2022-03-28 11:40:26 -03:00
test_update_vm.py server Don't allow inadvertent deletion of hidden details via API (#7880) 2023-08-24 10:45:39 +02:00
test_user_private_gateway.py Fix user shared networks tests (#6319) 2022-04-27 07:30:44 -03:00
test_user_shared_network.py Fix user shared networks tests (#6319) 2022-04-27 07:30:44 -03:00
test_vm_passwdenabled.py python3: Migrate Marvin and smoketests to python3 (#4727) 2021-05-04 23:19:37 +05:30
test_vmware_drs.py python3: Migrate Marvin and smoketests to python3 (#4727) 2021-05-04 23:19:37 +05:30
test_volume_destroy_recover.py Add Python flake8 linting for W291 trailing whitespace with Super-Linter (#4687) 2022-03-28 11:40:26 -03:00
test_volumes.py tests: component test ports/fixes in python3 (#5082) 2021-09-02 16:03:49 +05:30
test_vpc.py misc: fix spelling (#7206) 2023-05-23 11:06:16 +05:30
test_vpc_distributed_routing_offering.py misc: fix spelling (#7206) 2023-05-23 11:06:16 +05:30
test_vpc_ipv6.py test: use normal user for createing networks, vpcs (#6988) 2022-12-19 11:19:56 +01:00
test_vpc_network.py VPC: update default network offering for vpc tier to conserve_mode=1 (#8309) 2023-12-18 12:08:51 +05:30
test_vpc_network_internal_lbrules.py tests: component test ports/fixes in python3 (#5082) 2021-09-02 16:03:49 +05:30
test_vpc_network_lbrules.py Add Python flake8 linting for W291 trailing whitespace with Super-Linter (#4687) 2022-03-28 11:40:26 -03:00
test_vpc_network_pfrules.py Fix spelling (#6064) 2022-03-08 13:02:35 -03:00
test_vpc_network_staticnatrule.py Add Python flake8 linting for W291 trailing whitespace with Super-Linter (#4687) 2022-03-28 11:40:26 -03:00
test_vpc_offerings.py misc: fix spelling (#7206) 2023-05-23 11:06:16 +05:30
test_vpc_routers.py Fix spelling (#6272) 2022-07-05 09:08:53 +02:00
test_vpc_vm_life_cycle.py misc: fix spelling (#7549) 2023-11-02 09:23:53 +01:00
test_vpc_vms_deployment.py misc: fix spelling (#7206) 2023-05-23 11:06:16 +05:30
test_vpn_users.py python3: Migrate Marvin and smoketests to python3 (#4727) 2021-05-04 23:19:37 +05:30