@@ -61,6 +61,19 @@ def get_multirun_params(self, test_path):
61
61
result = self .multi_run .get ('*' , None )
62
62
return result
63
63
64
+ def parse_bool_opt (self , name , default ):
65
+ val = self .ini .get (name )
66
+ if val is None :
67
+ self .ini [name ] = default
68
+ elif isinstance (val , bool ):
69
+ pass
70
+ elif isinstance (val , str ) and val .lower () in ('true' , 'false' ):
71
+ # If value is not boolean it come from ini file, need to convert
72
+ # string 'True' or 'False' into boolean representation.
73
+ self .ini [name ] = val .lower () == 'true'
74
+ else :
75
+ raise ConfigurationError (name , val , "'True' or 'False'" )
76
+
64
77
def __init__ (self , suite_path , args ):
65
78
"""Initialize a test suite: check that it exists and contains
66
79
a syntactically correct configuration file. Then create
@@ -97,8 +110,9 @@ def __init__(self, suite_path, args):
97
110
dict .fromkeys (self .ini [i ].split ())
98
111
if i in self .ini else dict ())
99
112
100
- self .ini .update (
101
- dict (show_reproduce_content = self .show_reproduce_content ()))
113
+ self .parse_bool_opt ('use_unix_sockets' , False )
114
+ self .parse_bool_opt ('is_parallel' , False )
115
+ self .parse_bool_opt ('show_reproduce_content' , False )
102
116
103
117
def find_tests (self ):
104
118
if self .ini ['core' ] == 'tarantool' :
@@ -201,23 +215,7 @@ def run_test(self, test, server, inspector):
201
215
return short_status
202
216
203
217
def is_parallel (self ):
204
- val = self .ini .get ('is_parallel' , 'false' )
205
- if isinstance (val , bool ):
206
- return val
207
- # If value is not boolean it come from ini file, need to
208
- # convert string 'True' or 'False' into boolean representation
209
- if val .lower () not in ['true' , 'false' ]:
210
- raise ConfigurationError ('is_parallel' , val , "'True' or 'False'" )
211
- return val .lower () == 'true'
218
+ return self .ini ['is_parallel' ]
212
219
213
220
def show_reproduce_content (self ):
214
- val = self .ini .get ('show_reproduce_content' , 'true' )
215
- if isinstance (val , bool ):
216
- return val
217
- # If value is not boolean it come from ini file, need to
218
- # convert string 'True' or 'False' into boolean representation
219
- if val .lower () not in ['true' , 'false' ]:
220
- raise ConfigurationError ('show_reproduce_content' ,
221
- val ,
222
- "'True' or 'False'" )
223
- return val .lower () == 'true'
221
+ return self .ini ['show_reproduce_content' ]
0 commit comments