@@ -35,11 +35,13 @@ def check_mempolicy_prerequisites(need_interleave=False):
3535 if need_interleave and not check_numa_interleave ():
3636 logger .info ("interleave missing" )
3737 return (77 , "NUMA interleave not supported" )
38+ return 0
3839
3940def test_mempolicy_no_conf ():
4041 """Test numa mempolicy without configuration"""
41- if check_mempolicy_prerequisites ():
42- return check_mempolicy_prerequisites ()
42+ prereq_result = check_mempolicy_prerequisites ()
43+ if prereq_result != 0 :
44+ return prereq_result
4345
4446 conf = base_config ()
4547 conf ['process' ]['args' ] = ['/init' , 'cat' , '/proc/self/numa_maps' ]
@@ -61,8 +63,9 @@ def test_mempolicy_no_conf():
6163
6264def test_mempolicy_bad_mode ():
6365 """Test numa mempolicy with bad mode"""
64- if check_mempolicy_prerequisites ():
65- return check_mempolicy_prerequisites ()
66+ prereq_result = check_mempolicy_prerequisites ()
67+ if prereq_result != 0 :
68+ return prereq_result
6669
6770 conf = base_config ()
6871 conf ['process' ]['args' ] = ['/init' , 'cat' , '/proc/self/numa_maps' ]
@@ -84,8 +87,9 @@ def test_mempolicy_bad_mode():
8487
8588def test_mempolicy_bad_flag ():
8689 """Test numa mempolicy with bad flag"""
87- if check_mempolicy_prerequisites ():
88- return check_mempolicy_prerequisites ()
90+ prereq_result = check_mempolicy_prerequisites ()
91+ if prereq_result != 0 :
92+ return prereq_result
8993
9094 conf = base_config ()
9195 conf ['process' ]['args' ] = ['/init' , 'cat' , '/proc/self/numa_maps' ]
@@ -107,8 +111,9 @@ def test_mempolicy_bad_flag():
107111
108112def test_mempolicy_numa_balancing_flag ():
109113 """Test numa mempolicy preferred with numa_balancing flag"""
110- if check_mempolicy_prerequisites (need_interleave = True ):
111- return check_mempolicy_prerequisites (need_interleave = True )
114+ prereq_result = check_mempolicy_prerequisites (need_interleave = True )
115+ if prereq_result != 0 :
116+ return prereq_result
112117
113118 conf = base_config ()
114119 conf ['process' ]['args' ] = ['/init' , 'cat' , '/proc/self/numa_maps' ]
@@ -130,8 +135,9 @@ def test_mempolicy_numa_balancing_flag():
130135
131136def test_mempolicy_static_relative_nodes_flags ():
132137 """Test numa mempolicy preferred with numa_balancing flag"""
133- if check_mempolicy_prerequisites ():
134- return check_mempolicy_prerequisites ()
138+ prereq_result = check_mempolicy_prerequisites ()
139+ if prereq_result != 0 :
140+ return prereq_result
135141
136142 conf = base_config ()
137143 conf ['process' ]['args' ] = ['/init' , 'cat' , '/proc/self/numa_maps' ]
@@ -153,8 +159,9 @@ def test_mempolicy_static_relative_nodes_flags():
153159
154160def test_mempolicy_no_nodes ():
155161 """Test numa mempolicy without nodes configuration"""
156- if check_mempolicy_prerequisites ():
157- return check_mempolicy_prerequisites ()
162+ prereq_result = check_mempolicy_prerequisites ()
163+ if prereq_result != 0 :
164+ return prereq_result
158165
159166 conf = base_config ()
160167 conf ['process' ]['args' ] = ['/init' , 'cat' , '/proc/self/numa_maps' ]
@@ -176,8 +183,9 @@ def test_mempolicy_no_nodes():
176183
177184def test_mempolicy_bad_nodes_string ():
178185 """Test numa mempolicy without nodes configuration"""
179- if check_mempolicy_prerequisites ():
180- return check_mempolicy_prerequisites ()
186+ prereq_result = check_mempolicy_prerequisites ()
187+ if prereq_result != 0 :
188+ return prereq_result
181189
182190 conf = base_config ()
183191 conf ['process' ]['args' ] = ['/init' , 'cat' , '/proc/self/numa_maps' ]
@@ -199,8 +207,9 @@ def test_mempolicy_bad_nodes_string():
199207
200208def test_mempolicy_bad_nodes_number ():
201209 """Test numa mempolicy without nodes configuration"""
202- if check_mempolicy_prerequisites ():
203- return check_mempolicy_prerequisites ()
210+ prereq_result = check_mempolicy_prerequisites ()
211+ if prereq_result != 0 :
212+ return prereq_result
204213
205214 conf = base_config ()
206215 conf ['process' ]['args' ] = ['/init' , 'cat' , '/proc/self/numa_maps' ]
@@ -222,8 +231,9 @@ def test_mempolicy_bad_nodes_number():
222231
223232def test_mempolicy_default_mode ():
224233 """Test numa mempolicy default mode"""
225- if check_mempolicy_prerequisites ():
226- return check_mempolicy_prerequisites ()
234+ prereq_result = check_mempolicy_prerequisites ()
235+ if prereq_result != 0 :
236+ return prereq_result
227237
228238 conf = base_config ()
229239 conf ['process' ]['args' ] = ['/init' , 'cat' , '/proc/self/numa_maps' ]
@@ -248,8 +258,9 @@ def test_mempolicy_default_mode():
248258
249259def test_mempolicy_local_mode ():
250260 """Test numa mempolicy local mode"""
251- if check_mempolicy_prerequisites ():
252- return check_mempolicy_prerequisites ()
261+ prereq_result = check_mempolicy_prerequisites ()
262+ if prereq_result != 0 :
263+ return prereq_result
253264
254265 conf = base_config ()
255266 conf ['process' ]['args' ] = ['/init' , 'cat' , '/proc/self/numa_maps' ]
@@ -274,8 +285,9 @@ def test_mempolicy_local_mode():
274285
275286def test_mempolicy_bind_mode ():
276287 """Test numa mempolicy bind mode"""
277- if check_mempolicy_prerequisites ():
278- return check_mempolicy_prerequisites ()
288+ prereq_result = check_mempolicy_prerequisites ()
289+ if prereq_result != 0 :
290+ return prereq_result
279291
280292 conf = base_config ()
281293 conf ['process' ]['args' ] = ['/init' , 'cat' , '/proc/self/numa_maps' ]
@@ -300,8 +312,9 @@ def test_mempolicy_bind_mode():
300312
301313def test_mempolicy_bind_mode_balancing ():
302314 """Test numa mempolicy bind mode balancing"""
303- if check_mempolicy_prerequisites (need_interleave = True ):
304- return check_mempolicy_prerequisites (need_interleave = True )
315+ prereq_result = check_mempolicy_prerequisites (need_interleave = True )
316+ if prereq_result != 0 :
317+ return prereq_result
305318
306319 conf = base_config ()
307320 conf ['process' ]['args' ] = ['/init' , 'cat' , '/proc/self/numa_maps' ]
@@ -326,8 +339,9 @@ def test_mempolicy_bind_mode_balancing():
326339
327340def test_mempolicy_bind_mode_balancing_relative ():
328341 """Test numa mempolicy bind mode balancing with relative nodes"""
329- if check_mempolicy_prerequisites (need_interleave = True ):
330- return check_mempolicy_prerequisites (need_interleave = True )
342+ prereq_result = check_mempolicy_prerequisites (need_interleave = True )
343+ if prereq_result != 0 :
344+ return prereq_result
331345
332346 conf = base_config ()
333347 conf ['process' ]['args' ] = ['/init' , 'cat' , '/proc/self/numa_maps' ]
@@ -352,8 +366,9 @@ def test_mempolicy_bind_mode_balancing_relative():
352366
353367def test_mempolicy_preferred_mode_static ():
354368 """Test numa mempolicy preferred mode with static nodes"""
355- if check_mempolicy_prerequisites ():
356- return check_mempolicy_prerequisites ()
369+ prereq_result = check_mempolicy_prerequisites ()
370+ if prereq_result != 0 :
371+ return prereq_result
357372
358373 conf = base_config ()
359374 conf ['process' ]['args' ] = ['/init' , 'cat' , '/proc/self/numa_maps' ]
@@ -378,8 +393,9 @@ def test_mempolicy_preferred_mode_static():
378393
379394def test_mempolicy_preferred_many_mode ():
380395 """Test numa mempolicy preferred many mode with all nodes"""
381- if check_mempolicy_prerequisites ():
382- return check_mempolicy_prerequisites ()
396+ prereq_result = check_mempolicy_prerequisites ()
397+ if prereq_result != 0 :
398+ return prereq_result
383399
384400 conf = base_config ()
385401 conf ['process' ]['args' ] = ['/init' , 'cat' , '/proc/self/numa_maps' ]
@@ -404,8 +420,9 @@ def test_mempolicy_preferred_many_mode():
404420
405421def test_mempolicy_interleave_mode ():
406422 """Test numa mempolicy interleave mode"""
407- if check_mempolicy_prerequisites ():
408- return check_mempolicy_prerequisites ()
423+ prereq_result = check_mempolicy_prerequisites ()
424+ if prereq_result != 0 :
425+ return prereq_result
409426
410427 conf = base_config ()
411428 conf ['process' ]['args' ] = ['/init' , 'cat' , '/proc/self/numa_maps' ]
@@ -430,8 +447,9 @@ def test_mempolicy_interleave_mode():
430447
431448def test_mempolicy_weighted_interleave_mode ():
432449 """Test numa mempolicy weighted interleave mode"""
433- if check_mempolicy_prerequisites (need_interleave = True ):
434- return check_mempolicy_prerequisites (need_interleave = True )
450+ prereq_result = check_mempolicy_prerequisites (need_interleave = True )
451+ if prereq_result != 0 :
452+ return prereq_result
435453
436454 conf = base_config ()
437455 conf ['process' ]['args' ] = ['/init' , 'cat' , '/proc/self/numa_maps' ]
0 commit comments