cychiu8 commented on code in PR #10840:
URL: https://github.com/apache/ozone/pull/10840#discussion_r3671048584
##########
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/conf/ConfigurationFieldsTests.java:
##########
@@ -668,6 +677,44 @@ public void testDefaultValueCollision() {
LOG.info("Checked {} default values for collision.", valuesChecked);
}
+ }
+
+ /**
+ * Verifies no default value in the XML embeds a line break, which would
+ * corrupt the runtime string (see HDDS-8046). Legitimate cases opt out via
+ * {@link #xmlPropsAllowedToContainNewline}. Unlike the comparison tests,
this
+ * reads the raw XML directly so it is not narrowed by
+ * {@code xmlPropsToSkipCompare}/{@code xmlPrefixToSkipCompare}: every
property
+ * is checked, and the only exemption is {@link
#xmlPropsAllowedToContainNewline}.
+ */
+ @Test
+ public void testXmlValuesHaveNoEmbeddedNewlines() {
+ assertNotNull(xmlFilename);
+ Configuration conf = new Configuration(false);
+ conf.setAllowNullValueProperties(true);
+ conf.addResource(xmlFilename);
Review Comment:
Thanks @adoroszlai again.
I've switched the test to `OzoneConfiguration`, moved it to
`TestOzoneConfigurationFields`, and dropped the `ozone-default.xml `reference
from the failure message.
It now covers the generated `<module>-default.xml` files too.
Loading via `OzoneConfiguration` also brings in Hadoop's `core-default.xml`,
which legitimately ships four multi-line values:
- `fs.s3a.aws.credentials.provider`
- `hadoop.security.sensitive-config-keys`
- `hadoop.system.tags`
- `hadoop.tags.system`
I've added those to `xmlPropsAllowedToContainNewline` with a comment.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]