(t *testing.T)
| 272 | } |
| 273 | |
| 274 | func (c cacheTests) testMultipleArch(t *testing.T) { |
| 275 | tempDir, tempcleanup := e2e.MakeTempDir(t, "", "", "sif build") |
| 276 | defer tempcleanup(t) |
| 277 | |
| 278 | cacheDir, cleanup := e2e.MakeCacheDir(t, "") |
| 279 | defer cleanup(t) |
| 280 | _, err := cache.New(cache.Config{ParentDir: cacheDir}) |
| 281 | if err != nil { |
| 282 | t.Fatalf("Could not create image cache handle: %v", err) |
| 283 | } |
| 284 | c.env.UnprivCacheDir = cacheDir |
| 285 | |
| 286 | c.env.RunApptainer( |
| 287 | t, |
| 288 | e2e.AsSubtest("list cache"), |
| 289 | e2e.WithProfile(e2e.UserProfile), |
| 290 | e2e.WithCommand("cache"), |
| 291 | e2e.WithArgs([]string{"list", "all"}...), |
| 292 | e2e.ExpectExit(0), |
| 293 | ) |
| 294 | |
| 295 | shamap := map[string]string{ |
| 296 | "arm64": "ee74dfacff0fba9ec53b5f48dca94b1716b4e176425cb174fb1b58e973746ef8", |
| 297 | "arm64v8": "b118e86313b8da65a597ae0f773fb7cac49fac8e6666147a9443b172288c5306", |
| 298 | "amd64": "f38acf33dd020a91d4673e16c6ab14048b00a5fd83e334edd8b33d339103cf83", |
| 299 | "arm32v6": "9fe584fc821b9ceaf4e04cd21ed191dfa553517728da94e3f50632523b3ab374", |
| 300 | "amd64uri": "82e895f183a2f926f72ad8d28c3c36444ce37de4f9e1efeba35f4ed1643232d6", |
| 301 | "arm64v8uri": "a101aa43bebd5f853837120fc8f28cae7ebe1c5f7f14a4d51a8c6d275f1456a9", |
| 302 | } |
| 303 | |
| 304 | files := retrieveFileNames(t, cacheDir) |
| 305 | if len(files) != 0 { |
| 306 | t.Fatalf("Unexpected cache files: %v", files) |
| 307 | } |
| 308 | |
| 309 | sifname := fmt.Sprintf("%s/build.sif", tempDir) |
| 310 | |
| 311 | // ko cases |
| 312 | c.env.RunApptainer( |
| 313 | t, |
| 314 | e2e.AsSubtest("pull image failure because of wrong --arch"), |
| 315 | e2e.WithProfile(e2e.UserProfile), |
| 316 | e2e.WithCommand("pull"), |
| 317 | e2e.WithArgs([]string{"--force", "--arch", "amd", sifname, "docker://alpine:3.6"}...), |
| 318 | e2e.ExpectExit(255, e2e.ExpectError(e2e.ContainMatch, "arch: amd is not valid")), |
| 319 | ) |
| 320 | |
| 321 | c.env.RunApptainer( |
| 322 | t, |
| 323 | e2e.AsSubtest("pull image failure because of wrong --arch-variant"), |
| 324 | e2e.WithProfile(e2e.UserProfile), |
| 325 | e2e.WithCommand("pull"), |
| 326 | e2e.WithArgs([]string{"--force", "--arch", "arm64", "--arch-variant", "v9", sifname, "docker://alpine:3.6"}...), |
| 327 | e2e.ExpectExit(255, e2e.ExpectError(e2e.ContainMatch, "arch: arm64v9 is not valid")), |
| 328 | ) |
| 329 | |
| 330 | // ok cases |
| 331 | c.env.RunApptainer( |
nothing calls this directly
no test coverage detected