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

Implement vpd-tool dump inventory #498

Draft
wants to merge 3 commits into
base: P11_Dev
Choose a base branch
from

Conversation

souvik1914581
Copy link

@souvik1914581 souvik1914581 commented Nov 21, 2024

This commit implements dump inventory functionality in vpd-tool.
Dump inventory option in vpd-tool is used to dump the following
properties of all the FRUs in the inventory JSON, in JSON format
to the console:

- Present property, Pretty Name, Location Code, Sub Model
- SN, PN, CC, FN, DR keywords under VINI record.

Test:

Tested on a rainier2s2u system with two binaries:
1. old vpd-tool copied from another system.
2. vpd-tool is the new binary from this commit

'''
root@valid-hostname:/tmp/sr# ./vpd-tool -i  > ./newInvDump.json

root@valid-hostname:/tmp/sr# ./old-vpd-tool -i > ./oldInvDump.json

Compare both JSON files and see that both have 339 FRU entries with
following properties populated:
- Present property, Pretty Name, Location Code, Sub Model
- SN, PN, CC, FN, DR keywords under VINI record.
'''

newVpdToolDumpInv.json
oldInvDump.json

Screenshot 2024-11-21 at 2 55 48 PM

branupama and others added 2 commits November 20, 2024 03:30
The API reads the keyword’s value for a given DBus object path or
hardware path. Stores the result to user given path if provided
otherwise shows the result on console.

Only read keyword’s value from DBus and printing result on the
console is implemented in this commit.

Test result:
'''
root@p10bmc:/tmp# ./vpd-tool -O /system/chassis/motherboard -R VSYS -K BR -r
{
    "/system/chassis/motherboard": {
        "BR": "S0"
    }
}
'''

Signed-off-by: Anupama B R <[email protected]>
This commit implements object dump functionality in vpd-tool.
For a given Object path, the object dump functionality prints the
following properties in a JSON format to the console:
1. Present property, Pretty Name, Location Code, Sub Model
2. SN, PN, CC, FN, DR keywords under VINI record

Test:
Tested on a rainier2s2u system
'''
root@p10bmc:~# ./vpd-tool -o -O \
/xyz/openbmc_project/inventory/system/chassis/motherboard
[
    {
        "/xyz/openbmc_project/inventory/system/chassis/motherboard": {
            "CC": "2E2D",
            "DR": "SYSTEM BACKPLANE",
            "FN": "02WG676",
            "LocationCode": "U78DA.ND0.WZS0042-P0",
            "PN": "02WG678",
            "Present": "true",
            "PrettyName": "System backplane",
            "SN": "Y131UF07302T"
        }
    }
]

root@p10bmc:~# ./vpd-tool -o -O \
/xyz/openbmc_project/inventory/system/chassis/motherboard/vdd_vrm0
[
    {
        "/xyz/openbmc_project/inventory/
	system/chassis/motherboard/vdd_vrm0": {
            "CC": "2E32",
            "DR": "CPU POWER CARD  ",
            "FN": "02CM285",
            "LocationCode": "U78DA.ND0.WZS0042-P0-C14",
            "PN": "02CM286",
            "Present": "true",
            "PrettyName": "Voltage regulator module for
		system processor module 0",
            "SN": "YH30A005M11C"
        }
    }
]

root@rain104bmctest:~# ./vpd-tool -o -O "InvalidObjectPath"
root@rain104bmctest:~# echo $?
255

'''

Change-Id: I4b44bdb03429f7f3341ca0c79317d616f1de3a4f
Signed-off-by: Souvik Roy <[email protected]>
@souvik1914581 souvik1914581 marked this pull request as draft November 21, 2024 10:26
This commit implements dump inventory functionality in vpd-tool.
Dump inventory option in vpd-tool is used to dump the following
properties of all the FRUs in the inventory JSON, in JSON format
to the console:

- Present property, Pretty Name, Location Code, Sub Model
- SN, PN, CC, FN, DR keywords under VINI record.

Test:

Tested on a rainier2s2u system with two binaries:
1. old vpd-tool copied from another system.
2. vpd-tool is the new binary from this commit

'''
root@valid-hostname:/tmp/sr# ./vpd-tool -i  > ./newInvDump.json

root@valid-hostname:/tmp/sr# ./old-vpd-tool -i > ./oldInvDump.json

Compare both JSON files and see that both have 339 FRU entries with
following properties populated:
- Present property, Pretty Name, Location Code, Sub Model
- SN, PN, CC, FN, DR keywords under VINI record.
'''

Change-Id: I8aa2e3ac89e37b45c3ebc7b1367d18cdce0a11b5
Signed-off-by: Souvik Roy <[email protected]>
@souvik1914581 souvik1914581 changed the title Implement vpd-tool dump inventory. Implement vpd-tool dump inventory Nov 21, 2024
@souvik1914581 souvik1914581 marked this pull request as ready for review November 21, 2024 10:37
@souvik1914581 souvik1914581 marked this pull request as draft November 22, 2024 06:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants