holado 0.2.8__py3-none-any.whl → 0.4.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.

Files changed (110) hide show
  1. holado/common/handlers/undefined.py +7 -1
  2. {holado-0.2.8.dist-info → holado-0.4.0.dist-info}/METADATA +4 -1
  3. {holado-0.2.8.dist-info → holado-0.4.0.dist-info}/RECORD +108 -101
  4. holado_ais/ais/ais_messages.py +97 -6
  5. holado_ais/tests/behave/steps/ais/ais_manager_steps.py +1 -1
  6. holado_ais/tests/behave/steps/ais/ais_messages_steps.py +45 -6
  7. holado_binary/ipc/bit_series.py +3 -3
  8. holado_binary/tests/behave/steps/ipc/binary_steps.py +1 -1
  9. holado_binary/tests/behave/steps/ipc/bit_series_steps.py +4 -3
  10. holado_context/tests/behave/steps/private/common/context_steps.py +1 -1
  11. holado_core/common/resource/persisted_data_manager.py +13 -16
  12. holado_core/common/resource/resource_manager.py +10 -10
  13. holado_core/common/tables/converters/table_converter.py +47 -9
  14. holado_core/common/tables/table_manager.py +6 -7
  15. holado_core/common/tables/table_with_header.py +6 -0
  16. holado_core/tests/behave/steps/common/common_steps.py +2 -1
  17. holado_core/tests/behave/steps/common/config_steps.py +1 -1
  18. holado_core/tests/behave/steps/common/resource_steps.py +1 -1
  19. holado_core/tests/behave/steps/common/tables_steps.py +18 -2
  20. holado_data/data/generator/generator_manager.py +39 -0
  21. holado_data/tests/behave/steps/data/generator_steps.py +1 -1
  22. holado_data/tests/behave/steps/tools/utils_steps.py +1 -2
  23. holado_db/tests/behave/steps/tools/db/db_client_steps.py +1 -1
  24. holado_db/tests/behave/steps/tools/db/postgresql_client_steps.py +1 -1
  25. holado_db/tests/behave/steps/tools/db/sqlite_client_steps.py +1 -1
  26. holado_db/tools/db/clients/base/db_client.py +81 -28
  27. holado_db/tools/db/clients/postgresql/postgresql_client.py +17 -7
  28. holado_db/tools/db/query/base/query_builder.py +58 -7
  29. holado_db/tools/db/query/pypika/pypika_query_builder.py +73 -21
  30. holado_docker/tests/behave/steps/tools/docker_steps.py +1 -1
  31. holado_grpc/tests/behave/steps/api/grpc_client_steps.py +1 -1
  32. holado_grpc/tests/behave/steps/private/api/grpc_steps.py +1 -1
  33. holado_json/tests/behave/steps/ipc/json_steps.py +1 -1
  34. holado_keycloak/tests/behave/steps/tools/keycloak_client_steps.py +1 -1
  35. holado_multitask/tests/behave/steps/multiprocessing_steps.py +1 -1
  36. holado_multitask/tests/behave/steps/multithreading_steps.py +1 -1
  37. holado_protobuf/ipc/protobuf/types/google/protobuf.py +1 -1
  38. holado_protobuf/tests/behave/steps/ipc/protobuf_steps.py +1 -1
  39. holado_python/common/tools/datetime.py +31 -12
  40. holado_python/standard_library/socket/blocking_socket.py +37 -24
  41. holado_python/standard_library/socket/message_socket.py +11 -3
  42. holado_python/standard_library/socket/non_blocking_socket.py +24 -24
  43. holado_python/standard_library/socket/socket.py +132 -19
  44. holado_python/standard_library/ssl/resources/certificates/NOTES.txt +1 -1
  45. holado_python/standard_library/ssl/resources/certificates/rootCACert.pem +24 -0
  46. holado_python/standard_library/ssl/resources/certificates/tcpbin.crt +21 -0
  47. holado_python/standard_library/ssl/resources/certificates/tcpbin.key +28 -0
  48. holado_python/standard_library/ssl/ssl.py +138 -21
  49. holado_python/tests/behave/steps/convert_steps.py +1 -1
  50. holado_python/tests/behave/steps/iterable_steps.py +1 -1
  51. holado_python/tests/behave/steps/standard_library/csv_steps.py +1 -1
  52. holado_python/tests/behave/steps/standard_library/datetime_steps.py +1 -1
  53. holado_python/tests/behave/steps/standard_library/hashlib_steps.py +2 -2
  54. holado_python/tests/behave/steps/standard_library/multiprocessing_steps.py +1 -1
  55. holado_python/tests/behave/steps/standard_library/queue_steps.py +1 -1
  56. holado_python/tests/behave/steps/standard_library/socket_steps.py +132 -18
  57. holado_python/tests/behave/steps/standard_library/ssl_steps.py +87 -16
  58. holado_rabbitmq/tests/behave/steps/tools/rabbitmq_client_steps.py +48 -20
  59. holado_rabbitmq/tests/behave/steps/tools/rabbitmq_server_steps.py +1 -1
  60. holado_rabbitmq/tools/rabbitmq/rabbitmq_client.py +19 -13
  61. holado_rabbitmq/tools/rabbitmq/rabbitmq_manager.py +2 -29
  62. holado_redis/tests/behave/steps/tools/redis_client_steps.py +1 -1
  63. holado_rest/api/rest/rest_client.py +18 -1
  64. holado_rest/api/rest/rest_manager.py +5 -0
  65. holado_rest/tests/behave/steps/api/rest_client_steps.py +52 -11
  66. holado_rest/tests/behave/steps/private/api/rest_steps.py +1 -1
  67. holado_s3/tests/behave/steps/private/tools/s3_steps.py +1 -1
  68. holado_s3/tests/behave/steps/tools/s3_client_steps.py +1 -1
  69. holado_s3/tests/behave/steps/tools/s3_server_steps.py +1 -1
  70. holado_scripting/tests/behave/steps/common/tools/variable_convert_steps.py +3 -2
  71. holado_scripting/tests/behave/steps/common/tools/variable_new_steps.py +1 -1
  72. holado_scripting/tests/behave/steps/common/tools/variable_steps.py +1 -1
  73. holado_scripting/tests/behave/steps/common/tools/variable_verify_steps.py +1 -1
  74. holado_scripting/tests/behave/steps/scenario/function_steps.py +1 -1
  75. holado_scripting/tests/behave/steps/scenario/if_steps.py +1 -1
  76. holado_scripting/tests/behave/steps/scenario/loop_steps.py +1 -1
  77. holado_sftp/tests/behave/steps/private/tools/sftp_steps.py +1 -1
  78. holado_sftp/tests/behave/steps/tools/sftp_client_steps.py +1 -1
  79. holado_sftp/tests/behave/steps/tools/sftp_server_steps.py +1 -1
  80. holado_swagger/tests/behave/steps/swagger_hub/mockserver_steps.py +1 -1
  81. holado_system/system/command/command.py +14 -9
  82. holado_system/tests/behave/steps/system/commands_steps.py +1 -1
  83. holado_system/tests/behave/steps/system/file_steps.py +1 -1
  84. holado_system/tests/behave/steps/system/system_steps.py +1 -1
  85. holado_test/scenario/step_tools.py +1 -1
  86. holado_test/scenario/tester_tools.py +6 -3
  87. holado_test/tests/behave/steps/scenario/exception_steps.py +1 -1
  88. holado_test/tests/behave/steps/scenario/scenario_steps.py +1 -1
  89. holado_test/tests/behave/steps/scenario/tester_steps.py +4 -4
  90. holado_value/common/tables/converters/value_table_converter.py +52 -8
  91. holado_value/common/tables/value_table_manager.py +0 -10
  92. holado_ws/tests/behave/steps/api/web_service_steps.py +1 -1
  93. holado_yaml/tests/behave/steps/yaml_steps.py +1 -1
  94. holado_yaml/yaml/yaml_manager.py +2 -2
  95. test_holado/features/NonReg/common/tables/table.feature +30 -24
  96. test_holado/features/NonReg/holado_ais/ais_message-bitarray_to_nmea.feature +1 -1
  97. test_holado/features/NonReg/holado_python/standard_library/socket/local_echo_server/socket_reset.feature +191 -0
  98. test_holado/features/NonReg/holado_python/standard_library/{socket_with_ssl.feature → socket/local_echo_server/socket_with_tls_and_verify.feature} +53 -30
  99. test_holado/features/NonReg/holado_python/standard_library/socket/local_echo_server/socket_with_tls_without_verify.feature +299 -0
  100. test_holado/features/NonReg/holado_python/standard_library/{socket.feature → socket/local_echo_server/socket_without_tls.feature} +2 -2
  101. test_holado/features/NonReg/holado_python/standard_library/socket/tcpbin.com/socket_with_mtls.feature +214 -0
  102. test_holado/features/NonReg/holado_python/standard_library/socket/tcpbin.com/socket_with_tls.feature +184 -0
  103. test_holado/features/NonReg/holado_python/standard_library/socket/tcpbin.com/socket_without_tls.feature +169 -0
  104. test_holado/features/NonReg/tools/RabbitMQ.feature +9 -9
  105. test_holado/features/NonReg/tools/RabbitMQ_steps.feature +8 -8
  106. test_holado/logging.conf +5 -3
  107. holado_core/common/transport/__init__.py +0 -0
  108. holado_core/common/transport/crc.py +0 -40
  109. {holado-0.2.8.dist-info → holado-0.4.0.dist-info}/WHEEL +0 -0
  110. {holado-0.2.8.dist-info → holado-0.4.0.dist-info}/licenses/LICENSE +0 -0
