forked from msysgit/git
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
t0211: test URL redacting in PERF format
This transmogrifies the test case that was just added to t0210, to also cover the `GIT_TRACE2_PERF` backend. Just like t0211, we now have to toggle the `TEST_PASSES_SANITIZE_LEAK` annotation. Signed-off-by: Jeff Hostetler <[email protected]>
- Loading branch information
1 parent
a1686ab
commit e50160f
Showing
1 changed file
with
20 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
|
||
test_description='test trace2 facility (perf target)' | ||
|
||
TEST_PASSES_SANITIZE_LEAK=true | ||
TEST_PASSES_SANITIZE_LEAK=false | ||
. ./test-lib.sh | ||
|
||
# Turn off any inherited trace2 settings for this test. | ||
|
@@ -268,4 +268,23 @@ test_expect_success PTHREADS 'global counter test/test2' ' | |
have_counter_event "main" "counter" "test" "test2" 60 actual | ||
' | ||
|
||
test_expect_success 'unsafe URLs are redacted by default' ' | ||
test_when_finished \ | ||
"rm -r actual trace.perf unredacted.perf clone clone2" && | ||
test_config_global \ | ||
"url.$(pwd).insteadOf" https://user:[email protected]/ && | ||
test_config_global trace2.configParams "core.*,remote.*.url" && | ||
GIT_TRACE2_PERF="$(pwd)/trace.perf" \ | ||
git clone https://user:[email protected]/ clone && | ||
! grep user:pwd trace.perf && | ||
GIT_TRACE2_REDACT=0 GIT_TRACE2_PERF="$(pwd)/unredacted.perf" \ | ||
git clone https://user:[email protected]/ clone2 && | ||
perl "$TEST_DIRECTORY/t0211/scrub_perf.perl" <unredacted.perf >actual && | ||
grep "d0|main|start|.* clone https://user:[email protected]" actual && | ||
grep "d0|main|def_param|.*|remote.origin.url:https://user:[email protected]" actual | ||
' | ||
|
||
test_done |