diff -ru original/runner.go bogo/runner.go
@@ -83,6 +83,14 @@
// like “SSL_ERROR_NO_CYPHER_OVERLAP”.
ErrorMap map[string]string
+ // TestErrorMap maps from full test names to the correct error
+ // string for the shim in question.
+ TestErrorMap map[string]string
+
+ // TestLocalErrorMap maps from full test names to the correct local
+ // error string for the shim in question.
+ TestLocalErrorMap map[string]string
+
// HalfRTTTickets is the number of half-RTT tickets the client should
// expect before half-RTT data when testing 0-RTT.
HalfRTTTickets int
@@ -939,7 +947,11 @@
}
}
-func translateExpectedError(errorStr string) string {
+func translateExpectedError(testName string, errorStr string) string {
+ if translated, ok := shimConfig.TestErrorMap[testName]; ok {
+ return translated
+ }
+
if translated, ok := shimConfig.ErrorMap[errorStr]; ok {
return translated
}
@@ -951,6 +963,14 @@
return errorStr
}
+func translateExpectedLocalError(testName string, localError string) string {
+ if translated, ok := shimConfig.TestLocalErrorMap[testName]; ok {
+ return translated
+ }
+
+ return localError
+}
+
func runTest(test *testCase, shimPath string, mallocNumToFail int64) error {
// Help debugging panics on the Go side.
defer func() {
@@ -1215,15 +1235,16 @@
}
failed := err != nil || childErr != nil
- expectedError := translateExpectedError(test.expectedError)
+ expectedError := translateExpectedError(test.name, test.expectedError)
correctFailure := len(expectedError) == 0 || strings.Contains(stderr, expectedError)
+ var expectedLocalError = translateExpectedLocalError(test.name, test.expectedLocalError)
localError := "none"
if err != nil {
localError = err.Error()
}
- if len(test.expectedLocalError) != 0 {
- correctFailure = correctFailure && strings.Contains(localError, test.expectedLocalError)
+ if len(expectedLocalError) != 0 {
+ correctFailure = correctFailure && strings.Contains(localError, expectedLocalError)
}
if failed != test.shouldFail || failed && !correctFailure || mustFail {