Add local patches to bogo

This commit is contained in:
Joseph Birr-Pixton 2016-08-22 23:35:22 +01:00
parent ba348b6113
commit db175df922
3 changed files with 45 additions and 6 deletions

View File

@ -2,12 +2,14 @@
set -e
rm -f runner.tar.gz
wget https://boringssl.googlesource.com/boringssl/+archive/master/ssl/test/runner.tar.gz
mkdir -p bogo
tar -C bogo/ -xzf runner.tar.gz
( cd bogo/ && go test -c )
cd bogo/
tar -xzf ../runner.tar.gz
patch -p1 < ../patches/testerrormap.diff
go test -c
# generate new key and cert, because the one provided is expired :(
( cd bogo/ &&
openssl req -newkey rsa:2048 -x509 -batch -nodes -keyout key.pem -out cert.pem -days 3650 &&
openssl rsa -in key.pem -out key.rsa )
openssl req -newkey rsa:2048 -x509 -batch -nodes -keyout key.pem -out cert.pem -days 3650
openssl rsa -in key.pem -out key.rsa

View File

@ -0,0 +1,36 @@
diff -ru vanilla/runner.go bogo/runner.go
--- vanilla/runner.go 2016-08-17 23:45:12.000000000 +0100
+++ bogo/runner.go 2016-08-22 23:25:37.911319366 +0100
@@ -78,6 +78,10 @@
// “:NO_SHARED_CIPHER:” (a BoringSSL error string) to something
// 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
}
var shimConfig ShimConfiguration
@@ -766,7 +770,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
}
@@ -936,7 +944,7 @@
}
failed := err != nil || childErr != nil
- expectedError := translateExpectedError(test.expectedError)
+ expectedError := translateExpectedError(test.name, test.expectedError)
correctFailure := len(expectedError) == 0 || strings.Contains(stderr, expectedError)
localError := "none"

View File

@ -11,6 +11,7 @@ if [ ! -e bogo/ ] ; then
./fetch-and-build
fi
cd ./bogo && ./bogo.test -shim-path ../../target/debug/examples/bogo_shim \
cd bogo && ./bogo.test -shim-path ../../target/debug/examples/bogo_shim \
-shim-config ../config.json \
-test.parallel 1 -num-workers 1 \
-pipe