stx-openstack: Wrong arg passed when sysinv calls query_pci_id script

Bug #2009487 reported by Thales Elero Cervi
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
StarlingX
Fix Released
Low
Thales Elero Cervi

Bug Description

Brief Description
-----------------
The was recent update on the query_pci_id script [1] that works fine, but the sysinv agent call to it is always receiving a return code 2. The arg syntax was wrongly written and needs to be fixed.

[1] https://review.opendev.org/c/starlingx/config/+/872979

Severity
--------
Minor: System/Feature is usable but DPDK support is not correctly verified

Steps to Reproduce
------------------
* Deploy an AIO-SX with vswitch_type=ovs-dpdk
* Check /var/log/sysinv.log for "query_pci_id_cmd" related errors

Expected Behavior
------------------
The script should return 0 for interfaces that support DPDK and 1 otherwise.

Actual Behavior
----------------
The script is returning 2 (due to the wrong argument syntax)

Reproducibility
---------------
Reproducible

System Configuration
--------------------
vswitch_type=ovs-dpdk

Branch/Pull Time/Commit
-----------------------
StarlingX master

Last Pass
---------
* Final CentOS build.

Timestamp/Logs
--------------
>>> query_pci_id_cmd
['query_pci_id', '-v 0x1af4', '-d 0x1000', '--elfbinary /usr/bin/dpdk-testpmd']
>>> subprocess.run(query_pci_id_cmd)
usage: query_pci_id [-h] -v HEX -d HEX [-p PMDINFO] [-e ELF]
query_pci_id: error: unrecognized arguments: --elfbinary /usr/bin/dpdk-testpmd
CompletedProcess(args=['query_pci_id', '-v 0x1af4', '-d 0x1000', '--elfbinary /usr/bin/dpdk-testpmd'], returncode=2)

>>> query_pci_id_cmd
['query_pci_id', '-v 0x1af4', '-d 0x1000', '--elfbinary=/usr/bin/dpdk-testpmd']
>>> subprocess.run(query_pci_id_cmd)
Vendor ID: 0x1af4 Device ID: 0x1000 is supported
CompletedProcess(args=['query_pci_id', '-v 0x1af4', '-d 0x1000', '--elfbinary=/usr/bin/dpdk-testpmd'], returncode=0)

>>> query_pci_id_cmd
['query_pci_id', '-v 0x1af4', '-d 0x1000', '-e /usr/bin/dpdk-testpmd']
>>> subprocess.run(query_pci_id_cmd)
Vendor ID: 0x1af4 Device ID: 0x1000 is supported
CompletedProcess(args=['query_pci_id', '-v 0x1af4', '-d 0x1000', '-e /usr/bin/dpdk-testpmd'], returncode=0)

Test Activity
-------------
Developer Testing

Workaround
----------
None

Changed in starlingx:
assignee: nobody → Thales Elero Cervi (tcervi)
tags: added: stx.distro.openstack
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to config (master)

Fix proposed to branch: master
Review: https://review.opendev.org/c/starlingx/config/+/876577

Changed in starlingx:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to config (master)

Reviewed: https://review.opendev.org/c/starlingx/config/+/876577
Committed: https://opendev.org/starlingx/config/commit/64610b4411fef2ea0a6fdb92e67f71f9ec4ef041
Submitter: "Zuul (22348)"
Branch: master

commit 64610b4411fef2ea0a6fdb92e67f71f9ec4ef041
Author: Thales Elero Cervi <email address hidden>
Date: Fri Mar 3 19:01:51 2023 -0300

    Fix query_pci_id argument syntax

    This change fixes the query_pci_id argument usage for custom ELF files.
    The new argument was added [1] but tested only in isolation for the
    query_pci_id.
    Sysinv Agent is currently using the wrong syntax that needs to be "-e"
    OR "--elfbinary=". Wrong argument usage on this script call will always
    fail for sysinv and return code 2, instead of 0 for interfaces that
    support DPDK or 1 for interfaces that do not support DPDK.

    [1] https://review.opendev.org/c/starlingx/config/+/872979

    TEST PLAN:
    PASS - Build sysinv packages
    PASS - Generate a new StarlingX ISO
    PASS - Deploy an AIO-SX and customize the ELF target
          * For a valid ELF (e.g. /usr/bin/dpdk-testpmd), verify that the
            sysinv call to query_pci_id is no longer receiving return code 2

    Closes-Bug: 2009487

    Signed-off-by: Thales Elero Cervi <email address hidden>
    Change-Id: Iec8c925d728be8d22f72bac3c8141904a051384b

Changed in starlingx:
status: In Progress → Fix Released
Ghada Khalil (gkhalil)
Changed in starlingx:
importance: Undecided → Low
tags: added: stx.9.0
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.