File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -124,6 +124,29 @@ function teardown() {
124124	[[ " $output "   ==  * " =100001=100001=" *  ]]
125125}
126126
127+ #  It fails because it does not detect the modification to uid/gid Mappings.
128+ @test " idmap mount with userns"   {
129+ 	update_config '  .linux.namespaces += [{"type": "user"}]
130+ 		| .linux.uidMappings += [{"hostID": 100000, "containerID": 0, "size": 65536}] 
131+ 		| .linux.gidMappings += [{"hostID": 100000, "containerID": 0, "size": 65536}] '  
132+ 
133+ 	runc run test_debian
134+ 	[ " $status "   -eq  0 ]
135+ 	#  With the user namespace, the id map mount UID 100000 is changed to 0.
136+ 	[[ " $output "   ==  * " =0=0=" *  ]]
137+ }
138+ 
139+ @test " idmap mount with different userns"   {
140+ 	update_config '  .linux.namespaces += [{"type": "user"}]
141+ 		| .linux.uidMappings += [{"hostID": 99999, "containerID": 0, "size": 65536}] 
142+ 		| .linux.gidMappings += [{"hostID": 99999, "containerID": 0, "size": 65536}] '  
143+ 
144+ 	runc run test_debian
145+ 	[ " $status "   -eq  0 ]
146+ 	#  With the user namespace, the id map mount UID 100000 is changed to 1.
147+ 	[[ " $output "   ==  * " =1=1=" *  ]]
148+ }
149+ 
127150@test " idmap mount without gidMappings fails"   {
128151	update_config '  .mounts |= map((select(.source == "source-1/") | del(.gidMappings) ) // .)' 
129152
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments