github.com/opencontainers/runc@v1.2.0-rc.1.0.20240520010911-492dc558cdd6/tests/integration/umask.bats (about)

     1  #!/usr/bin/env bats
     2  
     3  load helpers
     4  
     5  function setup() {
     6  	setup_busybox
     7  }
     8  
     9  function teardown() {
    10  	teardown_bundle
    11  }
    12  
    13  @test "umask" {
    14  	update_config '.process.user += {"umask":63}'
    15  
    16  	# run busybox detached
    17  	runc run -d --console-socket "$CONSOLE_SOCKET" test_busybox
    18  	[ "$status" -eq 0 ]
    19  
    20  	runc exec test_busybox grep '^Umask:' "/proc/1/status"
    21  	[ "$status" -eq 0 ]
    22  	# umask 63 decimal = umask 77 octal
    23  	[[ "${output}" == *"77"* ]]
    24  
    25  	runc exec test_busybox grep '^Umask:' "/proc/self/status"
    26  	[ "$status" -eq 0 ]
    27  	# umask 63 decimal = umask 77 octal
    28  	[[ "${output}" == *"77"* ]]
    29  }