Catch up with error message drift in docker

This commit is contained in:
Sean Chittenden
2016-05-07 15:46:44 -07:00
parent 16b0ad4263
commit 92bad38729

View File

@@ -752,9 +752,20 @@ func TestDockerUser(t *testing.T) {
handle.Kill()
t.Fatalf("Should've failed")
}
msg := "System error: Unable to find user alice"
if !strings.Contains(err.Error(), msg) {
t.Fatalf("Expecting '%v' in '%v'", msg, err)
msgs := []string{
"System error: Unable to find user alice",
"linux spec user: Unable to find user alice",
}
var found bool
for msg := range msgs {
if strings.Contains(err.Error(), msg) {
found = true
break
}
}
if !found {
t.Fatalf("Expected failure string not found, found %q instead", err.Error())
}
}