squat / generic-device-plugin

A Kubernetes device plugin to schedule generic Linux devices
Apache License 2.0
208 stars 23 forks source link

deviceplugin: add unit tests for discovery #40

Closed squat closed 1 year ago

squat commented 1 year ago

This commit introduces a fairly significant refactor of the plugin code so that it no longer implicitly depends on the host filesystem but rather on an abstract fs.FS. This enables writing tests that mock out the filesystem to test the discovery of devices. This commit also adds some unit tests for both USB and path-based discovery.

Signed-off-by: Lucas Servén Marín lserven@gmail.com