@@ -0,0 +1,191 @@
1
+ @testing_solution
2
+ @python
3
+ @socket
4
+ Feature: Test python socket reset steps
5
+
6
+ @blocking_socket
7
+ @reset_data
8
+ Scenario: Reset received data (client with blocking connections)
9
+
10
+ ### PRECONDITIONS - BEGIN
11
+ Given begin preconditions
12
+
13
+ Given PORT = first available anonymous port
14
+ Given SERVER = new echo TCP socket server
15
+ | Name | Value |
16
+ | 'host' | '127.0.0.1' |
17
+ | 'port' | PORT |
18
+
19
+ Given CLIENT = new TCP socket client
20
+ | Name | Value |
21
+ | 'host' | '127.0.0.1' |
22
+ | 'port' | PORT |
23
+
24
+ Given end preconditions
25
+ ### PRECONDITIONS - END
26
+
27
+ # Start server & client
28
+ When start (socket server: SERVER)
29
+ When start (socket client: CLIENT)
30
+
31
+ # Write data and verify received data size
32
+ When write b'\x01\x02' (socket: CLIENT)
33
+
34
+ When await socket CLIENT receives data
35
+ When SIZE = size of received data (socket: CLIENT)
36
+ Then SIZE > 0
37
+
38
+ # Reset data and verify
39
+ Given reset stored received data in socket CLIENT
40
+ When SIZE = size of received data (socket: CLIENT)
41
+ Then SIZE == 0
42
+
43
+ # Stop server & client
44
+ #When stop (socket server: SERVER)
45
+ When stop (socket client: CLIENT)
46
+
47
+
48
+
49
+ @non_blocking_socket
50
+ @reset_data
51
+ Scenario: Reset received data (client with non blocking connections)
52
+
53
+ ### PRECONDITIONS - BEGIN
54
+ Given begin preconditions
55
+
56
+ Given PORT = first available anonymous port
57
+ Given SERVER = new echo TCP socket server
58
+ | Name | Value |
59
+ | 'host' | '127.0.0.1' |
60
+ | 'port' | PORT |
61
+
62
+ Given CLIENT = new TCP socket client
63
+ | Name | Value |
64
+ | 'host' | '127.0.0.1' |
65
+ | 'port' | PORT |
66
+ | 'blocking' | False |
67
+
68
+ Given end preconditions
69
+ ### PRECONDITIONS - END
70
+
71
+ # Start server & client
72
+ When start (socket server: SERVER)
73
+ When start (socket client: CLIENT)
74
+
75
+ # Write data and verify received data size
76
+ When write b'\x01\x02' (socket: CLIENT)
77
+
78
+ When await socket CLIENT receives data
79
+ When SIZE = size of received data (socket: CLIENT)
80
+ Then SIZE > 0
81
+
82
+ # Reset data and verify
83
+ Given reset stored received data in socket CLIENT
84
+ When SIZE = size of received data (socket: CLIENT)
85
+ Then SIZE == 0
86
+
87
+ # Stop server & client
88
+ #When stop (socket server: SERVER)
89
+ When stop (socket client: CLIENT)
90
+
91
+
92
+
93
+ @message_socket
94
+ @blocking_socket
95
+ @reset_messages
96
+ Scenario: Reset received messages (client with blocking connections)
97
+
98
+ ### PRECONDITIONS - BEGIN
99
+ Given begin preconditions
100
+
101
+ # Use echo server with a blocking connection
102
+ Given PORT = first available anonymous port
103
+ Given SERVER = new echo TCP socket server
104
+ | Name | Value |
105
+ | 'host' | '127.0.0.1' |
106
+ | 'port' | PORT |
107
+
108
+ # Create a message client
109
+ Given CLIENT = new message TCP socket client
110
+ | Name | Value |
111
+ | 'host' | '127.0.0.1' |
112
+ | 'port' | PORT |
113
+ | 'separator' | b'\n' |
114
+
115
+ Given end preconditions
116
+ ### PRECONDITIONS - END
117
+
118
+ # Start echo server & message client
119
+ When start (socket server: SERVER)
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 number of received messages
127
+ When await socket CLIENT receives messages (window: 0.1 s)
128
+ When NB_MSG = number of received messages (socket: CLIENT)
129
+ Then NB_MSG == 2
130
+
131
+ # Reset data and verify
132
+ Given reset stored received messages in socket CLIENT
133
+ When NB_MSG = number of received messages (socket: CLIENT)
134
+ Then NB_MSG == 0
135
+
136
+ # Stop server & client
137
+ #When stop (socket server: SERVER)
138
+ When stop (socket client: CLIENT)
139
+
140
+
141
+
142
+ @message_socket
143
+ @non_blocking_socket
144
+ @reset_messages
145
+ Scenario: Reset received messages (client with non blocking connections)
146
+
147
+ ### PRECONDITIONS - BEGIN
148
+ Given begin preconditions
149
+
150
+ # Use echo server with a blocking connection
151
+ Given PORT = first available anonymous port
152
+ Given SERVER = new echo TCP socket server
153
+ | Name | Value |
154
+ | 'host' | '127.0.0.1' |
155
+ | 'port' | PORT |
156
+
157
+ # Create a message client
158
+ Given CLIENT = new message TCP socket client
159
+ | Name | Value |
160
+ | 'host' | '127.0.0.1' |
161
+ | 'port' | PORT |
162
+ | 'separator' | b'\n' |
163
+ | 'blocking' | False |
164
+
165
+ Given end preconditions
166
+ ### PRECONDITIONS - END
167
+
168
+ # Start echo server & message client
169
+ When start (socket server: SERVER)
170
+ When start (socket client: CLIENT)
171
+
172
+ # Write data and verify result is identical
173
+ When write message b'\x01\x02' (socket: CLIENT)
174
+ When write message b'\x11\x21' (socket: CLIENT)
175
+
176
+ # Verify number of received messages
177
+ When await socket CLIENT receives messages (window: 0.1 s)
178
+ When NB_MSG = number of received messages (socket: CLIENT)
179
+ Then NB_MSG == 2
180
+
181
+ # Reset data and verify
182
+ Given reset stored received messages in socket CLIENT
183
+ When NB_MSG = number of received messages (socket: CLIENT)
184
+ Then NB_MSG == 0
185
+
186
+ # Stop server & client
187
+ #When stop (socket server: SERVER)
188
+ When stop (socket client: CLIENT)
189
+
190
+
191
+
@@ -2,7 +2,8 @@
2
2
  @python
