Skip to content

Commit 218188d

Browse files
committed
Adjusted cipher related serverd tests to adapt to their environment better
The failure case was on RedHat 10 the hard-coded cipher in the test was not available in openssl 3.2.2 provided by the system. Ticket: ENT-13494 Changelog: none (cherry picked from commit 91dafa126fccc57214ab5c627d942f5821b63bf8)
1 parent 4a05e3f commit 218188d

File tree

5 files changed

+46
-12
lines changed

5 files changed

+46
-12
lines changed

tests/acceptance/16_cf-serverd/serial/copy_from_ciphers_fail.cf

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,20 @@
11
body common control
22
{
3-
inputs => { "../../default.cf.sub", "../../run_with_server.cf.sub" };
3+
inputs => {
4+
"../../default.cf.sub",
5+
"../../run_with_server.cf.sub",
6+
"./render_single_cipher_server_config.cf.sub",
7+
};
48
bundlesequence => { default("$(this.promise_filename)") };
59
version => "1.0";
610
}
711

12+
bundle agent init
13+
{
14+
methods:
15+
"render_single_cipher_server_config";
16+
}
17+
818
bundle agent test
919
{
1020
methods:
@@ -18,9 +28,9 @@ bundle agent test
1828

1929
"any" usebundle => generate_key;
2030

21-
"any" usebundle => start_server("$(this.promise_dirname)/nondefault_ciphers_tlsversion.srv");
31+
"any" usebundle => start_server("$(this.promise_dirname)/single_cipher_tlsversion.srv");
2232
"any" usebundle => start_server("$(this.promise_dirname)/default_ciphers_tlsversion.srv");
2333
"any" usebundle => run_test("$(this.promise_filename).sub");
24-
"any" usebundle => stop_server("$(this.promise_dirname)/nondefault_ciphers_tlsversion.srv");
34+
"any" usebundle => stop_server("$(this.promise_dirname)/single_cipher_tlsversion.srv");
2535
"any" usebundle => stop_server("$(this.promise_dirname)/default_ciphers_tlsversion.srv");
2636
}

tests/acceptance/16_cf-serverd/serial/copy_from_ciphers_fail.cf.sub

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,7 @@ body common control
1616

1717
# This cipher doesn't match neither of the two
1818
# servers "allowciphers" setting.
19-
tls_ciphers => "AES128-SHA";
20-
}
21-
22-
bundle agent init
23-
{
19+
tls_ciphers => "NOPE";
2420
}
2521

2622
bundle agent test

tests/acceptance/16_cf-serverd/serial/copy_from_ciphers_success.cf

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,20 @@
11
body common control
22
{
3-
inputs => { "../../default.cf.sub", "../../run_with_server.cf.sub" };
3+
inputs => {
4+
"../../default.cf.sub",
5+
"../../run_with_server.cf.sub",
6+
"./render_single_cipher_server_config.cf.sub"
7+
};
48
bundlesequence => { default("$(this.promise_filename)") };
59
version => "1.0";
610
}
711

12+
bundle agent init
13+
{
14+
methods:
15+
"render_single_cipher_server_config";
16+
}
17+
818
bundle agent test
919
{
1020
meta:
@@ -22,9 +32,9 @@ bundle agent test
2232

2333
"any" usebundle => generate_key;
2434

25-
"any" usebundle => start_server("$(this.promise_dirname)/nondefault_ciphers_tlsversion.srv");
35+
"any" usebundle => start_server("$(this.promise_dirname)/single_cipher_tlsversion.srv");
2636
"any" usebundle => start_server("$(this.promise_dirname)/default_ciphers_tlsversion.srv");
2737
"any" usebundle => run_test("$(this.promise_filename).sub");
28-
"any" usebundle => stop_server("$(this.promise_dirname)/nondefault_ciphers_tlsversion.srv");
38+
"any" usebundle => stop_server("$(this.promise_dirname)/single_cipher_tlsversion.srv");
2939
"any" usebundle => stop_server("$(this.promise_dirname)/default_ciphers_tlsversion.srv");
3040
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
bundle agent render_single_cipher_server_config
2+
{
3+
vars:
4+
"openssl_command" string => ifelse(
5+
fileexists("${sys.bindir}/openssl"),
6+
"${sys.bindir}/openssl",
7+
"openssl"),
8+
comment => "Use vendored openssl if present, otherwise whatever is in PATH.";
9+
"first_supported_cipher" string => execresult("openssl ciphers -s | cut -d: -f1", "useshell");
10+
"data" data => '{ "cipher": "${first_supported_cipher}" }';
11+
12+
files:
13+
"$(this.promise_dirname)/single_cipher_tlsversion.srv"
14+
create => "true",
15+
template_method => "mustache",
16+
edit_template => "$(this.promise_dirname)/single_cipher_tlsversion.srv.mustache",
17+
template_data => @(data);
18+
}

tests/acceptance/16_cf-serverd/serial/nondefault_ciphers_tlsversion.srv renamed to tests/acceptance/16_cf-serverd/serial/single_cipher_tlsversion.srv.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ body server control
1515
port => "9888";
1616
1717
# Only this cipher is to be accepted
18-
allowciphers => "AES128-GCM-SHA256";
18+
allowciphers => "{{cipher}}";
1919
2020
# Allow only TLSv1.1 or higher
2121
allowtlsversion => "1.1";

0 commit comments

Comments
 (0)