Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix smoke tests due to change in behavior of restore VM #10583

Open
wants to merge 3 commits into
base: 4.19
Choose a base branch
from

Conversation

Pearl1594
Copy link
Contributor

@Pearl1594 Pearl1594 commented Mar 18, 2025

Description

This PR fixes a regression introduced due to change in behavior with restore VM operation. Since restoreVM results in root volume deletion, if the VM is cleaned up without starting no Root disk is found.
Caused by: #8800 (#8800 (comment))
Test failures also noticed on 4.19.2 health check: #9315 (comment)
Fixes failure in:
test_events_resource.py
test_network_permissions.py

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)
  • build/CI
  • test (unit or integration test code)

Feature/Enhancement Scale or Bug Severity

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

Screenshots (if appropriate):

How Has This Been Tested?

How did you try to break this feature and the system with this change?

Copy link

codecov bot commented Mar 18, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 15.16%. Comparing base (02d0dca) to head (04c901d).
Report is 12 commits behind head on 4.19.

Additional details and impacted files
@@             Coverage Diff             @@
##               4.19   #10583     +/-   ##
===========================================
  Coverage     15.16%   15.16%             
- Complexity    11327    11349     +22     
===========================================
  Files          5414     5415      +1     
  Lines        474814   476042   +1228     
  Branches      57912    58391    +479     
===========================================
+ Hits          72004    72197    +193     
- Misses       394758   395783   +1025     
- Partials       8052     8062     +10     
Flag Coverage Δ
uitests 4.26% <ø> (-0.03%) ⬇️
unittests 15.89% <ø> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Pearl1594 Pearl1594 moved this to In Progress in ACS 4.20.1 Mar 18, 2025
@Pearl1594
Copy link
Contributor Author

I wonder if this change in behaviour requires documentation.

@Pearl1594
Copy link
Contributor Author

@blueorangutan package

@blueorangutan
Copy link

@Pearl1594 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.

@blueorangutan
Copy link

Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 12822

@Pearl1594
Copy link
Contributor Author

@blueorangutan test

@blueorangutan
Copy link

@Pearl1594 a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests

@blueorangutan
Copy link

[SF] Trillian test result (tid-12760)
Environment: kvm-ol8 (x2), Advanced Networking with Mgmt server ol8
Total time taken: 49974 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr10583-t12760-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
test_01_create_template Error 11.62 test_templates.py
test_CreateTemplateWithDuplicateName Error 24.16 test_templates.py
test_02_create_template_with_checksum_sha1 Error 65.80 test_templates.py
test_03_create_template_with_checksum_sha256 Error 65.82 test_templates.py
test_04_create_template_with_checksum_md5 Error 121.32 test_templates.py
test_05_create_template_with_no_checksum Error 65.78 test_templates.py
test_03_delete_template Error 1.10 test_templates.py
test_04_extract_template Error 1.12 test_templates.py

@Pearl1594
Copy link
Contributor Author

@blueorangutan test matrix

@blueorangutan
Copy link

@Pearl1594 a [SL] Trillian-Jenkins matrix job (EL8 mgmt + EL8 KVM, Ubuntu22 mgmt + Ubuntu22 KVM, EL8 mgmt + VMware 7.0u3, EL9 mgmt + XCP-ng 8.2 ) has been kicked to run smoke tests

@blueorangutan
Copy link

[SF] Trillian test result (tid-12776)
Environment: vmware-70u3 (x2), Advanced Networking with Mgmt server ol8
Total time taken: 49737 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr10583-t12776-vmware-70u3.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
test_assign_and_removal_lb Error 44.68 test_loadbalance.py

@blueorangutan
Copy link

[SF] Trillian test result (tid-12775)
Environment: kvm-ubuntu22 (x2), Advanced Networking with Mgmt server u22
Total time taken: 50177 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr10583-t12775-kvm-ubuntu22.zip
Smoke tests completed. 133 look OK, 0 have errors, 0 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File

@blueorangutan
Copy link

[SF] Trillian test result (tid-12774)
Environment: kvm-ol8 (x2), Advanced Networking with Mgmt server ol8
Total time taken: 55487 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr10583-t12774-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
test_03_secured_to_nonsecured_vm_migration Error 376.38 test_vm_life_cycle.py
test_04_nonsecured_to_secured_vm_migration Error 400.52 test_vm_life_cycle.py

@blueorangutan
Copy link

