Skip to content

Commit

Permalink
ssl: Use include_lib in tests for whitebox testing
Browse files Browse the repository at this point in the history
And remove the installation of src header files previously used,
I do this to avoid installing src headers in tests which can mess up
things during development and local testing.

Also remove some logging.
  • Loading branch information
dgud committed Jan 15, 2025
1 parent 02c007b commit 4670b9a
Show file tree
Hide file tree
Showing 15 changed files with 25 additions and 41 deletions.
18 changes: 1 addition & 17 deletions lib/ssl/test/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -113,22 +113,6 @@ HRL_FILES = \
ssl_test_lib.hrl\
ssl_dist_test_lib.hrl

HRL_FILES_SRC = \
ssl_api.hrl\
ssl_internal.hrl\
ssl_alert.hrl \
tls_handshake.hrl \
ssl_handshake.hrl \
ssl_cipher.hrl \
tls_record.hrl \
ssl_record.hrl

HRL_FILES_INC =

HRL_FILES_NEEDED_IN_TEST = \
$(HRL_FILES_SRC:%=../src/%) \
$(HRL_FILES_INC:%=../include/%)

TARGET_FILES = $(MODULES:%=$(EBIN)/%.$(EMULATOR))

INCLUDES = -I.
Expand Down Expand Up @@ -185,7 +169,7 @@ release_spec: opt

release_tests_spec: opt
$(INSTALL_DIR) "$(RELSYSDIR)"
$(INSTALL_DATA) $(ERL_FILES) $(HRL_FILES) $(HRL_FILES_NEEDED_IN_TEST) $(COVER_FILE) "$(RELSYSDIR)"
$(INSTALL_DATA) $(ERL_FILES) $(HRL_FILES) $(COVER_FILE) "$(RELSYSDIR)"
$(INSTALL_DATA) ssl.spec ssl_bench.spec ssl_gh.spec ssl.cover "$(RELSYSDIR)"
chmod -R u+w "$(RELSYSDIR)"
@tar cf - *_SUITE_data property_test | (cd "$(RELSYSDIR)"; tar xf -)
Expand Down
2 changes: 1 addition & 1 deletion lib/ssl/test/openssl_session_ticket_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
openssl_client_early_data_basic/1]).

-include("ssl_test_lib.hrl").
-include("tls_handshake.hrl").
-include_lib("ssl/src/tls_handshake.hrl").

-include_lib("common_test/include/ct.hrl").

Expand Down
2 changes: 1 addition & 1 deletion lib/ssl/test/ssl_api_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
-include_lib("ssl/src/ssl_api.hrl").
-include_lib("ssl/src/ssl_internal.hrl").
-include_lib("public_key/include/public_key.hrl").
-include("ssl_record.hrl").
-include_lib("ssl/src/ssl_record.hrl").

