Closes #9311 Handles container id/name collisions against daemon functionalities according to #8069

Signed-off-by: Andrew C. Bodine <acbodine@us.ibm.com>
This commit is contained in:
Andrew C. Bodine 2014-12-16 15:06:35 -08:00
parent feb02197c1
commit 2da8e34079
2 changed files with 15 additions and 12 deletions

View file

@ -59,6 +59,11 @@ func TestTruncIndex(t *testing.T) {
assertIndexGet(t, index, id[:4], "", true)
assertIndexGet(t, index, id[:1], "", true)
// An ambiguous id prefix should return an error
if _, err := index.Get(id[:4]); err == nil || err == nil {
t.Fatal("An ambiguous id prefix should return an error")
}
// 7 characters should NOT conflict
assertIndexGet(t, index, id[:7], id, false)
assertIndexGet(t, index, id2[:7], id2, false)