[SF] Trillian test result (tid-12777)
Environment: xcpng82 (x2), Advanced Networking with Mgmt server ol9
Total time taken: 64151 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr10583-t12777-xcpng82.zip
Smoke tests completed. 131 look OK, 2 have errors, 0 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File
test_01_condensed_drs_algorithm Failure 165.54 test_cluster_drs.py
test_02_balanced_drs_algorithm Failure 184.04 test_cluster_drs.py
test_01_non_strict_host_anti_affinity Error 219.12 test_nonstrict_affinity_group.py
test_02_non_strict_host_affinity Error 179.90 test_nonstrict_affinity_group.py

Copy link
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.

looks good
thanks @Pearl1594

@weizhouapache weizhouapache changed the title Fix unit tests due to change in behavior of restore VM Fix smoke tests due to change in behavior of restore VM Mar 20, 2025
account_network.update(self.apiclient, name=account_network.name + ts)
account_network.delete(self.apiclient)
self.cleanup.remove(account_network)
virtual_machine.start(self.apiclient)
Copy link
Contributor

Choose a reason for hiding this comment

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

@Pearl1594 I'm not completely aware of the new behaviour but idea of the test was to do a bunch of operations related to VM, network, volume etc and then check if the events for them have resourceid an resourcetype associated for them. Can we update the test in a way that similar check can be done? With the current change it is checking only for VM action event.

Copy link
Contributor

Choose a reason for hiding this comment

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

I see your point and the point of such tests, but we are not checking for specific events anyway, just listing them. If the test is error prone, not specific and sensitive to environmental issues, I'd rather we simplify it and add more specific checks. Would you agree?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@shwstppr I removed the delete resource operations because it did not matter in terms of the events being generated. As the test doesn't check the type of event being generated for a resource, but rather just checking if events for a resource are generated. And the cleanup is happening via the teardown process.
Regarding the start operation, it was noticed that if a VM is restored - it loses its root disk, hence the test was failing on vmware during the deletion of the vm.

Copy link
Contributor

Choose a reason for hiding this comment

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

@Pearl1594 Your change is correct in itself but I feel now we are verifying lesser set of actions. I would prefer if we can have only the change that fixes restore VM.
Like if earlier we were verifying 20 events, now we might only be doing 5 events.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've reverted the change, to keep only the relevant change to what this PR is attempting to fix. Thanks @shwstppr

account_network.update(self.apiclient, name=account_network.name + ts)
account_network.delete(self.apiclient)
self.cleanup.remove(account_network)
virtual_machine.start(self.apiclient)
Copy link
Contributor

Choose a reason for hiding this comment

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

I see your point and the point of such tests, but we are not checking for specific events anyway, just listing them. If the test is error prone, not specific and sensitive to environmental issues, I'd rather we simplify it and add more specific checks. Would you agree?

Copy link
Contributor

@DaanHoogland DaanHoogland left a comment

Choose a reason for hiding this comment

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

clgtm

@Pearl1594
Copy link
Contributor Author

@blueorangutan package

@blueorangutan
Copy link

@Pearl1594 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.

@Pearl1594
Copy link
Contributor Author

@blueorangutan package

@blueorangutan
Copy link

@Pearl1594 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.

Copy link
Contributor

@shwstppr shwstppr left a comment

Choose a reason for hiding this comment

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

code lgtm

@blueorangutan
Copy link

Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 12983

Copy link

sonarqubecloud bot commented Apr 8, 2025

@blueorangutan
Copy link

Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 12984

@Pearl1594
Copy link
Contributor Author

@blueorangutan test

@blueorangutan
Copy link

@Pearl1594 a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests

@blueorangutan
Copy link