%% Common test
-export([all/0,
Expand Down
6 changes: 3 additions & 3 deletions lib/ssl/test/ssl_bench_test_lib.erl
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ setup(Name) ->
PeerOptions =
#{name => NameStr,
host => Host},
?CT_LOG("PeerOptions: ~p~n", [PeerOptions]),
%% io:format("PeerOptions: ~p~n", [PeerOptions]),
{ok, _Pid, Node} =
peer:start(
case Remote of
Expand All @@ -61,7 +61,7 @@ setup(Name) ->
Path = code:get_path(),
true = erpc:call(Node, code, set_path, [Path]),
ok = erpc:call(Node, ?MODULE, setup_server, [node()]),
?CT_LOG("Client (~p) using ~ts~n",[node(), code:which(ssl)]),
%% ?CT_LOG("Client (~p) using ~ts~n",[node(), code:which(ssl)]),
(Node =:= node()) andalso restrict_schedulers(client),
Node
end.
Expand All @@ -74,7 +74,7 @@ find_executable(Prog) ->

setup_server(ClientNode) ->
(ClientNode =:= node()) andalso restrict_schedulers(server),
?CT_PAL("Server (~p) using ~ts~n",[node(), code:which(ssl)]),
%% ?CT_PAL("Server (~p) using ~ts~n",[node(), code:which(ssl)]),
ok.

restrict_schedulers(Type) ->
Expand Down
2 changes: 1 addition & 1 deletion lib/ssl/test/ssl_cert_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

-include_lib("common_test/include/ct.hrl").
-include_lib("public_key/include/public_key.hrl").
-include("ssl_record.hrl").
-include_lib("ssl/src/ssl_record.hrl").

%% Common test
-export([all/0,
Expand Down
6 changes: 3 additions & 3 deletions lib/ssl/test/ssl_cipher_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
-behaviour(ct_suite).

-include_lib("common_test/include/ct.hrl").
-include("tls_record.hrl").
-include("ssl_cipher.hrl").
-include("ssl_record.hrl").
-include_lib("ssl/src/tls_record.hrl").
-include_lib("ssl/src/ssl_cipher.hrl").
-include_lib("ssl/src/ssl_record.hrl").

%% Callback functions
-export([all/0,
Expand Down
10 changes: 5 additions & 5 deletions lib/ssl/test/ssl_handshake_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@
-behaviour(ct_suite).

-include_lib("common_test/include/ct.hrl").
-include("ssl_alert.hrl").
-include("ssl_handshake.hrl").
-include("ssl_internal.hrl").
-include("ssl_record.hrl").
-include("tls_handshake.hrl").
-include_lib("ssl/src/ssl_alert.hrl").
-include_lib("ssl/src/ssl_handshake.hrl").
-include_lib("ssl/src/ssl_internal.hrl").
-include_lib("ssl/src/ssl_record.hrl").
-include_lib("ssl/src/tls_handshake.hrl").
-include_lib("public_key/include/public_key.hrl").

%% Common test
Expand Down
2 changes: 1 addition & 1 deletion lib/ssl/test/ssl_mfl_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

-include("ssl_test_lib.hrl").
-include_lib("common_test/include/ct.hrl").
-include("ssl_record.hrl").
-include_lib("ssl/src/ssl_record.hrl").

%% Common test
-export([all/0,
Expand Down
2 changes: 1 addition & 1 deletion lib/ssl/test/ssl_reject_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
-module(ssl_reject_SUITE).

-include_lib("common_test/include/ct.hrl").
-include("ssl_record.hrl").
-include_lib("ssl/src/ssl_record.hrl").
-include_lib("ssl/src/ssl_alert.hrl").
-include_lib("ssl/src/ssl_handshake.hrl").

Expand Down
2 changes: 1 addition & 1 deletion lib/ssl/test/ssl_renegotiate_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
-include("ssl_test_lib.hrl").
-include_lib("common_test/include/ct.hrl").
-include_lib("public_key/include/public_key.hrl").
-include("ssl_record.hrl").
-include_lib("ssl/src/ssl_record.hrl").

%% Common test
-export([all/0,
Expand Down
4 changes: 2 additions & 2 deletions lib/ssl/test/ssl_session_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
-behaviour(ct_suite).

-include("ssl_test_lib.hrl").
-include("tls_handshake.hrl").
-include("ssl_record.hrl").
-include_lib("ssl/src/tls_handshake.hrl").
-include_lib("ssl/src/ssl_record.hrl").

-include_lib("common_test/include/ct.hrl").
-include_lib("public_key/include/public_key.hrl").
Expand Down
2 changes: 1 addition & 1 deletion lib/ssl/test/ssl_session_cache_api_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
-behaviour(ct_suite).

-include_lib("common_test/include/ct.hrl").
-include("tls_handshake.hrl").
-include_lib("ssl/src/tls_handshake.hrl").

%% Callback functions
-export([all/0,
Expand Down
2 changes: 1 addition & 1 deletion lib/ssl/test/ssl_session_ticket_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
stateless_multiple_servers/1]).

-include("ssl_test_lib.hrl").
-include("tls_handshake.hrl").
-include_lib("ssl/src/tls_handshake.hrl").
-include_lib("common_test/include/ct.hrl").

-define(SLEEP, 500).
Expand Down
4 changes: 2 additions & 2 deletions lib/ssl/test/ssl_test_lib.erl
Original file line number Diff line number Diff line change
Expand Up @@ -3532,8 +3532,8 @@ portable_open_port("openssl" = Exe, Args0) ->
case IsWindows andalso os:getenv("WSLENV") of
false ->
AbsPath = os:find_executable(Exe),
?CT_LOG("open_port({spawn_executable, ~p}, [stderr_to_stdout,~n {args, \"~s\"}]).",
[AbsPath, lists:join($\s, Args0)]),
%% ?CT_LOG("open_port({spawn_executable, ~p}, [stderr_to_stdout,~n {args, \"~s\"}]).",
%% [AbsPath, lists:join($\s, Args0)]),
open_port({spawn_executable, AbsPath},
[{args, Args0}, stderr_to_stdout]);
_ ->
Expand Down
2 changes: 1 addition & 1 deletion lib/ssl/test/tls_server_session_ticket_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
-include_lib("ssl/src/ssl_cipher.hrl").
-include_lib("ssl/src/ssl_internal.hrl").
-include_lib("ssl/src/tls_handshake_1_3.hrl").
-include("ssl_record.hrl").
-include_lib("ssl/src/ssl_record.hrl").

%% Callback functions
-export([all/0,
Expand Down

0 comments on commit 4670b9a

Please sign in to comment.