3
3
  @socket
4
4
  @ssl
5
- Feature: Test python socket steps with ssl
5
+ @with_cert_file
6
+ Feature: Test python socket steps with ssl and cert files
6
7
 
7
8
  @blocking_socket
8
9
  Scenario: Server and client with blocking connections
@@ -10,35 +11,42 @@ Feature: Test python socket steps with ssl
10
11
  ### PRECONDITIONS - BEGIN
11
12
  Given begin preconditions
12
13
 
13
- # Get files of a self-signed certificate
14
- Given CERTFILE_PATH = certfile path for localhost
15
- Given KEYFILE_PATH = keyfile path for localhost
14
+ # Generate key files
15
+ Given CERTFILE_PATH = path to file with name 'localhost.crt'
16
+ Given KEYFILE_PATH = path to file with name 'localhost.key'
17
+ Given generate new self-signed key files for localhost
18
+ | Name | Value |
19
+ | 'public_key_path' | CERTFILE_PATH |
20
+ | 'private_key_path' | KEYFILE_PATH |
21
+ | 'algorithm' | 'rsa:2048' |
16
22
 
17
23
  # Use echo server with a blocking connection
18
24
  Given PORT = first available anonymous port
19
25
  Given SERVER = new echo TCP socket server
20
- | Name | Value |
21
- | 'host' | 'localhost' |
22
- | 'port' | PORT |
23
- | 'ssl.activate' | True |
24
- | 'ssl.context.ciphers' | 'SHA256' |
25
- | 'ssl.context.load_cert_chain.certfile' | CERTFILE_PATH |
26
- | 'ssl.context.load_cert_chain.keyfile' | KEYFILE_PATH |
26
+ | Name | Value |
27
+ | 'host' | 'localhost' |
28
+ | 'port' | PORT |
29
+ | 'ssl.activate' | True |
30
+ | 'ssl.context.ciphers' | 'SHA256' |
31
+ | 'ssl.context.load_cert_chain.certfile' | CERTFILE_PATH |
32
+ | 'ssl.context.load_cert_chain.keyfile' | KEYFILE_PATH |
27
33
 
