Skip to content

Commit 1e30b4d

Browse files
Explicitly set reliability (#1810)
* Explicitly set reliability Signed-off-by: EduPonz <[email protected]> * Remove unnecessary log in cmake Signed-off-by: EduPonz <[email protected]> * Set reliability option with -R Signed-off-by: EduPonz <[email protected]> Signed-off-by: JLBuenoLopez-eProsima <[email protected]> Co-authored-by: Eduardo Ponz Segrelles <[email protected]>
1 parent c68fbd3 commit 1e30b4d

File tree

4 files changed

+76
-18
lines changed

4 files changed

+76
-18
lines changed

test/performance/latency/CMakeLists.txt

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,9 @@ if(PYTHONINTERP_FOUND)
105105
foreach(latency_test_name ${LATENCY_TEST_LIST})
106106

107107
# decide if add security testing
108-
set(ADD_LATENCY_SECURITY OFF)
108+
set(ADD_LATENCY_SECURITY OFF)
109109
if(SECURITY AND (${latency_test_name} MATCHES "^interprocess"))
110-
set(ADD_LATENCY_SECURITY ON)
110+
set(ADD_LATENCY_SECURITY ON)
111111
endif()
112112

113113
# list of all the test cases generated in this iteration
@@ -120,6 +120,13 @@ if(PYTHONINTERP_FOUND)
120120
set(interproces_flag "")
121121
endif()
122122

123+
# Set the reliability flag
124+
if(${latency_test_name} MATCHES "reliable")
125+
set(reliability_flag "--reliability")
126+
else()
127+
set(reliability_flag "")
128+
endif()
129+
123130
# Add the test
124131
add_test(
125132
NAME performance.latency.${latency_test_name}
@@ -129,6 +136,7 @@ if(PYTHONINTERP_FOUND)
129136
--xml_file ${CMAKE_CURRENT_SOURCE_DIR}/xml/${latency_test_name}.xml
130137
--demands_file ${CMAKE_CURRENT_SOURCE_DIR}/payloads_demands.csv
131138
${interproces_flag}
139+
${reliability_flag}
132140
)
133141

134142
# Add environment
@@ -166,9 +174,10 @@ if(PYTHONINTERP_FOUND)
166174
--demands_file ${CMAKE_CURRENT_SOURCE_DIR}/payloads_demands.csv
167175
--security
168176
${interproces_flag}
177+
${reliability_flag}
169178
)
170179

171-
# Hint certificates location
180+
# Hint certificates location
172181
set_property(
173182
TEST performance.latency.${latency_test_name}.security
174183
APPEND PROPERTY ENVIRONMENT "CERTS_PATH=${PROJECT_SOURCE_DIR}/test/certs"
@@ -191,6 +200,7 @@ if(PYTHONINTERP_FOUND)
191200
--demands_file ${CMAKE_CURRENT_SOURCE_DIR}/payloads_demands.csv
192201
${interproces_flag}
193202
--data_sharing
203+
${reliability_flag}
194204
)
195205

196206
endif()
@@ -210,6 +220,7 @@ if(PYTHONINTERP_FOUND)
210220
--demands_file ${CMAKE_CURRENT_SOURCE_DIR}/payloads_demands.csv
211221
${interproces_flag}
212222
--data_loans
223+
${reliability_flag}
213224
)
214225

215226
# If there is security, add a secure test as well with loans
@@ -228,9 +239,10 @@ if(PYTHONINTERP_FOUND)
228239
--security
229240
${interproces_flag}
230241
--data_loans
242+
${reliability_flag}
231243
)
232244

233-
# Hint certificates location
245+
# Hint certificates location
234246
set_property(
235247
TEST performance.latency.${latency_test_name}.data_loans.security
236248
APPEND PROPERTY ENVIRONMENT "CERTS_PATH=${PROJECT_SOURCE_DIR}/test/certs"
@@ -256,6 +268,7 @@ if(PYTHONINTERP_FOUND)
256268
${interproces_flag}
257269
--data_loans
258270
--data_sharing
271+
${reliability_flag}
259272
)
260273

