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

     1  #!/usr/bin/env bats
     2  
     3  load helpers
     4  
     5  function setup() {
     6  	requires arch_x86_64
     7  	setup_busybox
     8  }
     9  
    10  function teardown() {
    11  	teardown_bundle
    12  }
    13  
    14  @test "runc run personality for i686" {
    15  	update_config '
    16        .process.args = ["/bin/sh", "-c", "uname -a"]
    17  			| .linux.personality = {
    18                  "domain": "LINUX32",
    19                  "flags": []
    20  			}'
    21  
    22  	runc run test_busybox
    23  	[ "$status" -eq 0 ]
    24  	[[ "$output" == *"i686"* ]]
    25  }
    26  
    27  @test "runc run personality with exec for i686" {
    28  	update_config '
    29        .linux.personality = {
    30                  "domain": "LINUX32",
    31        }'
    32  
    33  	runc run -d --console-socket "$CONSOLE_SOCKET" test_busybox
    34  	[ "$status" -eq 0 ]
    35  	runc exec test_busybox /bin/sh -c "uname -a"
    36  	[ "$status" -eq 0 ]
    37  	[[ "$output" == *"i686"* ]]
    38  }
    39  
    40  @test "runc run personality for x86_64" {
    41  	update_config '
    42        .process.args = ["/bin/sh", "-c", "uname -a"]
    43  			| .linux.personality = {
    44                  "domain": "LINUX",
    45                  "flags": []
    46  			}'
    47  
    48  	runc run test_busybox
    49  	[ "$status" -eq 0 ]
    50  	[[ "$output" == *"x86_64"* ]]
    51  }
    52  
    53  @test "runc run personality with exec for x86_64" {
    54  	update_config '
    55        .linux.personality = {
    56                  "domain": "LINUX",
    57        }'
    58  
    59  	runc run -d --console-socket "$CONSOLE_SOCKET" test_busybox
    60  	[ "$status" -eq 0 ]
    61  	runc exec test_busybox /bin/sh -c "uname -a"
    62  	[ "$status" -eq 0 ]
    63  	[[ "$output" == *"x86_64"* ]]
    64  }