From 55e142efcd990fb68428603bcbb76e0871d8cafd Mon Sep 17 00:00:00 2001 From: MistyBlunch Date: Fri, 21 Jun 2019 17:03:44 -0500 Subject: [PATCH 1/3] test: change order of arguments --- test/parallel/test-buffer-indexof.js | 2 +- tools/macos-firewall.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/parallel/test-buffer-indexof.js b/test/parallel/test-buffer-indexof.js index 3f0449ceb084f1..44787d73aab298 100644 --- a/test/parallel/test-buffer-indexof.js +++ b/test/parallel/test-buffer-indexof.js @@ -236,7 +236,7 @@ assert.strictEqual(mixedByteStringUtf8.indexOf('bc'), 5); assert.strictEqual(mixedByteStringUtf8.indexOf('bc', 5), 5); assert.strictEqual(mixedByteStringUtf8.indexOf('bc', -8), 5); assert.strictEqual(mixedByteStringUtf8.indexOf('\u03a3'), 7); -assert.strictEqual(-1, mixedByteStringUtf8.indexOf('\u0396')); +assert.strictEqual(mixedByteStringUtf8.indexOf('\u0396'), -1); // Test complex string indexOf algorithms. Only trigger for long strings. diff --git a/tools/macos-firewall.sh b/tools/macos-firewall.sh index 4079dc4d790f5a..8669ab6385cf66 100755 --- a/tools/macos-firewall.sh +++ b/tools/macos-firewall.sh @@ -53,4 +53,4 @@ then $SFW --unblock "$OPENSSL_CLI_RELEASE" else echo "SocketFirewall not found in location: $SFW" -fi +fi \ No newline at end of file From 194fda110e4746eb8f9863c2e3b918211efcfa73 Mon Sep 17 00:00:00 2001 From: MistyBlunch Date: Fri, 21 Jun 2019 17:32:56 -0500 Subject: [PATCH 2/3] change the macos-firewall.sh --- tools/macos-firewall.sh | 64 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 63 insertions(+), 1 deletion(-) diff --git a/tools/macos-firewall.sh b/tools/macos-firewall.sh index 8669ab6385cf66..ff68b12d79b4df 100755 --- a/tools/macos-firewall.sh +++ b/tools/macos-firewall.sh @@ -3,7 +3,69 @@ # popups asking to accept incoming network connections when # running tests. SFW="/usr/libexec/ApplicationFirewall/socketfilterfw" +TOOLSDIR="`dirname \"$0\"`"cript that adds rules to Mac OS X Socket Firewall to avoid +3 +# popups asking to accept incoming network connections when +4 +# running tests. +5 +SFW="/usr/libexec/ApplicationFirewall/socketfilterfw" +6 TOOLSDIR="`dirname \"$0\"`" +7 +TOOLSDIR="`( cd \"$TOOLSDIR\" && pwd) `" +8 +ROOTDIR="`( cd \"$TOOLSDIR/..\" && pwd) `" +9 +OUTDIR="$TOOLSDIR/../out" +10 +# Using cd and pwd here so that the path used for socketfilterfw does not +11 +# contain a '..', which seems to cause the rules to be incorrectly added +12 +# and they are not removed when this script is re-run. Instead the new +13 +# rules are simply appended. By using pwd we can get the full path +14 +# without '..' and things work as expected. +15 +OUTDIR="`( cd \"$OUTDIR\" && pwd) `" +16 +NODE_RELEASE="$OUTDIR/Release/node" +17 +NODE_DEBUG="$OUTDIR/Debug/node" +18 +NODE_LINK="$ROOTDIR/node" +19 +CCTEST_RELEASE="$OUTDIR/Release/cctest" +20 +CCTEST_DEBUG="$OUTDIR/Debug/cctest" +21 +OPENSSL_CLI_RELEASE="$OUTDIR/Release/openssl-cli" +22 +OPENSSL_CLI_DEBUG="$OUTDIR/Debug/openssl-cli" +23 +​ +24 +if [ -f $SFW ]; +25 +then +26 + # Duplicating these commands on purpose as the symbolic link node might be +27 + # linked to either out/Debug/node or out/Release/node depending on the +28 + # BUILDTYPE. +29 + $SFW --remove "$NODE_DEBUG" +30 + $SFW --remove "$NODE_DEBUG" +31 + $SFW --remove "$NODE_RELEASE" +32 + $SFW --remove "$NODE_RELEASE" +33 + $SFW --remove "$NODE_LINK" TOOLSDIR="`( cd \"$TOOLSDIR\" && pwd) `" ROOTDIR="`( cd \"$TOOLSDIR/..\" && pwd) `" OUTDIR="$TOOLSDIR/../out" @@ -53,4 +115,4 @@ then $SFW --unblock "$OPENSSL_CLI_RELEASE" else echo "SocketFirewall not found in location: $SFW" -fi \ No newline at end of file +fi From e87cfa3c14b2e13cdc3bcb4b8806e86b6f15cc71 Mon Sep 17 00:00:00 2001 From: MistyBlunch Date: Fri, 21 Jun 2019 17:37:28 -0500 Subject: [PATCH 3/3] fix all --- tools/macos-firewall.sh | 62 ----------------------------------------- 1 file changed, 62 deletions(-) diff --git a/tools/macos-firewall.sh b/tools/macos-firewall.sh index ff68b12d79b4df..4079dc4d790f5a 100755 --- a/tools/macos-firewall.sh +++ b/tools/macos-firewall.sh @@ -3,69 +3,7 @@ # popups asking to accept incoming network connections when # running tests. SFW="/usr/libexec/ApplicationFirewall/socketfilterfw" -TOOLSDIR="`dirname \"$0\"`"cript that adds rules to Mac OS X Socket Firewall to avoid -3 -# popups asking to accept incoming network connections when -4 -# running tests. -5 -SFW="/usr/libexec/ApplicationFirewall/socketfilterfw" -6 TOOLSDIR="`dirname \"$0\"`" -7 -TOOLSDIR="`( cd \"$TOOLSDIR\" && pwd) `" -8 -ROOTDIR="`( cd \"$TOOLSDIR/..\" && pwd) `" -9 -OUTDIR="$TOOLSDIR/../out" -10 -# Using cd and pwd here so that the path used for socketfilterfw does not -11 -# contain a '..', which seems to cause the rules to be incorrectly added -12 -# and they are not removed when this script is re-run. Instead the new -13 -# rules are simply appended. By using pwd we can get the full path -14 -# without '..' and things work as expected. -15 -OUTDIR="`( cd \"$OUTDIR\" && pwd) `" -16 -NODE_RELEASE="$OUTDIR/Release/node" -17 -NODE_DEBUG="$OUTDIR/Debug/node" -18 -NODE_LINK="$ROOTDIR/node" -19 -CCTEST_RELEASE="$OUTDIR/Release/cctest" -20 -CCTEST_DEBUG="$OUTDIR/Debug/cctest" -21 -OPENSSL_CLI_RELEASE="$OUTDIR/Release/openssl-cli" -22 -OPENSSL_CLI_DEBUG="$OUTDIR/Debug/openssl-cli" -23 -​ -24 -if [ -f $SFW ]; -25 -then -26 - # Duplicating these commands on purpose as the symbolic link node might be -27 - # linked to either out/Debug/node or out/Release/node depending on the -28 - # BUILDTYPE. -29 - $SFW --remove "$NODE_DEBUG" -30 - $SFW --remove "$NODE_DEBUG" -31 - $SFW --remove "$NODE_RELEASE" -32 - $SFW --remove "$NODE_RELEASE" -33 - $SFW --remove "$NODE_LINK" TOOLSDIR="`( cd \"$TOOLSDIR\" && pwd) `" ROOTDIR="`( cd \"$TOOLSDIR/..\" && pwd) `" OUTDIR="$TOOLSDIR/../out"