Skip to content

Commit 3db258e

Browse files
[Test] Fix testGenerateMultipleCertificateWithNewCA (#126621)
Fixes an edge case where we randomly generate an empty list of key usages then pass it to `certutil` command. The empty means just apply the defaults, but we assert based on the generated empty set. Resolves #126471 Co-authored-by: Tim Vernum <[email protected]>
1 parent 1739049 commit 3db258e

File tree

2 files changed

+1
-4
lines changed

2 files changed

+1
-4
lines changed

muted-tests.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -399,9 +399,6 @@ tests:
399399
- class: org.elasticsearch.xpack.test.rest.XPackRestIT
400400
method: test {p0=transform/transforms_start_stop/Test start/stop only starts/stops specified transform}
401401
issue: https://github.com/elastic/elasticsearch/issues/126466
402-
- class: org.elasticsearch.xpack.security.cli.HttpCertificateCommandTests
403-
method: testGenerateMultipleCertificateWithNewCA
404-
issue: https://github.com/elastic/elasticsearch/issues/126471
405402
- class: org.elasticsearch.xpack.downsample.ILMDownsampleDisruptionIT
406403
method: testILMDownsampleRollingRestart
407404
issue: https://github.com/elastic/elasticsearch/issues/126495

x-pack/plugin/security/cli/src/test/java/org/elasticsearch/xpack/security/cli/HttpCertificateCommandTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@ public void testGenerateMultipleCertificateWithNewCA() throws Exception {
380380
caDN = "CN=" + randomAlphaOfLengthBetween(3, 8);
381381
caYears = randomIntBetween(1, 3);
382382
caKeySize = randomFrom(2048, 3072, 4096);
383-
caKeyUsage = randomSubsetOf(CertGenUtils.KEY_USAGE_MAPPINGS.keySet());
383+
caKeyUsage = randomNonEmptySubsetOf(CertGenUtils.KEY_USAGE_MAPPINGS.keySet());
384384
terminal.addTextInput(caDN);
385385
terminal.addTextInput(caYears + "y");
386386
terminal.addTextInput(Integer.toString(caKeySize));

0 commit comments

Comments
 (0)