ListSupportedDrivers prints the driver to stderr in a format that can be consumed by the Makefile to iterate tests across drivers.
(outfile string)
| 228 | // ListSupportedDrivers prints the driver to stderr in a format that can be |
| 229 | // consumed by the Makefile to iterate tests across drivers. |
| 230 | func ListSupportedDrivers(outfile string) error { |
| 231 | out := os.Stdout |
| 232 | if outfile != "" { |
| 233 | f, err := os.OpenFile(outfile, os.O_WRONLY, 0644) |
| 234 | if err != nil { |
| 235 | return fmt.Errorf("failed to open outfile: %w", err) |
| 236 | } |
| 237 | defer f.Close() |
| 238 | out = f |
| 239 | } |
| 240 | |
| 241 | var list []string |
| 242 | nvproxy.ForEachSupportDriver(func(version nvconf.DriverVersion, _ nvproxy.Checksums) { |
| 243 | list = append(list, version.String()) |
| 244 | }) |
| 245 | sort.Strings(list) |
| 246 | if _, err := out.WriteString(strings.Join(list, " ") + "\n"); err != nil { |
| 247 | return fmt.Errorf("failed to write to outfile: %w", err) |
| 248 | } |
| 249 | return nil |
| 250 | } |
| 251 | |
| 252 | // ChecksumDriver downloads and returns the SHA265 checksum of the driver. |
| 253 | func (i *Installer) ChecksumDriver(ctx context.Context, arch string) (string, error) { |
no test coverage detected
searching dependent graphs…