github.com/opencontainers/runc@v1.2.0-rc.1.0.20240520010911-492dc558cdd6/tests/integration/help.bats (about) 1 #!/usr/bin/env bats 2 3 load helpers 4 5 function setup() { 6 # It does not make sense to repeat these trivial tests for non-root. 7 # Also, they fail due to $ROOT not being set and XDG_RUNTIME_DIR 8 # pointing to another user's directory after sudo rootless. 9 requires root 10 } 11 12 @test "runc -h" { 13 runc -h 14 [ "$status" -eq 0 ] 15 [[ ${lines[0]} =~ NAME:+ ]] 16 [[ ${lines[1]} =~ runc\ '-'\ Open\ Container\ Initiative\ runtime+ ]] 17 18 runc --help 19 [ "$status" -eq 0 ] 20 [[ ${lines[0]} =~ NAME:+ ]] 21 [[ ${lines[1]} =~ runc\ '-'\ Open\ Container\ Initiative\ runtime+ ]] 22 } 23 24 @test "runc command -h" { 25 runc checkpoint -h 26 [ "$status" -eq 0 ] 27 [[ ${lines[1]} =~ runc\ checkpoint+ ]] 28 29 runc delete -h 30 [ "$status" -eq 0 ] 31 [[ ${lines[1]} =~ runc\ delete+ ]] 32 33 runc events -h 34 [ "$status" -eq 0 ] 35 [[ ${lines[1]} =~ runc\ events+ ]] 36 37 runc exec -h 38 [ "$status" -eq 0 ] 39 [[ ${lines[1]} =~ runc\ exec+ ]] 40 41 runc kill -h 42 [ "$status" -eq 0 ] 43 [[ ${lines[1]} =~ runc\ kill+ ]] 44 45 runc list -h 46 [ "$status" -eq 0 ] 47 [[ ${lines[0]} =~ NAME:+ ]] 48 [[ ${lines[1]} =~ runc\ list+ ]] 49 50 runc list --help 51 [ "$status" -eq 0 ] 52 [[ ${lines[0]} =~ NAME:+ ]] 53 [[ ${lines[1]} =~ runc\ list+ ]] 54 55 runc pause -h 56 [ "$status" -eq 0 ] 57 [[ ${lines[1]} =~ runc\ pause+ ]] 58 59 runc restore -h 60 [ "$status" -eq 0 ] 61 [[ ${lines[1]} =~ runc\ restore+ ]] 62 63 runc resume -h 64 [ "$status" -eq 0 ] 65 [[ ${lines[1]} =~ runc\ resume+ ]] 66 67 # We don't use runc_spec here, because we're just testing the help page. 68 runc spec -h 69 [ "$status" -eq 0 ] 70 [[ ${lines[1]} =~ runc\ spec+ ]] 71 72 runc start -h 73 [ "$status" -eq 0 ] 74 [[ ${lines[1]} =~ runc\ start+ ]] 75 76 runc run -h 77 [ "$status" -eq 0 ] 78 [[ ${lines[1]} =~ runc\ run+ ]] 79 80 runc state -h 81 [ "$status" -eq 0 ] 82 [[ ${lines[1]} =~ runc\ state+ ]] 83 84 runc update -h 85 [ "$status" -eq 0 ] 86 [[ ${lines[1]} =~ runc\ update+ ]] 87 88 } 89 90 @test "runc foo -h" { 91 runc foo -h 92 [ "$status" -ne 0 ] 93 [[ "${output}" == *"No help topic for 'foo'"* ]] 94 }