28
34
  # Create a TCP client with a blocking connection
29
35
  Given CLIENT = new TCP socket client
30
- | Name | Value |
31
- | 'host' | 'localhost' |
32
- | 'port' | PORT |
33
- | 'ssl.activate' | True |
34
- | 'ssl.context.check_hostname' | True |
35
- | 'ssl.context.load_verify_locations.cafile' | CERTFILE_PATH |
36
+ | Name | Value |
37
+ | 'host' | 'localhost' |
38
+ | 'port' | PORT |
39
+ | 'ssl.activate' | True |
40
+ | 'ssl.context.ciphers' | 'SHA256' |
41
+ | 'ssl.context.check_hostname' | True |
42
+ | 'ssl.context.load_verify_locations.cafile' | CERTFILE_PATH |
36
43
 
37
44
  Given end preconditions
38
45
  ### PRECONDITIONS - END
39
46
 
40
47
  # Start echo server
41
48
  When start (socket server: SERVER)
49
+ When ensure SSL handshake is done (socket: CLIENT)
42
50
 
43
51
  # Write data and verify result is identical
44
52
  When write b'\x01\x02' (socket: CLIENT)
@@ -59,9 +67,14 @@ Feature: Test python socket steps with ssl
59
67
  ### PRECONDITIONS - BEGIN