261274
endif()

test/performance/latency/latency_tests.py

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,13 @@
6868
help='Enable the use of the loan sample API (Defaults: disable)',
6969
required=False,
7070
)
71+
parser.add_argument(
72+
'-r',
73+
'--reliability',
74+
action='store_true',
75+
help='Run with RELIABLE reliability (Defaults: disable)',
76+
required=False,
77+
)
7178

7279
# Parse arguments
7380
args = parser.parse_args()
@@ -119,20 +126,26 @@
119126
# Data sharing and loans options
120127
# modify output file names
121128
if args.data_sharing and args.data_loans:
122-
filename_options += '_data_loans_and_sharing'
129+
filename_options += '_data_loans_and_sharing'
123130
elif args.data_sharing:
124-
filename_options += '_data_sharing'
131+
filename_options += '_data_sharing'
125132
elif args.data_loans:
126-
filename_options += '_data_loans'
133+
filename_options += '_data_loans'
127134

128135
# add flags to the command line
129136
data_options = []
130137

131138
if args.data_sharing:
132-
data_options += [ '--data_sharing' ]
139+
data_options += ['--data_sharing']
133140

134141
if args.data_loans:
135-
data_options += [ '--data_loans' ]
142+
data_options += ['--data_loans']
143+
144+
reliability_options = []
145+
if args.reliability:
146+
reliability_options = ['--reliability=reliable']
147+
else:
148+
reliability_options = ['--reliability=besteffort']
136149

137150
# Environment variables
138151
executable = os.environ.get('LATENCY_TEST_BIN')
@@ -199,11 +212,13 @@
199212
pub_command += xml_options
200213
pub_command += demands_options
201214
pub_command += data_options
215+
pub_command += reliability_options
202216

203217
sub_command += domain_options
204218
sub_command += xml_options
205219
sub_command += demands_options
206220
sub_command += data_options
221+
sub_command += reliability_options
207222

208223
print('Publisher command: {}'.format(
209224
' '.join(element for element in pub_command)),
@@ -254,6 +269,7 @@
254269
command += xml_options
255270
command += demands_options
256271
command += data_options
272+
command += reliability_options
257273

258274
print('Executable command: {}'.format(
259275
' '.join(element for element in command)),

test/performance/throughput/CMakeLists.txt

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,9 @@ if(PYTHONINTERP_FOUND)
106106
foreach(throughput_test_name ${THROUGHPUT_TEST_LIST})
107107

108108
# decide if add security testing
109-
set(ADD_THROUGHPUT_SECURITY OFF)
109+
set(ADD_THROUGHPUT_SECURITY OFF)
110110
if(SECURITY AND (${throughput_test_name} MATCHES "^interprocess"))
111-
set(ADD_THROUGHPUT_SECURITY ON)
111+
set(ADD_THROUGHPUT_SECURITY ON)
112112
endif()
113113

114114
# list of all the test cases generated in this iteration
@@ -121,6 +121,13 @@ if(PYTHONINTERP_FOUND)
121121
set(interproces_flag "")
122122
endif()
123123

124+
# Set the reliability flag
125+
if(${throughput_test_name} MATCHES "reliable")
126+
set(reliability_flag "--reliability")
127+
else()
128+
set(reliability_flag "")
129+
endif()
130+
124131
# Add the test
125132
add_test(
126133
NAME performance.throughput.${throughput_test_name}
@@ -130,6 +137,7 @@ if(PYTHONINTERP_FOUND)
130137
--recoveries_file ${CMAKE_CURRENT_SOURCE_DIR}/recoveries.csv
131138
--demands_file ${CMAKE_CURRENT_SOURCE_DIR}/payloads_demands.csv
132139
${interproces_flag}
140+
${reliability_flag}
133141
)
134142

135143
# Add environment
@@ -166,9 +174,10 @@ if(PYTHONINTERP_FOUND)
166174
--demands_file ${CMAKE_CURRENT_SOURCE_DIR}/payloads_demands.csv
167175
--security
168176
${interproces_flag}
177+
${reliability_flag}
169178
)
170179

171-
# Hint certificates location
180+
# Hint certificates location
172181
set_property(
173182
TEST performance.throughput.${throughput_test_name}.security
174183
APPEND PROPERTY ENVIRONMENT "CERTS_PATH=${PROJECT_SOURCE_DIR}/test/certs"
@@ -191,6 +200,7 @@ if(PYTHONINTERP_FOUND)
191200
--demands_file ${CMAKE_CURRENT_SOURCE_DIR}/payloads_demands.csv
192201
--data_sharing
193202
${interproces_flag}
203+
${reliability_flag}
194204
)
195205

196206
endif()
@@ -210,6 +220,7 @@ if(PYTHONINTERP_FOUND)
210220
--demands_file ${CMAKE_CURRENT_SOURCE_DIR}/payloads_demands.csv
211221
--data_loans
212222
${interproces_flag}
223+
${reliability_flag}
213224
)
214225

