File: test_shell.py

package info (click to toggle)
labgrid 0.4.1-6
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 2,232 kB
  • sloc: python: 17,045; makefile: 30; sh: 12
file content (11 lines) | stat: -rw-r--r-- 343 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
def test_shell(command):
    stdout, stderr, returncode = command.run('cat /proc/version')
    assert returncode == 0
    assert len(stdout) > 0
    assert len(stderr) == 0
    assert 'Linux' in stdout[0]

    stdout, stderr, returncode = command.run('false')
    assert returncode != 0
    assert len(stdout) == 0
    assert len(stderr) == 0