(t *testing.T)
| 50 | } |
| 51 | |
| 52 | func TestStorageDirDetectionWithNewVersions(t *testing.T) { |
| 53 | as := assert.New(t) |
| 54 | testDir := t.TempDir() |
| 55 | containerID := "abcd" |
| 56 | randomizedID := "xyz" |
| 57 | randomIDPath := path.Join(testDir, "image/aufs/layerdb/mounts/", containerID) |
| 58 | as.Nil(os.MkdirAll(randomIDPath, os.ModePerm)) |
| 59 | as.Nil(os.WriteFile(path.Join(randomIDPath, "mount-id"), []byte(randomizedID), os.ModePerm)) |
| 60 | rwLayer, err := getRwLayerID(containerID, testDir, "aufs", []int{1, 10, 0}) |
| 61 | as.Nil(err) |
| 62 | as.Equal(rwLayer, randomizedID) |
| 63 | rwLayer, err = getRwLayerID(containerID, testDir, "aufs", []int{1, 10, 0}) |
| 64 | as.Nil(err) |
| 65 | as.Equal(rwLayer, randomizedID) |
| 66 | |
| 67 | } |
| 68 | |
| 69 | func rawMetadataEnvMatch(dockerEnvWhiteList string, cntConfig container.Config) map[string]string { |
| 70 | metadataEnvAllowList := strings.Split(dockerEnvWhiteList, ",") |
nothing calls this directly
no test coverage detected
searching dependent graphs…