60
68
  Given begin preconditions
61
69
 
62
- # Get files of a self-signed certificate
63
- Given CERTFILE_PATH = certfile path for localhost
64
- Given KEYFILE_PATH = keyfile path for localhost
70
+ # Generate key files
71
+ Given CERTFILE_PATH = path to file with name 'localhost.crt'
72
+ Given KEYFILE_PATH = path to file with name 'localhost.key'
73
+ Given generate new self-signed key files for localhost
74
+ | Name | Value |
75
+ | 'public_key_path' | CERTFILE_PATH |
76
+ | 'private_key_path' | KEYFILE_PATH |
77
+ | 'algorithm' | 'rsa:2048' |
65
78
 
66
79
  # Use echo server with a blocking connection
67
80
  Given PORT = first available anonymous port
@@ -93,12 +106,12 @@ Feature: Test python socket steps with ssl
93
106
 
94
107
  # Write data and verify result is identical
95
108
  When write b'\x01\x02' (socket: CLIENT)
96
- When wait socket CLIENT stops to receive data (window: 0.1 s)
109
+ When await socket CLIENT receives data (window: 0.1 s)
97
110
  When DATA = read (socket: CLIENT)
98
111
  Then DATA == b'\x01\x02'
99
112
 
100
113
  When write b'\x11\x21' (socket: CLIENT)
101
- When wait socket CLIENT stops to receive data (window: 0.1 s)
114
+ When await socket CLIENT receives data (window: 0.1 s)
102
115
  When DATA = read (socket: CLIENT)
103
116
  Then DATA == b'\x11\x21'
104
117
 
@@ -115,9 +128,14 @@ Feature: Test python socket steps with ssl
115
128
  ### PRECONDITIONS - BEGIN
116
129
  Given begin preconditions
117
130
 
118
- # Get files of a self-signed certificate
119
- Given CERTFILE_PATH = certfile path for localhost
120
- Given KEYFILE_PATH = keyfile path for localhost
131
+ # Generate key files
132
+ Given CERTFILE_PATH = path to file with name 'localhost.crt'
133
+ Given KEYFILE_PATH = path to file with name 'localhost.key'
134
+ Given generate new self-signed key files for localhost
135
+ | Name | Value |
136
+ | 'public_key_path' | CERTFILE_PATH |
137
+ | 'private_key_path' | KEYFILE_PATH |
138
+ | 'algorithm' | 'rsa:2048' |
121
139
 
122
140
  # Use echo server with a blocking connection
123
141
  Given PORT = first available anonymous port
@@ -153,7 +171,7 @@ Feature: Test python socket steps with ssl
153
171
  When write message b'\x11\x21' (socket: CLIENT)
154
172
 
155
173
  # Verify received messages
156
- When wait socket CLIENT stops to receive messages (window: 0.1 s)
174
+ When await socket CLIENT receives messages (window: 0.1 s)
157
175
  When MESSAGES = received messages (socket: CLIENT)
158
176
  Then MESSAGES is list
159
177
  | b'\x01\x02' |
@@ -188,9 +206,14 @@ Feature: Test python socket steps with ssl
188
206
  ### PRECONDITIONS - BEGIN
189
207
  Given begin preconditions
190
208
 
191
- # Get files of a self-signed certificate
192
- Given CERTFILE_PATH = certfile path for localhost
193
- Given KEYFILE_PATH = keyfile path for localhost
209
+ # Generate key files
210
+ Given CERTFILE_PATH = path to file with name 'localhost.crt'
211
+ Given KEYFILE_PATH = path to file with name 'localhost.key'
212
+ Given generate new self-signed key files for localhost
213
+ | Name | Value |
214
+ | 'public_key_path' | CERTFILE_PATH |
215
+ | 'private_key_path' | KEYFILE_PATH |
216
+ | 'algorithm' | 'rsa:2048' |
194
217
 
195
218
  # Use echo server with a blocking connection
196
219
  Given PORT = first available anonymous port
@@ -227,7 +250,7 @@ Feature: Test python socket steps with ssl
227
250
  When write message b'\x11\x21' (socket: CLIENT)
228
251
 
229
252
  # Verify received messages
230
- When wait socket CLIENT stops to receive messages (window: 0.1 s)
253
+ When await socket CLIENT receives messages (window: 0.1 s)
231
254
  When MESSAGES = received messages (socket: CLIENT)
232
255
  Then MESSAGES is list
233
256
  | b'\x01\x02' |
