|
100 | 100 | fi |
101 | 101 | ` |
102 | 102 |
|
| 103 | + nvidiaCdiRefreshOrderingDropInInstalledTemplate = ` |
| 104 | + if [ ! -f /lib/systemd/system/nvidia-cdi-refresh.service.d/10-container-engines.conf ]; then |
| 105 | + echo "10-container-engines.conf is not installed" |
| 106 | + exit 1 |
| 107 | + fi |
| 108 | + if ! systemctl show nvidia-cdi-refresh.service -p Before | grep -q docker.service; then |
| 109 | + echo "nvidia-cdi-refresh.service is not ordered before docker.service" |
| 110 | + exit 1 |
| 111 | + fi |
| 112 | + ` |
| 113 | + |
103 | 114 | nvidiaCdiRefreshFileExistsTemplate = ` |
104 | 115 | # is /var/run/cdi/nvidia.yaml exists? and exit with 0 if it does not exist |
105 | 116 | if [ ! -f /var/run/cdi/nvidia.yaml ]; then |
@@ -221,6 +232,11 @@ var _ = Describe("nvidia-cdi-refresh", Ordered, ContinueOnFailure, Label("system |
221 | 232 | Expect(err).ToNot(HaveOccurred()) |
222 | 233 | }) |
223 | 234 |
|
| 235 | + It("should install the container engine ordering drop-in", func(ctx context.Context) { |
| 236 | + _, _, err := systemdRunner.Run(nvidiaCdiRefreshOrderingDropInInstalledTemplate) |
| 237 | + Expect(err).ToNot(HaveOccurred()) |
| 238 | + }) |
| 239 | + |
224 | 240 | It("should generate the nvidia.yaml file", func(ctx context.Context) { |
225 | 241 | _, _, err := systemdRunner.Run(nvidiaCdiRefreshFileExistsTemplate) |
226 | 242 | Expect(err).ToNot(HaveOccurred()) |
@@ -275,6 +291,11 @@ var _ = Describe("nvidia-cdi-refresh", Ordered, ContinueOnFailure, Label("system |
275 | 291 | Expect(err).ToNot(HaveOccurred()) |
276 | 292 | }) |
277 | 293 |
|
| 294 | + It("should install the container engine ordering drop-in", func(ctx context.Context) { |
| 295 | + _, _, err := systemdRunner.Run(nvidiaCdiRefreshOrderingDropInInstalledTemplate) |
| 296 | + Expect(err).ToNot(HaveOccurred()) |
| 297 | + }) |
| 298 | + |
278 | 299 | It("should generate the nvidia.yaml file", func(ctx context.Context) { |
279 | 300 | _, _, err := systemdRunner.Run(nvidiaCdiRefreshFileExistsTemplate) |
280 | 301 | Expect(err).ToNot(HaveOccurred()) |
|
0 commit comments