215226
if(ADD_THROUGHPUT_SECURITY)
@@ -227,9 +238,10 @@ if(PYTHONINTERP_FOUND)
227238
--security
228239
${interproces_flag}
229240
--data_loans
241+
${reliability_flag}
230242
)
231243

232-
# Hint certificates location
244+
# Hint certificates location
233245
set_property(
234246
TEST performance.throughput.${throughput_test_name}.data_loans.security
235247
APPEND PROPERTY ENVIRONMENT "CERTS_PATH=${PROJECT_SOURCE_DIR}/test/certs"
@@ -255,6 +267,7 @@ if(PYTHONINTERP_FOUND)
255267
--data_loans
256268
--data_sharing
257269
${interproces_flag}
270+
${reliability_flag}
258271
)
259272

260273
endif()

test/performance/throughput/throughput_tests.py

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,13 @@
7575
help='Enable the use of the loan sample API (Defaults: disable)',
7676
required=False,
7777
)
78+
parser.add_argument(
79+
'-R',
80+
'--reliability',
81+
action='store_true',
82+
help='Run with RELIABLE reliability (Defaults: disable)',
83+
required=False,
84+
)
7885

7986
# Parse arguments
8087
args = parser.parse_args()
@@ -115,11 +122,11 @@
115122
# Data sharing and loans options
116123
# modify output file names
117124
if args.data_sharing and args.data_loans:
118-
filename_options += '_data_loans_and_sharing'
125+
filename_options += '_data_loans_and_sharing'
119126
elif args.data_sharing:
120-
filename_options += '_data_sharing'
127+
filename_options += '_data_sharing'
121128
elif args.data_loans:
122-
filename_options += '_data_loans'
129+
filename_options += '_data_loans'
123130

124131
# Demands files options
125132
demands_options = []
@@ -137,10 +144,16 @@
137144
data_options = []
138145

139146
if args.data_sharing:
140-
data_options += [ '--data_sharing' ]
147+
data_options += ['--data_sharing']
141148

142149
if args.data_loans:
143-
data_options += [ '--data_loans' ]
150+
data_options += ['--data_loans']
151+
152+
reliability_options = []
153+
if args.reliability:
154+
reliability_options = ['--reliability=reliable']
155+
else:
156+
reliability_options = ['--reliability=besteffort']
144157

145158
# Recoveries files options
146159
recoveries_options = []
@@ -224,10 +237,12 @@
224237
pub_command += domain_options
225238
pub_command += xml_options
226239
pub_command += data_options
240+
pub_command += reliability_options
227241

228242
sub_command += domain_options
229243
sub_command += xml_options
230244
sub_command += data_options
245+
sub_command += reliability_options
231246

232247
print('Publisher command: {}'.format(
233248
' '.join(element for element in pub_command)),
@@ -279,6 +294,7 @@
279294
command += domain_options
280295
command += xml_options
281296
command += data_options
297+
command += reliability_options
282298

283299
print('Executable command: {}'.format(
284300
' '.join(element for element in command)),

0 commit comments

Comments
 (0)