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 1 commit 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 (1b6edf3).

Additional details and impacted files
@@            Coverage Diff            @@
##               4.19   #10583   +/-   ##
=========================================
  Coverage     15.16%   15.16%           
- Complexity    11327    11328    +1     
=========================================
  Files          5414     5414           
  Lines        474814   474814           
  Branches      57912    57912           
=========================================
+ Hits          72004    72021   +17     
+ Misses       394758   394738   -20     
- Partials       8052     8055    +3     
Flag Coverage Δ
uitests 4.28% <ø> (ø)
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
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?

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?

Comment on lines +736 to +740
#22. Start VM before destroying, to recreate ROOT volume that was deleted as part of restore operation
command = """self.virtual_machine.start({apiclient})"""
self.exec_command("self.user_apiclient", command, expected=False)
self.exec_command("self.otheruser_apiclient", command, expected=True)

Copy link
Contributor

Choose a reason for hiding this comment

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

a second step number 22 ! would it make sense to split this test? It already has 26 steps , adn I see some doing double work as well.
Is this creating extra value to our testing?

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