Commit e60e3b25 authored by Tim Taubert's avatar Tim Taubert

Bug 1312964 - Add linux64-fuzz to TC and run *Fuzz* gtests r=franziskus

Differential Revision: https://nss-dev.phacility.com/D122

--HG--
extra : amend_source : 997356ad17f255caa646a2498e20ea56f91cf9ea
parent f3a9299b
...@@ -158,6 +158,8 @@ export default async function main() { ...@@ -158,6 +158,8 @@ export default async function main() {
collection: "debug" collection: "debug"
}); });
await scheduleFuzzing();
await scheduleTools(); await scheduleTools();
await scheduleLinux("Linux 32 (ARM, debug)", { await scheduleLinux("Linux 32 (ARM, debug)", {
...@@ -256,6 +258,65 @@ async function scheduleLinux(name, base) { ...@@ -256,6 +258,65 @@ async function scheduleLinux(name, base) {
/*****************************************************************************/ /*****************************************************************************/
async function scheduleFuzzing() {
let base = {
env: {
ASAN_OPTIONS: "allocator_may_return_null=1",
UBSAN_OPTIONS: "print_stacktrace=1",
CC: "clang",
CCC: "clang++",
USE_64: "1"
},
platform: "linux64",
collection: "fuzz",
image: LINUX_IMAGE
};
// Build base definition.
let build_base = merge({
command: [
"/bin/bash",
"-c",
"bin/checkout.sh && " +
"nss/automation/taskcluster/scripts/build_gyp.sh -g -v --fuzz"
],
artifacts: {
public: {
expires: 24 * 7,
type: "directory",
path: "/home/worker/artifacts"
}
},
kind: "build",
symbol: "B"
}, base);
// The task that builds NSPR+NSS.
let task_build = queue.scheduleTask(merge(build_base, {
name: "Linux x64 (debug, fuzz)"
}));
// Schedule tests.
queue.scheduleTask(merge(base, {
parent: task_build,
name: "Gtests",
command: [
"/bin/bash",
"-c",
"bin/checkout.sh && nss/automation/taskcluster/scripts/run_tests.sh"
],
env: {GTESTFILTER: "*Fuzz*"},
symbol: "Gtest",
tests: "gtests",
cycle: "standard",
kind: "test"
}));
return queue.submit();
}
/*****************************************************************************/
async function scheduleWindows(name, base) { async function scheduleWindows(name, base) {
base = merge(base, { base = merge(base, {
workerType: "nss-win2012r2", workerType: "nss-win2012r2",
......
...@@ -22,7 +22,8 @@ function parseOptions(opts) { ...@@ -22,7 +22,8 @@ function parseOptions(opts) {
} }
// Parse platforms. // Parse platforms.
let allPlatforms = ["linux", "linux64", "linux64-asan", "win64", "arm", "linux64-gyp"]; let allPlatforms = ["linux", "linux64", "linux64-asan", "win64", "arm",
"linux64-gyp", "linux64-fuzz"];
let platforms = intersect(opts.platform.split(/\s*,\s*/), allPlatforms); let platforms = intersect(opts.platform.split(/\s*,\s*/), allPlatforms);
// If the given value is nonsense or "none" default to all platforms. // If the given value is nonsense or "none" default to all platforms.
...@@ -101,6 +102,7 @@ function filter(opts) { ...@@ -101,6 +102,7 @@ function filter(opts) {
let aliases = { let aliases = {
"linux": "linux32", "linux": "linux32",
"linux64-asan": "linux64", "linux64-asan": "linux64",
"linux64-fuzz": "linux64",
"linux64-gyp": "linux64", "linux64-gyp": "linux64",
"win64": "windows2012-64", "win64": "windows2012-64",
"arm": "linux32" "arm": "linux32"
...@@ -116,6 +118,8 @@ function filter(opts) { ...@@ -116,6 +118,8 @@ function filter(opts) {
keep &= coll("arm-opt") || coll("arm-debug"); keep &= coll("arm-opt") || coll("arm-debug");
} else if (platform == "linux64-gyp") { } else if (platform == "linux64-gyp") {
keep &= coll("gyp"); keep &= coll("gyp");
} else if (platform == "linux64-fuzz") {
keep &= coll("fuzz");
} else { } else {
keep &= coll("opt") || coll("debug"); keep &= coll("opt") || coll("debug");
} }
...@@ -128,7 +132,8 @@ function filter(opts) { ...@@ -128,7 +132,8 @@ function filter(opts) {
} }
// Finally, filter by build type. // Finally, filter by build type.
let isDebug = coll("debug") || coll("asan") || coll("ubsan") || coll("arm-debug") || coll("gyp"); let isDebug = coll("debug") || coll("asan") || coll("ubsan") ||
coll("arm-debug") || coll("gyp") || coll("fuzz");
return (isDebug && opts.builds.includes("d")) || return (isDebug && opts.builds.includes("d")) ||
(!isDebug && opts.builds.includes("o")); (!isDebug && opts.builds.includes("o"));
} }
......
...@@ -4,14 +4,14 @@ source $(dirname $0)/tools.sh ...@@ -4,14 +4,14 @@ source $(dirname $0)/tools.sh
if [[ $(id -u) -eq 0 ]]; then if [[ $(id -u) -eq 0 ]]; then
# Drop privileges by re-running this script. # Drop privileges by re-running this script.
exec su worker $0 exec su worker -c "$0 $*"
fi fi
# Clone NSPR if needed. # Clone NSPR if needed.
hg_clone https://hg.mozilla.org/projects/nspr nspr default hg_clone https://hg.mozilla.org/projects/nspr nspr default
# Build. # Build.
nss/build.sh -g -v nss/build.sh ${*-"-g -v"}
# Package. # Package.
mkdir artifacts mkdir artifacts
......
...@@ -16,12 +16,7 @@ ...@@ -16,12 +16,7 @@
], ],
'dependencies': [ 'dependencies': [
'<(DEPTH)/exports.gyp:nss_exports', '<(DEPTH)/exports.gyp:nss_exports',
'<(DEPTH)/lib/nss/nss.gyp:nss3',
'<(DEPTH)/lib/util/util.gyp:nssutil3',
'<(DEPTH)/lib/smime/smime.gyp:smime3',
'<(DEPTH)/lib/ssl/ssl.gyp:ssl3',
'<(DEPTH)/external_tests/google_test/google_test.gyp:gtest', '<(DEPTH)/external_tests/google_test/google_test.gyp:gtest',
'<(DEPTH)/cmd/lib/lib.gyp:sectool'
] ]
} }
], ],
......
...@@ -16,13 +16,8 @@ ...@@ -16,13 +16,8 @@
], ],
'dependencies': [ 'dependencies': [
'<(DEPTH)/exports.gyp:nss_exports', '<(DEPTH)/exports.gyp:nss_exports',
'<(DEPTH)/lib/nss/nss.gyp:nss3',
'<(DEPTH)/lib/util/util.gyp:nssutil3',
'<(DEPTH)/lib/smime/smime.gyp:smime3',
'<(DEPTH)/lib/ssl/ssl.gyp:ssl3',
'<(DEPTH)/external_tests/google_test/google_test.gyp:gtest', '<(DEPTH)/external_tests/google_test/google_test.gyp:gtest',
'<(DEPTH)/lib/util/util.gyp:nssutil', '<(DEPTH)/lib/util/util.gyp:nssutil',
'<(DEPTH)/cmd/lib/lib.gyp:sectool'
] ]
} }
], ],
......
...@@ -814,7 +814,7 @@ BL_Unload(void) ...@@ -814,7 +814,7 @@ BL_Unload(void)
char *disableUnload = NULL; char *disableUnload = NULL;
vector = NULL; vector = NULL;
disableUnload = PR_GetEnvSecure("NSS_DISABLE_UNLOAD"); disableUnload = PR_GetEnvSecure("NSS_DISABLE_UNLOAD");
if (!disableUnload) { if (blLib && !disableUnload) {
#ifdef DEBUG #ifdef DEBUG
PRStatus status = PR_UnloadLibrary(blLib); PRStatus status = PR_UnloadLibrary(blLib);
PORT_Assert(PR_SUCCESS == status); PORT_Assert(PR_SUCCESS == status);
......
...@@ -55,7 +55,8 @@ gtest_start() ...@@ -55,7 +55,8 @@ gtest_start()
GTESTREPORT="$GTESTDIR/report.xml" GTESTREPORT="$GTESTDIR/report.xml"
PARSED_REPORT="$GTESTDIR/report.parsed" PARSED_REPORT="$GTESTDIR/report.parsed"
echo "executing $i" echo "executing $i"
${BINDIR}/$i -d "$GTESTDIR" --gtest_output=xml:"${GTESTREPORT}" ${BINDIR}/$i -d "$GTESTDIR" --gtest_output=xml:"${GTESTREPORT}" \
--gtest_filter="${GTESTFILTER-*}"
html_msg $? 0 "$i run successfully" html_msg $? 0 "$i run successfully"
echo "test output dir: ${GTESTREPORT}" echo "test output dir: ${GTESTREPORT}"
echo "executing sed to parse the xml report" echo "executing sed to parse the xml report"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment