Skip to content

Commit 03b6cc7

Browse files
[Test] Fix testGenerateMultipleCertificateWithNewCA
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
1 parent 591fa87 commit 03b6cc7

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
@@ -411,9 +411,6 @@ tests:
411411
- class: org.elasticsearch.xpack.test.rest.XPackRestIT
412412
method: test {p0=transform/transforms_start_stop/Test start/stop only starts/stops specified transform}
413413
issue: https://github.com/elastic/elasticsearch/issues/126466
414-
- class: org.elasticsearch.xpack.security.cli.HttpCertificateCommandTests
415-
method: testGenerateMultipleCertificateWithNewCA
416-
issue: https://github.com/elastic/elasticsearch/issues/126471
417414
- class: org.elasticsearch.xpack.downsample.ILMDownsampleDisruptionIT
418415
method: testILMDownsampleRollingRestart
419416
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)