[SF] Trillian test result (tid-12909)
Environment: kvm-ol8 (x2), Advanced Networking with Mgmt server ol8
Total time taken: 108486 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr10583-t12909-kvm-ol8.zip
Smoke tests completed. 109 look OK, 24 have errors, 0 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File
test_01_events_resource Error 411.18 test_events_resource.py
ContextSuite context=TestDeployVMFromISOWithUefi>:setup Error 0.00 test_deploy_vm_iso_uefi.py
ContextSuite context=TestDeployVMsInParallel>:setup Error 0.00 test_deploy_vms_in_parallel.py
ContextSuite context=TestDeployVmWithUserData>:setup Error 0.00 test_deploy_vm_with_userdata.py
test_nic_secondaryip_add_remove Error 1518.27 test_multipleips_per_nic.py
ContextSuite context=TestNestedVirtualization>:setup Error 0.00 test_nested_virtualization.py
ContextSuite context=TestNetworkACL>:setup Error 0.00 test_network_acl.py
ContextSuite context=TestIpv6Network>:setup Error 0.00 test_network_ipv6.py
test_delete_account Error 1518.48 test_network.py
test_delete_network_while_vm_on_it Error 1.20 test_network.py
test_deploy_vm_l2network Error 1.21 test_network.py
test_l2network_restart Error 2.33 test_network.py
ContextSuite context=TestPortForwarding>:setup Error 3.57 test_network.py
ContextSuite context=TestPublicIP>:setup Error 7.07 test_network.py
test_reboot_router Failure 0.08 test_network.py
test_releaseIP Error 3.48 test_network.py
test_releaseIP_using_IP Error 3.75 test_network.py
ContextSuite context=TestRouterRules>:setup Error 3.88 test_network.py
ContextSuite context=TestAdapterTypeForNic>:setup Error 0.00 test_nic_adapter_type.py
ContextSuite context=TestIsolatedNetworksPasswdServer>:setup Error 0.00 test_password_server.py
ContextSuite context=TestPrivateGwACL>:setup Error 0.00 test_privategw_acl.py
ContextSuite context=TestPortForwardingRules>:setup Error 0.00 test_portforwardingrules.py
ContextSuite context=TestProjectSuspendActivate>:setup Error 1528.51 test_projects.py
test_CRUD_operations_userdata Error 1520.86 test_register_userdata.py
test_deploy_vm_with_registered_userdata Error 5.61 test_register_userdata.py
test_deploy_vm_with_registered_userdata_with_override_policy_allow Error 5.70 test_register_userdata.py
test_deploy_vm_with_registered_userdata_with_override_policy_append Error 5.62 test_register_userdata.py
test_deploy_vm_with_registered_userdata_with_override_policy_deny Error 5.93 test_register_userdata.py
test_deploy_vm_with_registered_userdata_with_params Error 5.62 test_register_userdata.py
test_link_and_unlink_userdata_to_template Error 5.47 test_register_userdata.py
test_user_userdata_crud Error 5.64 test_register_userdata.py
ContextSuite context=TestISOUsage>:setup Error 0.00 test_usage.py
test_01_snapshot_usage Error 24.89 test_usage.py
test_01_template_usage Error 1.20 test_usage.py
test_01_volume_usage Error 126.86 test_usage.py
ContextSuite context=TestDeployVM>:setup Error 0.00 test_vm_life_cycle.py
test_01_migrate_VM_and_root_volume Error 1.50 test_vm_life_cycle.py
test_02_migrate_VM_with_two_data_disks Error 1.36 test_vm_life_cycle.py
test_01_secure_vm_migration Error 318.43 test_vm_life_cycle.py
test_02_unsecure_vm_migration Error 462.96 test_vm_life_cycle.py
test_03_secured_to_nonsecured_vm_migration Error 390.28 test_vm_life_cycle.py
test_10_attachAndDetach_iso Failure 1516.07 test_vm_life_cycle.py
test_04_deploy_vnf_appliance Error 312.10 test_vnf_templates.py
test_06_download_detached_volume Error 304.71 test_volumes.py
test_13_migrate_volume_and_change_offering Error 126.32 test_volumes.py
ContextSuite context=TestVPCRedundancy>:setup Error 0.00 test_vpc_redundant.py
ContextSuite context=TestVPCNics>:setup Error 0.00 test_vpc_router_nics.py
ContextSuite context=TestRVPCSite2SiteVpn>:setup Error 0.00 test_vpc_vpn.py
ContextSuite context=TestVPCSite2SiteVPNMultipleOptions>:setup Error 0.00 test_vpc_vpn.py
ContextSuite context=TestVpcRemoteAccessVpn>:setup Error 0.00 test_vpc_vpn.py
ContextSuite context=TestVpcSite2SiteVpn>:setup Error 0.00 test_vpc_vpn.py
test_02_cancel_host_maintenace_with_migration_jobs Error 1.69 test_host_maintenance.py
test_03_cancel_host_maintenace_with_migration_jobs_failure Error 1.77 test_host_maintenance.py
test_01_cancel_host_maintenance_ssh_enabled_agent_connected Failure 15.71 test_host_maintenance.py
test_03_cancel_host_maintenance_ssh_disabled_agent_connected Failure 18.76 test_host_maintenance.py
test_04_cancel_host_maintenance_ssh_disabled_agent_disconnected Failure 32.47 test_host_maintenance.py
ContextSuite context=TestHostMaintenanceAgents>:teardown Error 33.62 test_host_maintenance.py
test_disable_oobm_ha_state_ineligible Error 1518.36 test_hostha_kvm.py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

5 participants