Skip to content
Permalink
Browse files
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
  • Loading branch information
Tim Taubert committed Oct 26, 2016
1 parent f3a9299 commit e60e3b251e7a083186b6226fcf14db85323b4e75
@@ -158,6 +158,8 @@ export default async function main() {
collection: "debug"
});

await scheduleFuzzing();

await scheduleTools();

await scheduleLinux("Linux 32 (ARM, debug)", {
@@ -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) {
base = merge(base, {
workerType: "nss-win2012r2",
@@ -22,7 +22,8 @@ function parseOptions(opts) {
}

// 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);

// If the given value is nonsense or "none" default to all platforms.
@@ -101,6 +102,7 @@ function filter(opts) {
let aliases = {
"linux": "linux32",
"linux64-asan": "linux64",
"linux64-fuzz": "linux64",
"linux64-gyp": "linux64",
"win64": "windows2012-64",
"arm": "linux32"
@@ -116,6 +118,8 @@ function filter(opts) {
keep &= coll("arm-opt") || coll("arm-debug");
} else if (platform == "linux64-gyp") {
keep &= coll("gyp");
} else if (platform == "linux64-fuzz") {
keep &= coll("fuzz");
} else {
keep &= coll("opt") || coll("debug");
}
@@ -128,7 +132,8 @@ function filter(opts) {
}

// 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")) ||
(!isDebug && opts.builds.includes("o"));
}
@@ -4,14 +4,14 @@ source $(dirname $0)/tools.sh

if [[ $(id -u) -eq 0 ]]; then
# Drop privileges by re-running this script.
exec su worker $0
exec su worker -c "$0 $*"
fi

# Clone NSPR if needed.
hg_clone https://hg.mozilla.org/projects/nspr nspr default

# Build.
nss/build.sh -g -v
nss/build.sh ${*-"-g -v"}

# Package.
mkdir artifacts
@@ -16,12 +16,7 @@
],
'dependencies': [
'<(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)/cmd/lib/lib.gyp:sectool'
]
}
],
@@ -16,13 +16,8 @@
],
'dependencies': [
'<(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)/lib/util/util.gyp:nssutil',
'<(DEPTH)/cmd/lib/lib.gyp:sectool'
]
}
],
@@ -814,7 +814,7 @@ BL_Unload(void)
char *disableUnload = NULL;
vector = NULL;
disableUnload = PR_GetEnvSecure("NSS_DISABLE_UNLOAD");
if (!disableUnload) {
if (blLib && !disableUnload) {
#ifdef DEBUG
PRStatus status = PR_UnloadLibrary(blLib);
PORT_Assert(PR_SUCCESS == status);
@@ -55,7 +55,8 @@ gtest_start()
GTESTREPORT="$GTESTDIR/report.xml"
PARSED_REPORT="$GTESTDIR/report.parsed"
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"
echo "test output dir: ${GTESTREPORT}"
echo "executing sed to parse the xml report"

0 comments on commit e60e3b2

Please sign in to comment.