@@ -30,7 +30,7 @@ def test_exec():
3030 add_all_namespaces (conf )
3131 cid = None
3232 try :
33- _ , cid = run_and_get_output (conf , command = 'run' , detach = True )
33+ _ , cid = run_and_get_output (conf , hide_stderr = True , command = 'run' , detach = True )
3434 out = run_crun_command (["exec" , cid , "/init" , "echo" , "foo" ])
3535 if "foo" not in out :
3636 logger .info ("exec test failed: expected 'foo' in output" )
@@ -67,7 +67,7 @@ def test_uid_tty():
6767 last_error = None
6868 try :
6969 cid = "container-%s" % os .getpid ()
70- proc = run_and_get_output (conf , command = 'run' , id_container = cid , use_popen = True )
70+ proc = run_and_get_output (conf , hide_stderr = True , command = 'run' , id_container = cid , use_popen = True )
7171 for i in range (0 , 500 ):
7272 try :
7373 out = run_crun_command (["exec" , "-t" , "--user" , "1" , cid , "/init" , "owner" , "/proc/self/fd/0" ])
@@ -102,7 +102,7 @@ def test_exec_root_netns_with_userns():
102102 conf ['linux' ]['namespaces' ].append ({"type" : "network" , "path" : "/proc/1/ns/net" })
103103 cid = None
104104 try :
105- _ , cid = run_and_get_output (conf , command = 'run' , detach = True )
105+ _ , cid = run_and_get_output (conf , hide_stderr = True , command = 'run' , detach = True )
106106
107107 with open ("/proc/net/route" ) as f :
108108 payload = f .read ()
@@ -148,7 +148,7 @@ def test_exec_not_exists_helper(detach):
148148 add_all_namespaces (conf )
149149 cid = None
150150 try :
151- _ , cid = run_and_get_output (conf , command = 'run' , detach = True )
151+ _ , cid = run_and_get_output (conf , hide_stderr = True , command = 'run' , detach = True )
152152 try :
153153 if detach :
154154 out = run_crun_command (["exec" , "-d" , cid , "/not.here" ])
@@ -176,7 +176,7 @@ def test_exec_additional_gids():
176176 cid = None
177177 tempdir = tempfile .mkdtemp ()
178178 try :
179- _ , cid = run_and_get_output (conf , command = 'run' , detach = True )
179+ _ , cid = run_and_get_output (conf , hide_stderr = True , command = 'run' , detach = True )
180180
181181 process_file = os .path .join (tempdir , "process.json" )
182182 with open (process_file , "w" ) as f :
@@ -216,7 +216,7 @@ def test_exec_populate_home_env_from_process_uid():
216216 cid = None
217217 tempdir = tempfile .mkdtemp ()
218218 try :
219- _ , cid = run_and_get_output (conf , command = 'run' , detach = True )
219+ _ , cid = run_and_get_output (conf , hide_stderr = True , command = 'run' , detach = True )
220220
221221 process_file = os .path .join (tempdir , "process.json" )
222222 with open (process_file , "w" ) as f :
@@ -274,7 +274,7 @@ def test_exec_add_capability():
274274 "CAP_KILL" : cap_kill_dict , \
275275 "CAP_SYS_ADMIN" : cap_sys_admin_dict }
276276 try :
277- _ , cid = run_and_get_output (conf , command = 'run' , detach = True )
277+ _ , cid = run_and_get_output (conf , hide_stderr = True , command = 'run' , detach = True )
278278 for cap , value in cap_dict .items ():
279279 out = run_crun_command (["exec" , "--cap" , cap , cid , "/init" , "cat" , "/proc/self/status" ])
280280 for i in ['bounding' , 'effective' , 'inheritable' , 'permitted' , 'ambient' ]:
@@ -300,7 +300,7 @@ def test_exec_add_env():
300300 env_dict_orig = {"HOME" :"/" , "PATH" :"/bin" }
301301 env_dict_new = {"HOME" :"/tmp" , "PATH" :"/usr/bin" ,"FOO" :"BAR" }
302302 try :
303- _ , cid = run_and_get_output (conf , command = 'run' , detach = True )
303+ _ , cid = run_and_get_output (conf , hide_stderr = True , command = 'run' , detach = True )
304304 # check original environment variable
305305 for env , value in env_dict_orig .items ():
306306 out = run_crun_command (["exec" , cid , "/init" , "printenv" , env ])
@@ -338,7 +338,7 @@ def test_exec_set_user():
338338 uid_gid_list = ["1000:1000" , "0:0" , "65535:65535" ]
339339
340340 try :
341- _ , cid = run_and_get_output (conf , command = 'run' , detach = True )
341+ _ , cid = run_and_get_output (conf , hide_stderr = True , command = 'run' , detach = True )
342342 # check current user id
343343 out = run_crun_command (["exec" , cid , "/init" , "id" ])
344344 if uid_gid_list [1 ] not in out :
@@ -361,7 +361,7 @@ def test_exec_no_new_privs():
361361 conf ['process' ]['capabilities' ] = {}
362362 cid = None
363363 try :
364- _ , cid = run_and_get_output (conf , command = 'run' , detach = True )
364+ _ , cid = run_and_get_output (conf , hide_stderr = True , command = 'run' , detach = True )
365365 # check original value of NoNewPrivs
366366 out = run_crun_command (["exec" , cid , "/init" , "cat" , "/proc/self/status" ])
367367 proc_status = parse_proc_status (out )
@@ -386,7 +386,7 @@ def test_exec_write_pid_file():
386386 cid = None
387387 tempdir = tempfile .mkdtemp ()
388388 try :
389- _ , cid = run_and_get_output (conf , command = 'run' , detach = True )
389+ _ , cid = run_and_get_output (conf , hide_stderr = True , command = 'run' , detach = True )
390390 pid_file = os .path .join (tempdir , cid )
391391 out = run_crun_command (["exec" , "--pid-file" , pid_file , cid , "/init" , "echo" , "hello" ])
392392 if "hello" not in out :
@@ -449,7 +449,7 @@ def exec_and_get_affinity_mask(cid, exec_cpu_affinity=None):
449449 try :
450450 with open ("/proc/self/status" ) as f :
451451 current_cpu_mask = cpu_mask_from_proc_status (f .read ())
452- _ , cid = run_and_get_output (conf , command = 'run' , detach = True )
452+ _ , cid = run_and_get_output (conf , hide_stderr = True , command = 'run' , detach = True )
453453
454454 mask = exec_and_get_affinity_mask (cid )
455455 if mask != current_cpu_mask :
@@ -483,7 +483,7 @@ def test_exec_getpgrp():
483483 conf ['process' ]['args' ] = ['/init' , 'pause' ]
484484 cid = None
485485 try :
486- _ , cid = run_and_get_output (conf , command = 'run' , detach = True )
486+ _ , cid = run_and_get_output (conf , hide_stderr = True , command = 'run' , detach = True )
487487 for terminal in [True , False ]:
488488 if terminal and os .isatty (1 ) == False :
489489 continue
@@ -512,7 +512,7 @@ def test_exec_error_propagation():
512512 add_all_namespaces (conf )
513513 cid = None
514514 try :
515- _ , cid = run_and_get_output (conf , command = 'run' , detach = True )
515+ _ , cid = run_and_get_output (conf , hide_stderr = True , command = 'run' , detach = True )
516516 try :
517517 out = run_crun_command_raw (["exec" , "--cwd" , "/invalid/nonexistent/path" , cid , "/init" , "echo" , "test" ])
518518 return - 1
0 commit comments