Skip to content

Conversation

DaanHoogland
Copy link
Contributor

ERROR: test suite for <class 'tests.component.maint.test_primary_storage_nfsmountopts_kvm.TestNFSMountOptsKVM'>
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/nose/suite.py", line 210, in run
    self.setUp()
  File "/usr/local/lib/python3.9/site-packages/nose/suite.py", line 293, in setUp
    self.setupContext(ancestor)
  File "/usr/local/lib/python3.9/site-packages/nose/suite.py", line 316, in setupContext
    try_run(context, names)
  File "/usr/local/lib/python3.9/site-packages/nose/util.py", line 471, in try_run
    return func()
  File "/marvin/tests/component/maint/test_primary_storage_nfsmountopts_kvm.py", line 46, in setUpClass
    cls.version = cls.getNFSMountOptionForPool(cls, "vers", cls.storage_pool.id)
  File "/marvin/tests/component/maint/test_primary_storage_nfsmountopts_kvm.py", line 115, in getNFSMountOptionForPool
    stat = nfsstat[0]
IndexError: list index out of range

because

shClient: DEBUG: {Cmd: nfsstat -m | sed -n '/e08df33d-d187-3c1c-88f4-10c69669f41a/{ n; p }' via Host: 10.0.32.210} {returns: []}

Description

This PR fixes a component test error

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

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?

```
ERROR: test suite for <class 'tests.component.maint.test_primary_storage_nfsmountopts_kvm.TestNFSMountOptsKVM'>
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/nose/suite.py", line 210, in run
    self.setUp()
  File "/usr/local/lib/python3.9/site-packages/nose/suite.py", line 293, in setUp
    self.setupContext(ancestor)
  File "/usr/local/lib/python3.9/site-packages/nose/suite.py", line 316, in setupContext
    try_run(context, names)
  File "/usr/local/lib/python3.9/site-packages/nose/util.py", line 471, in try_run
    return func()
  File "/marvin/tests/component/maint/test_primary_storage_nfsmountopts_kvm.py", line 46, in setUpClass
    cls.version = cls.getNFSMountOptionForPool(cls, "vers", cls.storage_pool.id)
  File "/marvin/tests/component/maint/test_primary_storage_nfsmountopts_kvm.py", line 115, in getNFSMountOptionForPool
    stat = nfsstat[0]
IndexError: list index out of range
```

because 

```
shClient: DEBUG: {Cmd: nfsstat -m | sed -n '/e08df33d-d187-3c1c-88f4-10c69669f41a/{ n; p }' via Host: 10.0.32.210} {returns: []}
```
@boring-cyborg boring-cyborg bot added component:integration-test Python Warning... Python code Ahead! labels Oct 14, 2025
Copy link

codecov bot commented Oct 14, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 17.54%. Comparing base (046014b) to head (f2f3f71).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main   #11839      +/-   ##
============================================
- Coverage     17.55%   17.54%   -0.01%     
- Complexity    15526    15548      +22     
============================================
  Files          5908     5908              
  Lines        528696   529921    +1225     
  Branches      64569    65087     +518     
============================================
+ Hits          92801    92974     +173     
- Misses       425457   426494    +1037     
- Partials      10438    10453      +15     
Flag Coverage Δ
uitests 3.57% <ø> (-0.02%) ⬇️
unittests 18.61% <ø> (-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.

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes an IndexError in the NFS mount options test by adding a length check for empty command output. The error occurred when the nfsstat -m command returned an empty list, causing an index out of range exception when trying to access nfsstat[0].

Key Changes:

  • Enhanced the condition check to handle empty lists from SSH command execution
  • Prevents IndexError when accessing the first element of an empty list

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copy link
Collaborator

@abh1sar abh1sar left a comment

Choose a reason for hiding this comment

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

LGTM

@abh1sar
Copy link
Collaborator

abh1sar commented Oct 15, 2025

@blueorangutan package

@blueorangutan
Copy link

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

@abh1sar
Copy link
Collaborator

abh1sar commented Oct 15, 2025

Lots of clunky bits in this file. I'll raise a separate PR to improve the test later.

Copy link

@blueorangutan
Copy link

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

@abh1sar
Copy link
Collaborator

abh1sar commented Oct 16, 2025

@blueorangutan test

@blueorangutan
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component:integration-test Python Warning... Python code Ahead!

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants