From 8aa6b2ca02b6f08fd66178209317fa5ac658a88a Mon Sep 17 00:00:00 2001 From: Micael Karlberg Date: Thu, 7 Feb 2019 12:05:32 +0100 Subject: [socket|test] Some improvements to (esock) ttest Add a quiet mode for ttest which is used when running in a (terminal) shell. Moved the esock-ttest script(s) into their own directory. Minor improvements to the (client) result printout. Also fixed copyright (end) dates. OTP-14831 --- erts/emulator/test/esock-ttest | 350 -------------------- erts/emulator/test/esock_ttest/.gitignore | 0 erts/emulator/test/esock_ttest/esock-ttest | 352 +++++++++++++++++++++ erts/emulator/test/esock_ttest/esock-ttest-client | 72 +++++ .../test/esock_ttest/esock-ttest-server-gen | 32 ++ .../test/esock_ttest/esock-ttest-server-sock | 32 ++ erts/emulator/test/socket_test_ttest_lib.erl | 4 +- .../emulator/test/socket_test_ttest_tcp_client.erl | 103 +++--- .../test/socket_test_ttest_tcp_client_gen.erl | 13 +- .../test/socket_test_ttest_tcp_client_socket.erl | 13 +- 10 files changed, 566 insertions(+), 405 deletions(-) delete mode 100755 erts/emulator/test/esock-ttest create mode 100644 erts/emulator/test/esock_ttest/.gitignore create mode 100755 erts/emulator/test/esock_ttest/esock-ttest create mode 100755 erts/emulator/test/esock_ttest/esock-ttest-client create mode 100755 erts/emulator/test/esock_ttest/esock-ttest-server-gen create mode 100755 erts/emulator/test/esock_ttest/esock-ttest-server-sock (limited to 'erts/emulator/test') diff --git a/erts/emulator/test/esock-ttest b/erts/emulator/test/esock-ttest deleted file mode 100755 index 418b19eec1..0000000000 --- a/erts/emulator/test/esock-ttest +++ /dev/null @@ -1,350 +0,0 @@ -#!/usr/bin/env escript - -%% -%% %CopyrightBegin% -%% -%% Copyright Ericsson AB 2018-2018. All Rights Reserved. -%% -%% Licensed under the Apache License, Version 2.0 (the "License"); -%% you may not use this file except in compliance with the License. -%% You may obtain a copy of the License at -%% -%% http://www.apache.org/licenses/LICENSE-2.0 -%% -%% Unless required by applicable law or agreed to in writing, software -%% distributed under the License is distributed on an "AS IS" BASIS, -%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -%% See the License for the specific language governing permissions and -%% limitations under the License. -%% -%% %CopyrightEnd% -%% - -%% ========================================================================== -%% -%% This is a simple wrapper escript on top of the socket ttest program(s). -%% The idea is to make it simple to run in a normal shell (bash). -%% -%% ========================================================================== - --define(SECS(I), timer:seconds(I)). - --define(CLIENT_MSG_1_MAX_OUTSTANDING, 100). --define(CLIENT_MSG_2_MAX_OUTSTANDING, 10). --define(CLIENT_MSG_3_MAX_OUTSTANDING, 1). - -main(Args) -> - State = process_args(Args), - exec(State), - ok. - -usage(ErrorString) when is_list(ErrorString) -> - eprint(ErrorString), - usage(), - erlang:halt(0). - -usage() -> - io:format("usage: ~s [options]" - "~n" - "~n This erlang script is used to start the (e)socket ttest " - "~n units (server or client)." - "~n" - "~n options: " - "~n --help Display this info and exit. " - "~n --server [server-options] Start a server. " - "~n There are no mandatory server options." - "~n --client client-options Start a client" - "~n Some client options are mandatory and" - "~n others optional." - "~n --active boolean() | once." - "~n Valid for both client and server." - "~n Defaults to: false" - "~n --transport Which transport to use: gen|sock[:plain|msg]" - "~n gen: gen_tcp" - "~n sock: socket" - "~n plain: recv/send (default)" - "~n msg: recvmsg/sendmsg" - "~n Defaults to: sock:plain" - "~n --scon : Address and port of the server." - "~n The address part is in the standard form:" - "~n \"a.b.c.d\"." - "~n Only valid for client." - "~n Mandatory." - "~n --msg-id <1|2|3> Choose which message to use during the test." - "~n Basically: " - "~n 1: small" - "~n 2: medium" - "~n 3: large" - "~n Defaults to: 1" - "~n --max-outstanding How many messages to send before waiting for" - "~n a reply." - "~n Valid only for client." - "~n Defaults to: " - "~n MsgID 1: 100" - "~n MsgID 2: 10" - "~n MsgID 3: 1" - "~n --runtime