holado 0.2.7__py3-none-any.whl → 0.3.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of holado might be problematic. Click here for more details.
- holado/common/handlers/undefined.py +7 -1
- {holado-0.2.7.dist-info → holado-0.3.0.dist-info}/METADATA +7 -1
- {holado-0.2.7.dist-info → holado-0.3.0.dist-info}/RECORD +116 -107
- holado_ais/ais/ais_messages.py +97 -6
- holado_ais/tests/behave/steps/ais/ais_manager_steps.py +1 -1
- holado_ais/tests/behave/steps/ais/ais_messages_steps.py +45 -6
- holado_binary/ipc/bit_series.py +3 -3
- holado_binary/tests/behave/steps/ipc/binary_steps.py +1 -1
- holado_binary/tests/behave/steps/ipc/bit_series_steps.py +4 -3
- holado_context/tests/behave/steps/private/common/context_steps.py +1 -1
- holado_core/common/resource/persisted_data_manager.py +13 -16
- holado_core/common/resource/resource_manager.py +10 -10
- holado_core/common/tables/converters/table_converter.py +47 -9
- holado_core/common/tables/table.py +2 -2
- holado_core/common/tables/table_manager.py +6 -7
- holado_core/common/tables/table_with_header.py +6 -0
- holado_core/common/tools/string_tools.py +9 -0
- holado_core/tests/behave/steps/common/common_steps.py +2 -1
- holado_core/tests/behave/steps/common/config_steps.py +1 -1
- holado_core/tests/behave/steps/common/resource_steps.py +1 -1
- holado_core/tests/behave/steps/common/tables_steps.py +27 -4
- holado_data/data/generator/generator_manager.py +39 -0
- holado_data/tests/behave/steps/data/generator_steps.py +1 -1
- holado_data/tests/behave/steps/tools/utils_steps.py +1 -2
- holado_db/tests/behave/steps/tools/db/db_client_steps.py +1 -1
- holado_db/tests/behave/steps/tools/db/postgresql_client_steps.py +1 -1
- holado_db/tests/behave/steps/tools/db/sqlite_client_steps.py +1 -1
- holado_db/tools/db/clients/base/db_client.py +81 -28
- holado_db/tools/db/clients/postgresql/postgresql_client.py +17 -7
- holado_db/tools/db/query/base/query_builder.py +58 -7
- holado_db/tools/db/query/pypika/pypika_query_builder.py +73 -21
- holado_docker/tests/behave/steps/tools/docker_steps.py +1 -1
- holado_grpc/tests/behave/steps/api/grpc_client_steps.py +1 -1
- holado_grpc/tests/behave/steps/private/api/grpc_steps.py +1 -1
- holado_helper/script/action.py +16 -7
- holado_json/tests/behave/steps/ipc/json_steps.py +1 -1
- holado_keycloak/tests/behave/steps/tools/keycloak_client_steps.py +1 -1
- holado_multitask/tests/behave/steps/multiprocessing_steps.py +1 -1
- holado_multitask/tests/behave/steps/multithreading_steps.py +1 -1
- holado_protobuf/ipc/protobuf/types/google/protobuf.py +1 -1
- holado_protobuf/tests/behave/steps/ipc/protobuf_steps.py +1 -1
- holado_python/common/tools/datetime.py +31 -12
- holado_python/standard_library/socket/blocking_socket.py +112 -42
- holado_python/standard_library/socket/echo_server.py +4 -3
- holado_python/standard_library/socket/message_socket.py +69 -22
- holado_python/standard_library/socket/non_blocking_socket.py +65 -67
- holado_python/standard_library/socket/socket.py +272 -32
- holado_python/standard_library/ssl/resources/certificates/NOTES.txt +1 -1
- holado_python/standard_library/ssl/resources/certificates/rootCACert.pem +24 -0
- holado_python/standard_library/ssl/resources/certificates/tcpbin.crt +21 -0
- holado_python/standard_library/ssl/resources/certificates/tcpbin.key +28 -0
- holado_python/standard_library/ssl/ssl.py +138 -21
- holado_python/tests/behave/steps/convert_steps.py +1 -1
- holado_python/tests/behave/steps/iterable_steps.py +1 -1
- holado_python/tests/behave/steps/standard_library/csv_steps.py +1 -1
- holado_python/tests/behave/steps/standard_library/datetime_steps.py +1 -1
- holado_python/tests/behave/steps/standard_library/hashlib_steps.py +1 -1
- holado_python/tests/behave/steps/standard_library/multiprocessing_steps.py +1 -1
- holado_python/tests/behave/steps/standard_library/queue_steps.py +1 -1
- holado_python/tests/behave/steps/standard_library/socket_steps.py +147 -21
- holado_python/tests/behave/steps/standard_library/ssl_steps.py +87 -16
- holado_rabbitmq/tests/behave/steps/tools/rabbitmq_client_steps.py +48 -20
- holado_rabbitmq/tests/behave/steps/tools/rabbitmq_server_steps.py +1 -1
- holado_rabbitmq/tools/rabbitmq/rabbitmq_client.py +19 -13
- holado_rabbitmq/tools/rabbitmq/rabbitmq_manager.py +2 -29
- holado_redis/tests/behave/steps/tools/redis_client_steps.py +1 -1
- holado_rest/tests/behave/steps/api/rest_client_steps.py +1 -1
- holado_rest/tests/behave/steps/private/api/rest_steps.py +1 -1
- holado_s3/tests/behave/steps/private/tools/s3_steps.py +1 -1
- holado_s3/tests/behave/steps/tools/s3_client_steps.py +1 -1
- holado_s3/tests/behave/steps/tools/s3_server_steps.py +1 -1
- holado_scripting/tests/behave/steps/common/tools/variable_convert_steps.py +3 -2
- holado_scripting/tests/behave/steps/common/tools/variable_new_steps.py +1 -1
- holado_scripting/tests/behave/steps/common/tools/variable_steps.py +1 -1
- holado_scripting/tests/behave/steps/common/tools/variable_verify_steps.py +1 -1
- holado_scripting/tests/behave/steps/scenario/function_steps.py +1 -1
- holado_scripting/tests/behave/steps/scenario/if_steps.py +1 -1
- holado_scripting/tests/behave/steps/scenario/loop_steps.py +1 -1
- holado_scripting/text/interpreter/functions/function_apply_function.py +60 -0
- holado_scripting/text/interpreter/functions/function_to_string.py +50 -0
- holado_scripting/text/interpreter/text_interpreter.py +4 -0
- holado_sftp/tests/behave/steps/private/tools/sftp_steps.py +1 -1
- holado_sftp/tests/behave/steps/tools/sftp_client_steps.py +1 -1
- holado_sftp/tests/behave/steps/tools/sftp_server_steps.py +1 -1
- holado_swagger/tests/behave/steps/swagger_hub/mockserver_steps.py +1 -1
- holado_system/system/command/command.py +14 -9
- holado_system/tests/behave/steps/system/commands_steps.py +1 -1
- holado_system/tests/behave/steps/system/file_steps.py +1 -1
- holado_system/tests/behave/steps/system/system_steps.py +1 -1
- holado_test/scenario/step_tools.py +5 -4
- holado_test/scenario/tester_tools.py +6 -3
- holado_test/tests/behave/steps/scenario/exception_steps.py +1 -1
- holado_test/tests/behave/steps/scenario/scenario_steps.py +1 -1
- holado_test/tests/behave/steps/scenario/tester_steps.py +4 -4
- holado_value/common/tables/converters/value_table_converter.py +52 -8
- holado_value/common/tables/value_table_cell.py +5 -0
- holado_value/common/tables/value_table_manager.py +0 -10
- holado_value/common/tables/value_table_row.py +0 -1
- holado_value/common/tools/value.py +5 -1
- holado_ws/tests/behave/steps/api/web_service_steps.py +1 -1
- holado_yaml/tests/behave/steps/yaml_steps.py +1 -1
- holado_yaml/yaml/yaml_manager.py +2 -2
- test_holado/features/NonReg/common/tables/table.feature +30 -24
- test_holado/features/NonReg/holado_ais/ais_message-bitarray_to_nmea.feature +1 -1
- test_holado/features/NonReg/holado_python/standard_library/socket/local_echo_server/socket_reset.feature +191 -0
- test_holado/features/NonReg/holado_python/standard_library/{socket_with_ssl.feature → socket/local_echo_server/socket_with_tls_and_verify.feature} +126 -27
- test_holado/features/NonReg/holado_python/standard_library/socket/local_echo_server/socket_with_tls_without_verify.feature +299 -0
- test_holado/features/NonReg/holado_python/standard_library/{socket.feature → socket/local_echo_server/socket_without_tls.feature} +63 -1
- test_holado/features/NonReg/holado_python/standard_library/socket/tcpbin.com/socket_with_mtls.feature +214 -0
- test_holado/features/NonReg/holado_python/standard_library/socket/tcpbin.com/socket_with_tls.feature +184 -0
- test_holado/features/NonReg/holado_python/standard_library/socket/tcpbin.com/socket_without_tls.feature +169 -0
- test_holado/features/NonReg/tools/RabbitMQ.feature +9 -9
- test_holado/features/NonReg/tools/RabbitMQ_steps.feature +8 -8
- test_holado/logging.conf +5 -3
- holado_core/common/transport/__init__.py +0 -0
- holado_core/common/transport/crc.py +0 -40
- {holado-0.2.7.dist-info → holado-0.3.0.dist-info}/WHEEL +0 -0
- {holado-0.2.7.dist-info → holado-0.3.0.dist-info}/licenses/LICENSE +0 -0
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
@testing_solution
|
|
2
|
+
@python
|
|
3
|
+
@socket
|
|
4
|
+
@tcpbin.com
|
|
5
|
+
@with_mtls
|
|
6
|
+
Feature: Test python socket steps with mTLS
|
|
7
|
+
|
|
8
|
+
@blocking_socket
|
|
9
|
+
Scenario: Client with blocking connections
|
|
10
|
+
|
|
11
|
+
### PRECONDITIONS - BEGIN
|
|
12
|
+
Given begin preconditions
|
|
13
|
+
|
|
14
|
+
# Get key files
|
|
15
|
+
#Given CA_CERTFILE_PATH = CA certfile path for tcpbin.com
|
|
16
|
+
Given CERTFILE_PATH = certfile path for tcpbin.com
|
|
17
|
+
Given KEYFILE_PATH = keyfile path for tcpbin.com
|
|
18
|
+
|
|
19
|
+
# Create a TCP client with a blocking connection
|
|
20
|
+
Given CLIENT = new TCP socket client
|
|
21
|
+
| Name | Value |
|
|
22
|
+
| 'host' | 'tcpbin.com' |
|
|
23
|
+
| 'port' | 4244 |
|
|
24
|
+
| 'ssl.activate' | True |
|
|
25
|
+
| 'ssl.context.ciphers' | 'ALL' |
|
|
26
|
+
| 'ssl.context.check_hostname' | True |
|
|
27
|
+
#| 'ssl.context.load_verify_locations.cafile' | CA_CERTFILE_PATH |
|
|
28
|
+
| 'ssl.context.load_cert_chain.certfile' | CERTFILE_PATH |
|
|
29
|
+
| 'ssl.context.load_cert_chain.keyfile' | KEYFILE_PATH |
|
|
30
|
+
|
|
31
|
+
Given end preconditions
|
|
32
|
+
### PRECONDITIONS - END
|
|
33
|
+
|
|
34
|
+
# Start client
|
|
35
|
+
When ensure SSL handshake is done (socket: CLIENT)
|
|
36
|
+
|
|
37
|
+
# Write data and verify result is identical
|
|
38
|
+
When write b'\x01\x02\n' (socket: CLIENT)
|
|
39
|
+
When DATA = read (socket: CLIENT)
|
|
40
|
+
Then DATA == b'\x01\x02\n'
|
|
41
|
+
|
|
42
|
+
When write b'\x11\x21\n' (socket: CLIENT)
|
|
43
|
+
When DATA = read (socket: CLIENT)
|
|
44
|
+
Then DATA == b'\x11\x21\n'
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
@non_blocking_socket
|
|
49
|
+
Scenario: Client with non blocking connection
|
|
50
|
+
|
|
51
|
+
### PRECONDITIONS - BEGIN
|
|
52
|
+
Given begin preconditions
|
|
53
|
+
|
|
54
|
+
# Get key files
|
|
55
|
+
Given CERTFILE_PATH = certfile path for tcpbin.com
|
|
56
|
+
Given KEYFILE_PATH = keyfile path for tcpbin.com
|
|
57
|
+
|
|
58
|
+
# Create a TCP client with a blocking connection
|
|
59
|
+
Given CLIENT = new TCP socket client
|
|
60
|
+
| Name | Value |
|
|
61
|
+
| 'host' | 'tcpbin.com' |
|
|
62
|
+
| 'port' | 4244 |
|
|
63
|
+
| 'blocking' | False |
|
|
64
|
+
| 'ssl.activate' | True |
|
|
65
|
+
| 'ssl.context.ciphers' | 'ALL' |
|
|
66
|
+
| 'ssl.context.check_hostname' | True |
|
|
67
|
+
| 'ssl.context.load_cert_chain.certfile' | CERTFILE_PATH |
|
|
68
|
+
| 'ssl.context.load_cert_chain.keyfile' | KEYFILE_PATH |
|
|
69
|
+
|
|
70
|
+
Given end preconditions
|
|
71
|
+
### PRECONDITIONS - END
|
|
72
|
+
|
|
73
|
+
# Start Client
|
|
74
|
+
When start (socket client: CLIENT)
|
|
75
|
+
|
|
76
|
+
# Write data and verify result is identical
|
|
77
|
+
When write b'\x01\x02\n' (socket: CLIENT)
|
|
78
|
+
When await socket CLIENT receives a data (timeout: 10 s)
|
|
79
|
+
When DATA = read (socket: CLIENT)
|
|
80
|
+
Then DATA == b'\x01\x02\n'
|
|
81
|
+
|
|
82
|
+
When write b'\x11\x21\n' (socket: CLIENT)
|
|
83
|
+
When await socket CLIENT receives a data (timeout: 10 s)
|
|
84
|
+
When DATA = read (socket: CLIENT)
|
|
85
|
+
Then DATA == b'\x11\x21\n'
|
|
86
|
+
|
|
87
|
+
# Stop client
|
|
88
|
+
When stop (socket client: CLIENT)
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
@message_socket
|
|
93
|
+
@blocking_socket
|
|
94
|
+
Scenario: Message client (with underlying blocking connection)
|
|
95
|
+
|
|
96
|
+
### PRECONDITIONS - BEGIN
|
|
97
|
+
Given begin preconditions
|
|
98
|
+
|
|
99
|
+
# Get key files
|
|
100
|
+
Given CERTFILE_PATH = certfile path for tcpbin.com
|
|
101
|
+
Given KEYFILE_PATH = keyfile path for tcpbin.com
|
|
102
|
+
|
|
103
|
+
# Create a message client
|
|
104
|
+
Given CLIENT = new message TCP socket client
|
|
105
|
+
| Name | Value |
|
|
106
|
+
| 'host' | 'tcpbin.com' |
|
|
107
|
+
| 'port' | 4244 |
|
|
108
|
+
| 'separator' | b'\n' |
|
|
109
|
+
| 'ssl.activate' | True |
|
|
110
|
+
| 'ssl.context.ciphers' | 'ALL' |
|
|
111
|
+
| 'ssl.context.check_hostname' | True |
|
|
112
|
+
| 'ssl.context.load_cert_chain.certfile' | CERTFILE_PATH |
|
|
113
|
+
| 'ssl.context.load_cert_chain.keyfile' | KEYFILE_PATH |
|
|
114
|
+
|
|
115
|
+
Given end preconditions
|
|
116
|
+
### PRECONDITIONS - END
|
|
117
|
+
|
|
118
|
+
# Start message client
|
|
119
|
+
When ensure SSL handshake is done (socket: CLIENT)
|
|
120
|
+
When start (socket client: CLIENT)
|
|
121
|
+
|
|
122
|
+
# Write data and verify result is identical
|
|
123
|
+
When write message b'\x01\x02' (socket: CLIENT)
|
|
124
|
+
When write message b'\x11\x21' (socket: CLIENT)
|
|
125
|
+
|
|
126
|
+
# Verify received messages
|
|
127
|
+
When await socket CLIENT receives messages (first timeout: 10 s ; window: 0.1 s)
|
|
128
|
+
When MESSAGES = received messages (socket: CLIENT)
|
|
129
|
+
Then MESSAGES is list
|
|
130
|
+
| b'\x01\x02' |
|
|
131
|
+
| b'\x11\x21' |
|
|
132
|
+
|
|
133
|
+
When MESSAGES_2 = received messages (socket: CLIENT)
|
|
134
|
+
Then MESSAGES_2 == MESSAGES
|
|
135
|
+
|
|
136
|
+
# Verify pop messages functionality
|
|
137
|
+
When MSG_1 = read message (socket: CLIENT)
|
|
138
|
+
Then MSG_1 == b'\x01\x02'
|
|
139
|
+
When MESSAGES_3 = received messages (socket: CLIENT)
|
|
140
|
+
Then MESSAGES_3 is list
|
|
141
|
+
| b'\x11\x21' |
|
|
142
|
+
|
|
143
|
+
When MSG_2 = read message (socket: CLIENT)
|
|
144
|
+
Then MSG_2 == b'\x11\x21'
|
|
145
|
+
When MESSAGES_4 = received messages (socket: CLIENT)
|
|
146
|
+
Then MESSAGES_4 is empty list
|
|
147
|
+
|
|
148
|
+
# Stop client
|
|
149
|
+
When stop (socket client: CLIENT)
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
@message_socket
|
|
154
|
+
@non_blocking_socket
|
|
155
|
+
Scenario: Message client (with underlying non-blocking connection)
|
|
156
|
+
|
|
157
|
+
### PRECONDITIONS - BEGIN
|
|
158
|
+
Given begin preconditions
|
|
159
|
+
|
|
160
|
+
# Get key files
|
|
161
|
+
Given CERTFILE_PATH = certfile path for tcpbin.com
|
|
162
|
+
Given KEYFILE_PATH = keyfile path for tcpbin.com
|
|
163
|
+
|
|
164
|
+
# Create a message client
|
|
165
|
+
Given CLIENT = new message TCP socket client
|
|
166
|
+
| Name | Value |
|
|
167
|
+
| 'host' | 'tcpbin.com' |
|
|
168
|
+
| 'port' | 4244 |
|
|
169
|
+
| 'separator' | b'\n' |
|
|
170
|
+
| 'blocking' | False |
|
|
171
|
+
| 'ssl.activate' | True |
|
|
172
|
+
| 'ssl.context.ciphers' | 'ALL' |
|
|
173
|
+
| 'ssl.context.check_hostname' | True |
|
|
174
|
+
| 'ssl.context.load_cert_chain.certfile' | CERTFILE_PATH |
|
|
175
|
+
| 'ssl.context.load_cert_chain.keyfile' | KEYFILE_PATH |
|
|
176
|
+
|
|
177
|
+
Given end preconditions
|
|
178
|
+
### PRECONDITIONS - END
|
|
179
|
+
|
|
180
|
+
# Start message client
|
|
181
|
+
When ensure SSL handshake is done (socket: CLIENT)
|
|
182
|
+
When start (socket client: CLIENT)
|
|
183
|
+
|
|
184
|
+
# Write data and verify result is identical
|
|
185
|
+
When write message b'\x01\x02' (socket: CLIENT)
|
|
186
|
+
When write message b'\x11\x21' (socket: CLIENT)
|
|
187
|
+
|
|
188
|
+
# Verify received messages
|
|
189
|
+
When await socket CLIENT receives messages (first timeout: 10 s ; window: 0.1 s)
|
|
190
|
+
When MESSAGES = received messages (socket: CLIENT)
|
|
191
|
+
Then MESSAGES is list
|
|
192
|
+
| b'\x01\x02' |
|
|
193
|
+
| b'\x11\x21' |
|
|
194
|
+
|
|
195
|
+
When MESSAGES_2 = received messages (socket: CLIENT)
|
|
196
|
+
Then MESSAGES_2 == MESSAGES
|
|
197
|
+
|
|
198
|
+
# Verify pop messages functionality
|
|
199
|
+
When MSG_1 = read message (socket: CLIENT)
|
|
200
|
+
Then MSG_1 == b'\x01\x02'
|
|
201
|
+
When MESSAGES_3 = received messages (socket: CLIENT)
|
|
202
|
+
Then MESSAGES_3 is list
|
|
203
|
+
| b'\x11\x21' |
|
|
204
|
+
|
|
205
|
+
When MSG_2 = read message (socket: CLIENT)
|
|
206
|
+
Then MSG_2 == b'\x11\x21'
|
|
207
|
+
When MESSAGES_4 = received messages (socket: CLIENT)
|
|
208
|
+
Then MESSAGES_4 is empty list
|
|
209
|
+
|
|
210
|
+
# Stop client
|
|
211
|
+
When stop (socket client: CLIENT)
|
|
212
|
+
|
|
213
|
+
|
|
214
|
+
|
test_holado/features/NonReg/holado_python/standard_library/socket/tcpbin.com/socket_with_tls.feature
ADDED
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
@testing_solution
|
|
2
|
+
@python
|
|
3
|
+
@socket
|
|
4
|
+
@tcpbin.com
|
|
5
|
+
@with_tls
|
|
6
|
+
Feature: Test python socket steps with tcpbin.com echo server and TLS
|
|
7
|
+
|
|
8
|
+
@blocking_socket
|
|
9
|
+
Scenario: Client with blocking connections
|
|
10
|
+
|
|
11
|
+
### PRECONDITIONS - BEGIN
|
|
12
|
+
Given begin preconditions
|
|
13
|
+
|
|
14
|
+
# Create a TCP client
|
|
15
|
+
Given CLIENT = new TCP socket client
|
|
16
|
+
| Name | Value |
|
|
17
|
+
| 'host' | 'tcpbin.com' |
|
|
18
|
+
| 'port' | 4243 |
|
|
19
|
+
| 'ssl.activate' | True |
|
|
20
|
+
| 'ssl.context.ciphers' | 'ALL' |
|
|
21
|
+
|
|
22
|
+
Given end preconditions
|
|
23
|
+
### PRECONDITIONS - END
|
|
24
|
+
|
|
25
|
+
# Start client
|
|
26
|
+
When ensure SSL handshake is done (socket: CLIENT)
|
|
27
|
+
|
|
28
|
+
# Write data and verify result is identical
|
|
29
|
+
When write b'\x01\x02\n' (socket: CLIENT)
|
|
30
|
+
When DATA = read (socket: CLIENT)
|
|
31
|
+
Then DATA == b'\x01\x02\n'
|
|
32
|
+
|
|
33
|
+
When write b'\x11\x21\n' (socket: CLIENT)
|
|
34
|
+
When DATA = read (socket: CLIENT)
|
|
35
|
+
Then DATA == b'\x11\x21\n'
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
@non_blocking_socket
|
|
40
|
+
Scenario: Client with non blocking connection
|
|
41
|
+
|
|
42
|
+
### PRECONDITIONS - BEGIN
|
|
43
|
+
Given begin preconditions
|
|
44
|
+
|
|
45
|
+
# Create a TCP client
|
|
46
|
+
Given CLIENT = new TCP socket client
|
|
47
|
+
| Name | Value |
|
|
48
|
+
| 'host' | 'tcpbin.com' |
|
|
49
|
+
| 'port' | 4243 |
|
|
50
|
+
| 'blocking' | False |
|
|
51
|
+
| 'ssl.activate' | True |
|
|
52
|
+
| 'ssl.context.ciphers' | 'ALL' |
|
|
53
|
+
|
|
54
|
+
Given end preconditions
|
|
55
|
+
### PRECONDITIONS - END
|
|
56
|
+
|
|
57
|
+
# Start client
|
|
58
|
+
When start (socket client: CLIENT)
|
|
59
|
+
|
|
60
|
+
# Write data and verify result is identical
|
|
61
|
+
When write b'\x01\x02\n' (socket: CLIENT)
|
|
62
|
+
When await socket CLIENT receives a data (timeout: 10 s)
|
|
63
|
+
When DATA = read (socket: CLIENT)
|
|
64
|
+
Then DATA == b'\x01\x02\n'
|
|
65
|
+
|
|
66
|
+
When write b'\x11\x21\n' (socket: CLIENT)
|
|
67
|
+
When await socket CLIENT receives a data (timeout: 10 s)
|
|
68
|
+
When DATA = read (socket: CLIENT)
|
|
69
|
+
Then DATA == b'\x11\x21\n'
|
|
70
|
+
|
|
71
|
+
# Stop client
|
|
72
|
+
When stop (socket client: CLIENT)
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
@message_socket
|
|
77
|
+
@blocking_socket
|
|
78
|
+
Scenario: Message client (with underlying blocking connection)
|
|
79
|
+
|
|
80
|
+
### PRECONDITIONS - BEGIN
|
|
81
|
+
Given begin preconditions
|
|
82
|
+
|
|
83
|
+
# Create a message client
|
|
84
|
+
Given CLIENT = new message TCP socket client
|
|
85
|
+
| Name | Value |
|
|
86
|
+
| 'host' | 'tcpbin.com' |
|
|
87
|
+
| 'port' | 4243 |
|
|
88
|
+
| 'separator' | b'\n' |
|
|
89
|
+
| 'ssl.activate' | True |
|
|
90
|
+
| 'ssl.context.ciphers' | 'ALL' |
|
|
91
|
+
|
|
92
|
+
Given end preconditions
|
|
93
|
+
### PRECONDITIONS - END
|
|
94
|
+
|
|
95
|
+
# Start message client
|
|
96
|
+
When ensure SSL handshake is done (socket: CLIENT)
|
|
97
|
+
When start (socket client: CLIENT)
|
|
98
|
+
|
|
99
|
+
# Write data and verify result is identical
|
|
100
|
+
When write message b'\x01\x02' (socket: CLIENT)
|
|
101
|
+
When write message b'\x11\x21' (socket: CLIENT)
|
|
102
|
+
|
|
103
|
+
# Verify received messages
|
|
104
|
+
When await socket CLIENT receives messages (first timeout: 10 s ; window: 0.1 s)
|
|
105
|
+
When MESSAGES = received messages (socket: CLIENT)
|
|
106
|
+
Then MESSAGES is list
|
|
107
|
+
| b'\x01\x02' |
|
|
108
|
+
| b'\x11\x21' |
|
|
109
|
+
|
|
110
|
+
When MESSAGES_2 = received messages (socket: CLIENT)
|
|
111
|
+
Then MESSAGES_2 == MESSAGES
|
|
112
|
+
|
|
113
|
+
# Verify pop messages functionality
|
|
114
|
+
When MSG_1 = read message (socket: CLIENT)
|
|
115
|
+
Then MSG_1 == b'\x01\x02'
|
|
116
|
+
When MESSAGES_3 = received messages (socket: CLIENT)
|
|
117
|
+
Then MESSAGES_3 is list
|
|
118
|
+
| b'\x11\x21' |
|
|
119
|
+
|
|
120
|
+
When MSG_2 = read message (socket: CLIENT)
|
|
121
|
+
Then MSG_2 == b'\x11\x21'
|
|
122
|
+
When MESSAGES_4 = received messages (socket: CLIENT)
|
|
123
|
+
Then MESSAGES_4 is empty list
|
|
124
|
+
|
|
125
|
+
# Stop client
|
|
126
|
+
When stop (socket client: CLIENT)
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
@message_socket
|
|
131
|
+
@non_blocking_socket
|
|
132
|
+
Scenario: Message client (with underlying non-blocking connection)
|
|
133
|
+
|
|
134
|
+
### PRECONDITIONS - BEGIN
|
|
135
|
+
Given begin preconditions
|
|
136
|
+
|
|
137
|
+
# Create a message client
|
|
138
|
+
Given CLIENT = new message TCP socket client
|
|
139
|
+
| Name | Value |
|
|
140
|
+
| 'host' | 'tcpbin.com' |
|
|
141
|
+
| 'port' | 4243 |
|
|
142
|
+
| 'separator' | b'\n' |
|
|
143
|
+
| 'blocking' | False |
|
|
144
|
+
| 'ssl.activate' | True |
|
|
145
|
+
| 'ssl.context.ciphers' | 'ALL' |
|
|
146
|
+
|
|
147
|
+
Given end preconditions
|
|
148
|
+
### PRECONDITIONS - END
|
|
149
|
+
|
|
150
|
+
# Start message client
|
|
151
|
+
When ensure SSL handshake is done (socket: CLIENT)
|
|
152
|
+
When start (socket client: CLIENT)
|
|
153
|
+
|
|
154
|
+
# Write data and verify result is identical
|
|
155
|
+
When write message b'\x01\x02' (socket: CLIENT)
|
|
156
|
+
When write message b'\x11\x21' (socket: CLIENT)
|
|
157
|
+
|
|
158
|
+
# Verify received messages
|
|
159
|
+
When await socket CLIENT receives messages (first timeout: 10 s ; window: 0.1 s)
|
|
160
|
+
When MESSAGES = received messages (socket: CLIENT)
|
|
161
|
+
Then MESSAGES is list
|
|
162
|
+
| b'\x01\x02' |
|
|
163
|
+
| b'\x11\x21' |
|
|
164
|
+
|
|
165
|
+
When MESSAGES_2 = received messages (socket: CLIENT)
|
|
166
|
+
Then MESSAGES_2 == MESSAGES
|
|
167
|
+
|
|
168
|
+
# Verify pop messages functionality
|
|
169
|
+
When MSG_1 = read message (socket: CLIENT)
|
|
170
|
+
Then MSG_1 == b'\x01\x02'
|
|
171
|
+
When MESSAGES_3 = received messages (socket: CLIENT)
|
|
172
|
+
Then MESSAGES_3 is list
|
|
173
|
+
| b'\x11\x21' |
|
|
174
|
+
|
|
175
|
+
When MSG_2 = read message (socket: CLIENT)
|
|
176
|
+
Then MSG_2 == b'\x11\x21'
|
|
177
|
+
When MESSAGES_4 = received messages (socket: CLIENT)
|
|
178
|
+
Then MESSAGES_4 is empty list
|
|
179
|
+
|
|
180
|
+
# Stop client
|
|
181
|
+
When stop (socket client: CLIENT)
|
|
182
|
+
|
|
183
|
+
|
|
184
|
+
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
@testing_solution
|
|
2
|
+
@python
|
|
3
|
+
@socket
|
|
4
|
+
@tcpbin.com
|
|
5
|
+
@without_tls
|
|
6
|
+
Feature: Test python socket steps with tcpbin.com echo server
|
|
7
|
+
|
|
8
|
+
@blocking_socket
|
|
9
|
+
Scenario: Client with blocking connections
|
|
10
|
+
|
|
11
|
+
### PRECONDITIONS - BEGIN
|
|
12
|
+
Given begin preconditions
|
|
13
|
+
|
|
14
|
+
Given CLIENT = new TCP socket client
|
|
15
|
+
| Name | Value |
|
|
16
|
+
| 'host' | 'tcpbin.com' |
|
|
17
|
+
| 'port' | 4242 |
|
|
18
|
+
|
|
19
|
+
Given end preconditions
|
|
20
|
+
### PRECONDITIONS - END
|
|
21
|
+
|
|
22
|
+
# Write data and verify result is identical
|
|
23
|
+
When write b'test 1\n' (socket: CLIENT)
|
|
24
|
+
When DATA = read (socket: CLIENT)
|
|
25
|
+
Then DATA == b'test 1\n'
|
|
26
|
+
|
|
27
|
+
When write b'test 2\n' (socket: CLIENT)
|
|
28
|
+
When DATA = read (socket: CLIENT)
|
|
29
|
+
Then DATA == b'test 2\n'
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
@non_blocking_socket
|
|
34
|
+
Scenario: Client with non blocking connections
|
|
35
|
+
|
|
36
|
+
### PRECONDITIONS - BEGIN
|
|
37
|
+
Given begin preconditions
|
|
38
|
+
|
|
39
|
+
Given CLIENT = new TCP socket client
|
|
40
|
+
| Name | Value |
|
|
41
|
+
| 'host' | 'tcpbin.com' |
|
|
42
|
+
| 'port' | 4242 |
|
|
43
|
+
| 'blocking' | False |
|
|
44
|
+
|
|
45
|
+
Given end preconditions
|
|
46
|
+
### PRECONDITIONS - END
|
|
47
|
+
|
|
48
|
+
# Start message client
|
|
49
|
+
When start (socket client: CLIENT)
|
|
50
|
+
|
|
51
|
+
# Write data and verify result is identical
|
|
52
|
+
When write b'test 1\n' (socket: CLIENT)
|
|
53
|
+
When await socket CLIENT receives a data
|
|
54
|
+
When DATA = read (socket: CLIENT)
|
|
55
|
+
Then DATA == b'test 1\n'
|
|
56
|
+
|
|
57
|
+
When write b'test 2\n' (socket: CLIENT)
|
|
58
|
+
When await socket CLIENT receives a data (timeout: 10 s)
|
|
59
|
+
When DATA = read (socket: CLIENT)
|
|
60
|
+
Then DATA == b'test 2\n'
|
|
61
|
+
|
|
62
|
+
# Stop client
|
|
63
|
+
When stop (socket client: CLIENT)
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
@message_socket
|
|
68
|
+
@blocking_socket
|
|
69
|
+
Scenario: Message client with blocking connection
|
|
70
|
+
|
|
71
|
+
### PRECONDITIONS - BEGIN
|
|
72
|
+
Given begin preconditions
|
|
73
|
+
|
|
74
|
+
# Create a message client
|
|
75
|
+
Given CLIENT = new message TCP socket client
|
|
76
|
+
| Name | Value |
|
|
77
|
+
| 'host' | 'tcpbin.com' |
|
|
78
|
+
| 'port' | 4242 |
|
|
79
|
+
| 'separator' | b'\n' |
|
|
80
|
+
|
|
81
|
+
Given end preconditions
|
|
82
|
+
### PRECONDITIONS - END
|
|
83
|
+
|
|
84
|
+
# Start message client
|
|
85
|
+
When start (socket client: CLIENT)
|
|
86
|
+
|
|
87
|
+
# Write data and verify result is identical
|
|
88
|
+
When write message b'\x01\x02' (socket: CLIENT)
|
|
89
|
+
When write message b'\x11\x21' (socket: CLIENT)
|
|
90
|
+
|
|
91
|
+
# Verify received messages
|
|
92
|
+
When await socket CLIENT receives messages (first timeout: 10 s ; window: 0.1 s)
|
|
93
|
+
When MESSAGES = received messages (socket: CLIENT)
|
|
94
|
+
Then MESSAGES is list
|
|
95
|
+
| b'\x01\x02' |
|
|
96
|
+
| b'\x11\x21' |
|
|
97
|
+
|
|
98
|
+
When MESSAGES_2 = received messages (socket: CLIENT)
|
|
99
|
+
Then MESSAGES_2 == MESSAGES
|
|
100
|
+
|
|
101
|
+
# Verify pop messages functionality
|
|
102
|
+
When MSG_1 = read message (socket: CLIENT)
|
|
103
|
+
Then MSG_1 == b'\x01\x02'
|
|
104
|
+
When MESSAGES_3 = received messages (socket: CLIENT)
|
|
105
|
+
Then MESSAGES_3 is list
|
|
106
|
+
| b'\x11\x21' |
|
|
107
|
+
|
|
108
|
+
When MSG_2 = read message (socket: CLIENT)
|
|
109
|
+
Then MSG_2 == b'\x11\x21'
|
|
110
|
+
When MESSAGES_4 = received messages (socket: CLIENT)
|
|
111
|
+
Then MESSAGES_4 is empty list
|
|
112
|
+
|
|
113
|
+
# Stop server & client
|
|
114
|
+
When stop (socket client: CLIENT)
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
@message_socket
|
|
119
|
+
@non_blocking_socket
|
|
120
|
+
Scenario: Message client with non blocking connection
|
|
121
|
+
|
|
122
|
+
### PRECONDITIONS - BEGIN
|
|
123
|
+
Given begin preconditions
|
|
124
|
+
|
|
125
|
+
# Create a message client
|
|
126
|
+
Given CLIENT = new message TCP socket client
|
|
127
|
+
| Name | Value |
|
|
128
|
+
| 'host' | 'tcpbin.com' |
|
|
129
|
+
| 'port' | 4242 |
|
|
130
|
+
| 'separator' | b'\n' |
|
|
131
|
+
| 'blocking' | False |
|
|
132
|
+
|
|
133
|
+
Given end preconditions
|
|
134
|
+
### PRECONDITIONS - END
|
|
135
|
+
|
|
136
|
+
# Start message client
|
|
137
|
+
When start (socket client: CLIENT)
|
|
138
|
+
|
|
139
|
+
# Write data and verify result is identical
|
|
140
|
+
When write message b'\x01\x02' (socket: CLIENT)
|
|
141
|
+
When write message b'\x11\x21' (socket: CLIENT)
|
|
142
|
+
|
|
143
|
+
# Verify received messages
|
|
144
|
+
When await socket CLIENT receives messages (first timeout: 10 s ; window: 0.1 s)
|
|
145
|
+
When MESSAGES = received messages (socket: CLIENT)
|
|
146
|
+
Then MESSAGES is list
|
|
147
|
+
| b'\x01\x02' |
|
|
148
|
+
| b'\x11\x21' |
|
|
149
|
+
|
|
150
|
+
When MESSAGES_2 = received messages (socket: CLIENT)
|
|
151
|
+
Then MESSAGES_2 == MESSAGES
|
|
152
|
+
|
|
153
|
+
# Verify pop messages functionality
|
|
154
|
+
When MSG_1 = read message (socket: CLIENT)
|
|
155
|
+
Then MSG_1 == b'\x01\x02'
|
|
156
|
+
When MESSAGES_3 = received messages (socket: CLIENT)
|
|
157
|
+
Then MESSAGES_3 is list
|
|
158
|
+
| b'\x11\x21' |
|
|
159
|
+
|
|
160
|
+
When MSG_2 = read message (socket: CLIENT)
|
|
161
|
+
Then MSG_2 == b'\x11\x21'
|
|
162
|
+
When MESSAGES_4 = received messages (socket: CLIENT)
|
|
163
|
+
Then MESSAGES_4 is empty list
|
|
164
|
+
|
|
165
|
+
# Stop client
|
|
166
|
+
When stop (socket client: CLIENT)
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
|
|
@@ -33,7 +33,7 @@ Feature: Test RabbitMQ module
|
|
|
33
33
|
|
|
34
34
|
When publish 'test message' (RMQ publisher: PUBLISHER)
|
|
35
35
|
|
|
36
|
-
When
|
|
36
|
+
When await consumer CONSUMER receives messages (first timeout: 0.1 s)
|
|
37
37
|
Then consumer CONSUMER received 1 string messages:
|
|
38
38
|
| 'test message' |
|
|
39
39
|
|
|
@@ -74,7 +74,7 @@ Feature: Test RabbitMQ module
|
|
|
74
74
|
When publish 'test message 4' (RMQ publisher: PUBLISHER)
|
|
75
75
|
When publish 'test message 5' (RMQ publisher: PUBLISHER)
|
|
76
76
|
|
|
77
|
-
When
|
|
77
|
+
When await consumer CONSUMER receives messages (first timeout: 1 s)
|
|
78
78
|
Then consumer CONSUMER received 5 string messages:
|
|
79
79
|
| 'test message 1' |
|
|
80
80
|
| 'test message 2' |
|
|
@@ -127,7 +127,7 @@ Feature: Test RabbitMQ module
|
|
|
127
127
|
When publish 'test message 4' (RMQ publisher: PUBLISHER)
|
|
128
128
|
When publish 'test message 5' (RMQ publisher: PUBLISHER)
|
|
129
129
|
|
|
130
|
-
When
|
|
130
|
+
When await consumer CONSUMER receives messages (first timeout: 1 s)
|
|
131
131
|
Then consumer CONSUMER received 5 string messages:
|
|
132
132
|
| 'test message 1' |
|
|
133
133
|
| 'test message 2' |
|
|
@@ -195,7 +195,7 @@ Feature: Test RabbitMQ module
|
|
|
195
195
|
|
|
196
196
|
When publish 'test message tmp 3' (RMQ publisher: PUBLISHER_2)
|
|
197
197
|
|
|
198
|
-
When
|
|
198
|
+
When await consumer CONSUMER receives messages (first timeout: 1 s)
|
|
199
199
|
Then consumer CONSUMER received 5 string messages:
|
|
200
200
|
| 'test message 1' |
|
|
201
201
|
| 'test message 2' |
|
|
@@ -264,7 +264,7 @@ Feature: Test RabbitMQ module
|
|
|
264
264
|
|
|
265
265
|
When publish 'test message tmp 3' (RMQ publisher: PUBLISHER_2)
|
|
266
266
|
|
|
267
|
-
When
|
|
267
|
+
When await consumer CONSUMER receives messages (first timeout: 1 s)
|
|
268
268
|
Then consumer CONSUMER received 5 string messages:
|
|
269
269
|
| 'test message 1' |
|
|
270
270
|
| 'test message 2' |
|
|
@@ -335,7 +335,7 @@ Feature: Test RabbitMQ module
|
|
|
335
335
|
|
|
336
336
|
When publish 'test message tmp 3' (RMQ publisher: PUBLISHER_2)
|
|
337
337
|
|
|
338
|
-
When
|
|
338
|
+
When await consumer CONSUMER receives messages (first timeout: 1 s)
|
|
339
339
|
Then consumer CONSUMER received 5 string messages:
|
|
340
340
|
| 'test message 1' |
|
|
341
341
|
| 'test message 2' |
|
|
@@ -421,9 +421,9 @@ Feature: Test RabbitMQ module
|
|
|
421
421
|
When publish 'test message 3.3' (RMQ publisher: PUBLISHER_3)
|
|
422
422
|
When publish 'test message 2.3' (RMQ publisher: PUBLISHER_2)
|
|
423
423
|
|
|
424
|
-
When
|
|
425
|
-
When
|
|
426
|
-
When
|
|
424
|
+
When await consumer CONSUMER_1 receives messages (first timeout: 1 s)
|
|
425
|
+
When await consumer CONSUMER_2 receives messages (first timeout: 0.1 s)
|
|
426
|
+
When await consumer CONSUMER_3 receives messages (first timeout: 0.1 s)
|
|
427
427
|
|
|
428
428
|
Then consumer CONSUMER_1 received 3 string messages:
|
|
429
429
|
| 'test message 1.1' |
|