@@ -0,0 +1,299 @@
1
+ @testing_solution
2
+ @python
3
+ @socket
4
+ @ssl
5
+ @without_cert_file
6
+ Feature: Test python socket steps with ssl, server with self-signed keys, and client doesn't verify certificate
7
+
8
+ @blocking_socket
9
+ Scenario: Server and client with blocking connections
10
+
11
+ ### PRECONDITIONS - BEGIN
12
+ Given begin preconditions
13
+
14
+ # Get certificate
15
+ #Given CACERTS_PATH = default CA certs file path
16
+ #Given CACERTS_PATH = CA certs file path (from certifi package)
17
+ #Given CERTS_PATH = default certs directory path
18
+
19
+ # Generate key files
20
+ Given CERTFILE_PATH = path to file with name 'localhost.crt'
21
+ Given KEYFILE_PATH = path to file with name 'localhost.key'
22
+ Given generate new self-signed key files for localhost
23
+ | Name | Value |
24
+ | 'public_key_path' | CERTFILE_PATH |
25
+ | 'private_key_path' | KEYFILE_PATH |
26
+ | 'algorithm' | 'rsa:2048' |
27
+
28
+ # Use echo server with a blocking connection
29
+ Given PORT = first available anonymous port
30
+ Given SERVER = new echo TCP socket server
31
+ | Name | Value |
32
+ | 'host' | 'localhost' |
33
+ | 'port' | PORT |
34
+ | 'ssl.activate' | True |
35
+ #| 'ssl.create_default_context.cafile' | CACERTS_PATH |
36
+ #| 'ssl.create_default_context.capath' | CERTS_PATH |
37
+ | 'ssl.context.ciphers' | 'ALL' |
38
+ #| 'ssl.context.ciphers' | '@SECLEVEL=2:ECDH+AESGCM:ECDH+CHACHA20:ECDH+AES:DHE+AES:AESGCM:!aNULL:!eNULL:!aDSS:!SHA1:!AESCCM:!PSK' |
39
+ #| 'ssl.context.ciphers' | 'AES256-GCM-SHA384' |
40
+ #| 'ssl.context.ciphers' | 'DEFAULT' |
41
+ #| 'ssl.context.ciphers' | 'OPENSSL_CIPHERS' |
42
+ #| 'ssl.context.ciphers' | '@SECLEVEL=1:ALL' |
43
+ | 'ssl.context.load_cert_chain.certfile' | CERTFILE_PATH |
44
+ | 'ssl.context.load_cert_chain.keyfile' | KEYFILE_PATH |
45
+ #| 'ssl.context.minimum_version' | ssl.TLSVersion.TLSv1_2 |
46
+
47
+ # Create a TCP client with a blocking connection
48
+ Given CLIENT = new TCP socket client
49
+ | Name | Value |
50
+ | 'host' | 'localhost' |
51
+ | 'port' | PORT |
52
+ | 'ssl.activate' | True |
53
+ #| 'ssl.create_default_context.cafile' | CERTFILE_PATH |
54
+ | 'ssl.context.ciphers' | 'ALL' |
55
+ #| 'ssl.context.ciphers' | '@SECLEVEL=2:ECDH+AESGCM:ECDH+CHACHA20:ECDH+AES:DHE+AES:AESGCM:!aNULL:!eNULL:!aDSS:!SHA1:!AESCCM:!PSK' |
56
+ #| 'ssl.context.ciphers' | 'AES256-GCM-SHA384' |
57
+ #| 'ssl.context.ciphers' | 'DEFAULT' |
58
+ #| 'ssl.context.ciphers' | 'OPENSSL_CIPHERS' |
59
+ #| 'ssl.context.ciphers' | '@SECLEVEL=1:ALL' |
60
+ #| 'ssl.context.minimum_version' | ssl.TLSVersion.TLSv1_2 |
61
+ | 'ssl.context.check_hostname' | False |
62
+ | 'ssl.context.verify_mode' | ssl.CERT_NONE |
63
+ #| 'ssl.context.load_verify_locations.cafile' | CERTFILE_PATH |
64
+
65
+ Given end preconditions
66
+ ### PRECONDITIONS - END
67
+
68
+ # Start echo server
69
+ When start (socket server: SERVER)
70
+ When ensure SSL handshake is done (socket: CLIENT)
71
+
72
+ # Write data and verify result is identical
73
+ When write b'\x01\x02' (socket: CLIENT)
74
+ When DATA = read (socket: CLIENT)
75
+ Then DATA == b'\x01\x02'
76
+
77
+ When write b'\x11\x21' (socket: CLIENT)
78
+ When DATA = read (socket: CLIENT)
79
+ Then DATA == b'\x11\x21'
80
+
81
+ # Stop server
82
+ #When stop (socket server: SERVER)
83
+
84
+
85
+ @non_blocking_socket
86
+ Scenario: Server and client with non blocking connection
87
+
88
+ ### PRECONDITIONS - BEGIN
89
+ Given begin preconditions
90
+
91
+ # Generate key files
92
+ Given CERTFILE_PATH = path to file with name 'localhost.crt'
93
+ Given KEYFILE_PATH = path to file with name 'localhost.key'
94
+ Given generate new self-signed key files for localhost
95
+ | Name | Value |
96
+ | 'public_key_path' | CERTFILE_PATH |
97
+ | 'private_key_path' | KEYFILE_PATH |
98
+ | 'algorithm' | 'rsa:2048' |
99
+
100
+ # Use echo server with a blocking connection
101
+ Given PORT = first available anonymous port
102
+ Given SERVER = new echo TCP socket server
103
+ | Name | Value |
104
+ | 'host' | 'localhost' |
105
+ | 'port' | PORT |
106
+ | 'ssl.activate' | True |
107
+ | 'ssl.context.ciphers' | 'ALL' |
108
+ | 'ssl.context.load_cert_chain.certfile' | CERTFILE_PATH |
109
+ | 'ssl.context.load_cert_chain.keyfile' | KEYFILE_PATH |
110
+
111
+ # Create a TCP client with a blocking connection
112
+ Given CLIENT = new TCP socket client
113
+ | Name | Value |
114
+ | 'host' | 'localhost' |
115
+ | 'port' | PORT |
116
+ | 'blocking' | False |
117
+ | 'ssl.activate' | True |
118
+ | 'ssl.context.check_hostname' | False |
119
+ | 'ssl.context.verify_mode' | ssl.CERT_NONE |
120
+
121
+ Given end preconditions
122
+ ### PRECONDITIONS - END
123
+
124
+ # Start echo server & client
125
+ When start (socket server: SERVER)
126
+ When start (socket client: CLIENT)
127
+
128
+ # Write data and verify result is identical
129
+ When write b'\x01\x02' (socket: CLIENT)
130
+ When await socket CLIENT receives data (window: 0.1 s)
131
+ When DATA = read (socket: CLIENT)
132
+ Then DATA == b'\x01\x02'
133
+
134
+ When write b'\x11\x21' (socket: CLIENT)
135
+ When await socket CLIENT receives data (window: 0.1 s)
136
+ When DATA = read (socket: CLIENT)
137
+ Then DATA == b'\x11\x21'
138
+
139
+ # Stop server & client
140
+ #When stop (socket server: SERVER)
141
+ When stop (socket client: CLIENT)
142
+
143
+
144
+
145
+ @message_socket
146
+ @blocking_socket
147
+ Scenario: Echo server and message client (with underlying blocking connection)
148
+
149
+ ### PRECONDITIONS - BEGIN
150
+ Given begin preconditions
151
+
152
+ # Generate key files
153
+ Given CERTFILE_PATH = path to file with name 'localhost.crt'
154
+ Given KEYFILE_PATH = path to file with name 'localhost.key'
155
+ Given generate new self-signed key files for localhost
156
+ | Name | Value |
157
+ | 'public_key_path' | CERTFILE_PATH |
158
+ | 'private_key_path' | KEYFILE_PATH |
159
+ | 'algorithm' | 'rsa:2048' |
160
+
161
+ # Use echo server with a blocking connection
162
+ Given PORT = first available anonymous port
163
+ Given SERVER = new echo TCP socket server
164
+ | Name | Value |
165
+ | 'host' | 'localhost' |
166
+ | 'port' | PORT |
167
+ | 'ssl.activate' | True |
168
+ | 'ssl.context.ciphers' | 'OPENSSL_CIPHERS' |
169
+ | 'ssl.context.load_cert_chain.certfile' | CERTFILE_PATH |
170
+ | 'ssl.context.load_cert_chain.keyfile' | KEYFILE_PATH |
171
+
172
+ # Create a message client
173
+ Given CLIENT = new message TCP socket client
174
+ | Name | Value |
175
+ | 'host' | 'localhost' |
176
+ | 'port' | PORT |
177
+ | 'separator' | b'\n' |
178
+ | 'ssl.activate' | True |
179
+ | 'ssl.context.check_hostname' | False |
180
+ | 'ssl.context.verify_mode' | ssl.CERT_NONE |
181
+
182
+ Given end preconditions
183
+ ### PRECONDITIONS - END
184
+
185
+ # Start echo server & message client
186
+ When start (socket server: SERVER)
187
+ #When ensure SSL handshake is done (socket: CLIENT)
188
+ When start (socket client: CLIENT)
189
+
190
+ # Write data and verify result is identical
191
+ When write message b'\x01\x02' (socket: CLIENT)
192
+ When write message b'\x11\x21' (socket: CLIENT)
193
+
194
+ # Verify received messages
195
+ When await socket CLIENT receives messages (window: 0.1 s)
196
+ When MESSAGES = received messages (socket: CLIENT)
197
+ Then MESSAGES is list
198
+ | b'\x01\x02' |
199
+ | b'\x11\x21' |
200
+
201
+ When MESSAGES_2 = received messages (socket: CLIENT)
202
+ Then MESSAGES_2 == MESSAGES
203
+
204
+ # Verify pop messages functionality
205
+ When MSG_1 = read message (socket: CLIENT)
206
+ Then MSG_1 == b'\x01\x02'
207
+ When MESSAGES_3 = received messages (socket: CLIENT)
208
+ Then MESSAGES_3 is list
209
+ | b'\x11\x21' |
210
+
211
+ When MSG_2 = read message (socket: CLIENT)
212
+ Then MSG_2 == b'\x11\x21'
213
+ When MESSAGES_4 = received messages (socket: CLIENT)
214
+ Then MESSAGES_4 is empty list
215
+
216
+ # Stop server & client
217
+ #When stop (socket server: SERVER)
218
+ When stop (socket client: CLIENT)
219
+
220
+
221
+
222
+ @message_socket
223
+ @non_blocking_socket
224
+ Scenario: Echo server and message client (with underlying non-blocking connection)
225
+
226
+ ### PRECONDITIONS - BEGIN
227
+ Given begin preconditions
228
+
229
+ # Generate key files
230
+ Given CERTFILE_PATH = path to file with name 'localhost.crt'
231
+ Given KEYFILE_PATH = path to file with name 'localhost.key'
232
+ Given generate new self-signed key files for localhost
233
+ | Name | Value |
234
+ | 'public_key_path' | CERTFILE_PATH |
235
+ | 'private_key_path' | KEYFILE_PATH |
236
+ | 'algorithm' | 'rsa:2048' |
237
+
238
+ # Use echo server with a blocking connection
239
+ Given PORT = first available anonymous port
240
+ Given SERVER = new echo TCP socket server
241
+ | Name | Value |
242
+ | 'host' | 'localhost' |
243
+ | 'port' | PORT |
244
+ | 'ssl.activate' | True |
245
+ | 'ssl.context.ciphers' | 'SHA256' |
246
+ | 'ssl.context.load_cert_chain.certfile' | CERTFILE_PATH |
247
+ | 'ssl.context.load_cert_chain.keyfile' | KEYFILE_PATH |
248
+
249
+ # Create a message client
250
+ Given CLIENT = new message TCP socket client
251
+ | Name | Value |
252
+ | 'host' | 'localhost' |
253
+ | 'port' | PORT |
254
+ | 'separator' | b'\n' |
255
+ | 'blocking' | False |
256
+ | 'ssl.activate' | True |
257
+ | 'ssl.context.check_hostname' | False |
258
+ | 'ssl.context.verify_mode' | ssl.CERT_NONE |
259
+
260
+ Given end preconditions
261
+ ### PRECONDITIONS - END
262
+
263
+ # Start echo server & message client
264
+ When start (socket server: SERVER)
265
+ #When ensure SSL handshake is done (socket: CLIENT)
266
+ When start (socket client: CLIENT)
267
+
268
+ # Write data and verify result is identical
269
+ When write message b'\x01\x02' (socket: CLIENT)
270
+ When write message b'\x11\x21' (socket: CLIENT)
271
+
272
+ # Verify received messages
273
+ When await socket CLIENT receives messages (window: 0.1 s)
274
+ When MESSAGES = received messages (socket: CLIENT)
275
+ Then MESSAGES is list
276
+ | b'\x01\x02' |
277
+ | b'\x11\x21' |
278
+
279
+ When MESSAGES_2 = received messages (socket: CLIENT)
280
+ Then MESSAGES_2 == MESSAGES
281
+
282
+ # Verify pop messages functionality
283
+ When MSG_1 = read message (socket: CLIENT)
284
+ Then MSG_1 == b'\x01\x02'
285
+ When MESSAGES_3 = received messages (socket: CLIENT)
286
+ Then MESSAGES_3 is list
287
+ | b'\x11\x21' |
288
+
289
+ When MSG_2 = read message (socket: CLIENT)
290
+ Then MSG_2 == b'\x11\x21'
291
+ When MESSAGES_4 = received messages (socket: CLIENT)
292
+ Then MESSAGES_4 is empty list
293
+
294
+ # Stop server & client
295
+ #When stop (socket server: SERVER)
296
+ When stop (socket client: CLIENT)
297
+
298
+
299
+
@@ -73,7 +73,7 @@ Feature: Test python socket steps
73
73
  When write message b'\x11\x21' (socket: CLIENT)
74
74
 
75
75
  # Verify received messages
76
- When wait socket CLIENT stops to receive messages (window: 0.1 s)
76
+ When await socket CLIENT receives messages (window: 0.1 s)
77
77
  When MESSAGES = received messages (socket: CLIENT)
78
78
  Then MESSAGES is list
79
79
  | b'\x01\x02' |
@@ -134,7 +134,7 @@ Feature: Test python socket steps
134
134
  When write message b'\x11\x21' (socket: CLIENT)
135
135
 
136
136
  # Verify received messages
137
- When wait socket CLIENT stops to receive messages (window: 0.1 s)
137
+ When await socket CLIENT receives messages (window: 0.1 s)
138
138
  When MESSAGES = received messages (socket: CLIENT)
139
139
  Then MESSAGES is list
140
140
  | b'\x01\x02' |