Skip to content

marvin,test: fix directdownload template checksum test - #8096

Merged
weizhouapache merged 2 commits into
apache:4.18from
shapeblue:fix-test-template
Oct 19, 2023
Merged

marvin,test: fix directdownload template checksum test#8096
weizhouapache merged 2 commits into
apache:4.18from
shapeblue:fix-test-template

Conversation

@shwstppr

@shwstpprshwstppr commented Oct 14, 2023

Copy link
Copy Markdown
Contributor

Description

During failure while deploying a VM with the wrong checksum template, VM may be left in Error state. This PR adds code to delete such VM. Before wrong checksum test was not running correctly as the checksum parameter was not even passed while registering the template.

Fixes failures reported in #7345 (comment)

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

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?

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

During failure while deploying a VM with wrong checksum template, VM may be left in Error state. This PR adds code to delete such VM.
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
@shwstppr

Copy link
Copy Markdown
ContributorAuthor

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@shwstppr a [SF] 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
Copy Markdown

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

@codecov

codecovBot commented Oct 14, 2023

Copy link
Copy Markdown

Codecov Report

Merging #8096 (60f00d1) into 4.18 (3e7f21a) will increase coverage by 0.00%.
Report is 1 commits behind head on 4.18.
The diff coverage is n/a.

@@ Coverage Diff @@## 4.18 #8096 +/- ##
=========================================
Coverage 13.06% 13.07% - Complexity 9109 9110 +1 
=========================================
Files 2720 2720 Lines 257526 257526 Branches 40150 40150 =========================================
+ Hits 33655 33661 +6 + Misses 219644 219636 -8 - Partials 4227 4229 +2 

see 1 file with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@shwstppr

Copy link
Copy Markdown
ContributorAuthor

@blueorangutan test

@blueorangutan

Copy link
Copy Markdown

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

@blueorangutan

Copy link
Copy Markdown

[SF] Trillian test result (tid-7974)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 41257 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr8096-t7974-kvm-centos7.zip
Smoke tests completed. 107 look OK, 1 have errors, 0 did not run
Only failed and skipped tests results shown below:

TestResultTime (s)Test File
test_08_upgrade_kubernetes_ha_clusterFailure683.99test_kubernetes_clusters.py

@yadvryadvr left a comment

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.

LGTM - need to check smoketests

@yadvr

Copy link
Copy Markdown
Member

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@rohityadavcloud a [SF] 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.

@yadvryadvr added this to the 4.18.2.0 milestone Oct 16, 2023
@shwstpprshwstppr mentioned this pull request Oct 16, 2023
13 tasks
@blueorangutan

Copy link
Copy Markdown

Packaging result [SF]: ✖️ el7 ✖️ el8 ✖️ el9 ✖️ debian ✖️ suse15. SL-JID 7374

@shwstppr

Copy link
Copy Markdown
ContributorAuthor

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@shwstppr a [SF] 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
Copy Markdown

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

@DaanHoogland

Copy link
Copy Markdown
Contributor

@blueorangutan test

@blueorangutan

Copy link
Copy Markdown

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

Comment on lines +1341 to +1343
if type(list_virtual_machine_response) == list and len(list_virtual_machine_response) > 0:
for virtual_machine_response in list_virtual_machine_response:
VirtualMachine.delete(virtual_machine_response, self.apiclient, expunge=True)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

So if we succeed we added virtual_machine to self.cleanup.
If we fail we get here and are now deleting it by template_id.

it feels flacky but should work.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

If VM is deployed fine then we add virtual_machine to self.cleanup. Test failed in this situation as VM shouldn't be deployed with wrong checksum of the template.

If VM deployment failed then we delete VMs using template_id because though the API returned error VM entry can still be there in the Error state. I wanted to use self.cleanup.append(VirtualMachine(virtual_machine_response.__dict__) but it wasn't working for me.

@shwstpprshwstppr mentioned this pull request Oct 17, 2023
13 tasks
@yadvr

Copy link
Copy Markdown
Member

@blueorangutan test

@blueorangutan

Copy link
Copy Markdown

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

@weizhouapacheweizhouapache left a comment

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.

code lgtm

@shwstppr

Copy link
Copy Markdown
ContributorAuthor

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@shwstppr 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
Copy Markdown

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

@shwstppr

Copy link
Copy Markdown
ContributorAuthor

@blueorangutan test

@blueorangutan

Copy link
Copy Markdown

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

@blueorangutan

Copy link
Copy Markdown

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

TestResultTime (s)Test File

@weizhouapache
weizhouapache merged commit a2ec1f3 into apache:4.18Oct 19, 2023
@DaanHoogland
DaanHoogland deleted the fix-test-template branch October 20, 2023 07:19
shwstppr added a commit to shapeblue/cloudstack that referenced this pull request Dec 27, 2023
* marvin,test: fix directdownload template checksum test
During failure while deploying a VM with wrong checksum template, VM may be left in Error state. This PR adds code to delete such VM.
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
* remove unnecessary logs
---------
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
(cherry picked from commit a2ec1f3)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@shwstppr@blueorangutan@yadvr@DaanHoogland@weizhouapache