This is an automated email from the ASF dual-hosted git repository.
dongjoon pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/spark.git
The following commit(s) were added to refs/heads/master by this push:
new 92b6f86 [SPARK-27244][CORE][TEST][FOLLOWUP] toDebugString redacts
sensitive information
92b6f86 is described below
commit 92b6f86f6d25abbc2abbf374e77c0b70cd1779c7
Author: gatorsmile <[email protected]>
AuthorDate: Sat Mar 30 22:58:28 2019 -0700
[SPARK-27244][CORE][TEST][FOLLOWUP] toDebugString redacts sensitive
information
## What changes were proposed in this pull request?
This PR is a FollowUp of https://github.com/apache/spark/pull/24196. It
improves the test case by using the parameters that are being used in the
actual scenarios.
## How was this patch tested?
N/A
Closes #24257 from gatorsmile/followupSPARK-27244.
Authored-by: gatorsmile <[email protected]>
Signed-off-by: Dongjoon Hyun <[email protected]>
---
.../test/scala/org/apache/spark/SparkConfSuite.scala | 19 +++++++++++++------
1 file changed, 13 insertions(+), 6 deletions(-)
diff --git a/core/src/test/scala/org/apache/spark/SparkConfSuite.scala
b/core/src/test/scala/org/apache/spark/SparkConfSuite.scala
index 5ca4f9c..1123191 100644
--- a/core/src/test/scala/org/apache/spark/SparkConfSuite.scala
+++ b/core/src/test/scala/org/apache/spark/SparkConfSuite.scala
@@ -354,12 +354,19 @@ class SparkConfSuite extends SparkFunSuite with
LocalSparkContext with ResetSyst
}
}
- test("SPARK-27244 toDebugString should redact passwords") {
- val conf = new SparkConf().set("dummy.password", "dummy-password")
- conf.validateSettings()
-
- assert(conf.get("dummy.password") === "dummy-password")
-
assert(conf.toDebugString.contains(s"dummy.password=${Utils.REDACTION_REPLACEMENT_TEXT}"))
+ test("SPARK-27244 toDebugString redacts sensitive information") {
+ val conf = new SparkConf(loadDefaults = false)
+ .set("dummy.password", "dummy-password")
+ .set("spark.hadoop.hive.server2.keystore.password", "1234")
+ .set("spark.hadoop.javax.jdo.option.ConnectionPassword", "1234")
+ .set("spark.regular.property", "regular_value")
+ assert(conf.toDebugString ==
+ s"""
+ |dummy.password=${Utils.REDACTION_REPLACEMENT_TEXT}
+
|spark.hadoop.hive.server2.keystore.password=${Utils.REDACTION_REPLACEMENT_TEXT}
+
|spark.hadoop.javax.jdo.option.ConnectionPassword=${Utils.REDACTION_REPLACEMENT_TEXT}
+ |spark.regular.property=regular_value
+ """.stripMargin.trim)
}
val defaultIllegalValue = "SomeIllegalValue"
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]