(t *testing.T)
| 77 | } |
| 78 | |
| 79 | func TestIdMap(t *testing.T) { |
| 80 | idMap := map[string]uint32{"test": 199} |
| 81 | |
| 82 | var uid interface{} = "test" |
| 83 | var gid interface{} = 76 |
| 84 | |
| 85 | yaml := Image{ |
| 86 | Name: "test", |
| 87 | Image: "testimage", |
| 88 | ImageConfig: ImageConfig{ |
| 89 | UID: &uid, |
| 90 | GID: &gid, |
| 91 | }, |
| 92 | } |
| 93 | |
| 94 | var label = ImageConfig{} |
| 95 | |
| 96 | inspect := setupInspect(t, label) |
| 97 | |
| 98 | oci, _, err := ConfigToOCI(&yaml, inspect, idMap) |
| 99 | if err != nil { |
| 100 | t.Error(err) |
| 101 | } |
| 102 | |
| 103 | if oci.Process.User.UID != 199 { |
| 104 | t.Error("Expected named uid to work") |
| 105 | } |
| 106 | if oci.Process.User.GID != 76 { |
| 107 | t.Error("Expected numerical gid to work") |
| 108 | } |
| 109 | } |
nothing calls this directly
no test coverage detected