-
Notifications
You must be signed in to change notification settings - Fork 3.1k
info: report configured and discovered CDI devices #28712
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -62,6 +62,37 @@ store.imageStore.number | 1 | |
| done < <(parse_table "$tests") | ||
| } | ||
|
|
||
| @test "podman info - CDI spec dirs and devices" { | ||
| skip_if_remote "--cdi-spec-dir flag is not supported for remote" | ||
|
|
||
| cdi_dir=$PODMAN_TMPDIR/cdi | ||
| mkdir -p "$cdi_dir" | ||
| cat >"$cdi_dir/device.json" <<EOF | ||
| { | ||
| "cdiVersion": "0.3.0", | ||
| "kind": "vendor.com/device", | ||
| "devices": [ | ||
| { | ||
| "name": "myKmsg", | ||
| "containerEdits": { | ||
| "env": ["PODMAN_CDI_INFO_TEST=1"] | ||
| } | ||
| } | ||
| ] | ||
| } | ||
| EOF | ||
|
|
||
| run_podman --cdi-spec-dir "$cdi_dir" info --format=json | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is this not essentially the same test as in e2e except that this one uses --cdi-spec-dir while the e2e one uses the config file? personally I like to avoid test duplication between the two as it just adds unnecessary CI time, our tests are already slow Feels like it would be simpler to just add this into the e2e test?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, this change is probably not strictly required since we're not checking anything other than the json content reported by the info command. My one naive question would be how this is different to the other tests that are also added here? (Happy to remove this if you feel strongly about it though).
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also, I don't think the |
||
| cdi_spec_dirs=$(echo "$output" | jq -r '.host.cdiSpecDirs[]') | ||
| cdi_devices=$(echo "$output" | jq -r '.host.discoveredDevices[] | select(.source == "cdi") | .id') | ||
| assert "$cdi_spec_dirs" =~ "$cdi_dir" "info includes configured CDI spec dir" | ||
| assert "$cdi_devices" =~ "vendor.com/device=myKmsg" "info includes resolved CDI device" | ||
|
|
||
| run_podman --cdi-spec-dir "$cdi_dir" system info --format '{{.Host.CDISpecDirs}} {{.Host.DiscoveredDevices}}' | ||
| assert "$output" =~ "$cdi_dir" "system info includes configured CDI spec dir" | ||
| assert "$output" =~ "vendor.com/device=myKmsg" "system info includes resolved CDI device" | ||
| } | ||
|
|
||
| @test "podman info - confirm desired runtime" { | ||
| if [[ -z "$CI_DESIRED_RUNTIME" ]]; then | ||
| # When running in Cirrus, CI_DESIRED_RUNTIME *must* be defined | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.