(t *testing.T)
| 670 | } |
| 671 | |
| 672 | func TestRunDeviceCDI(t *testing.T) { |
| 673 | t.Parallel() |
| 674 | // Although CDI injection is supported by Docker, specifying the --cdi-spec-dirs on the command line is not. |
| 675 | testutil.DockerIncompatible(t) |
| 676 | cdiSpecDir := filepath.Join(t.TempDir(), "cdi") |
| 677 | const testCDIVendor1 = ` |
| 678 | cdiVersion: "0.3.0" |
| 679 | kind: "vendor1.com/device" |
| 680 | devices: |
| 681 | - name: foo |
| 682 | containerEdits: |
| 683 | env: |
| 684 | - FOO=injected |
| 685 | ` |
| 686 | writeTestCDISpec(t, testCDIVendor1, "vendor1.yaml", cdiSpecDir) |
| 687 | |
| 688 | base := testutil.NewBase(t) |
| 689 | base.Cmd("--cdi-spec-dirs", cdiSpecDir, "run", |
| 690 | "--rm", |
| 691 | "--device", "vendor1.com/device=foo", |
| 692 | testutil.AlpineImage, "env", |
| 693 | ).AssertOutContains("FOO=injected") |
| 694 | } |
| 695 | |
| 696 | func TestRunDeviceCDIWithNerdctlConfig(t *testing.T) { |
| 697 | t.Parallel() |
nothing calls this directly
no test coverage detected
searching dependent graphs…