File tree Expand file tree Collapse file tree 3 files changed +34
-0
lines changed
resources/checks_unlisted Expand file tree Collapse file tree 3 files changed +34
-0
lines changed Original file line number Diff line number Diff line change 1+ #!/usr/bin/env python3
2+
3+ import sys
4+ import os
5+ if sys .stdin .isatty ():
6+ print ("stdin is a tty" )
7+ # do some tty-only thing
8+ print (os .tcgetpgrp (sys .stdin .fileno ()))
9+ else :
10+ print ("stdin is not a tty" )
Original file line number Diff line number Diff line change 1+ import reframe as rfm
2+ import reframe .utility .sanity as sn
3+
4+
5+ @rfm .simple_test
6+ class TestBuggyStdin (rfm .RunOnlyRegressionTest ):
7+ descr = 'Test that stdin is not a tty'
8+ valid_systems = ['*' ]
9+ valid_prog_environs = ['*' ]
10+ executable = './test.py'
11+
12+ @sanity_function
13+ def assert_stdin_not_a_tty (self ):
14+ return sn .assert_found ('stdin is not a tty' , self .stdout )
Original file line number Diff line number Diff line change @@ -917,3 +917,13 @@ def test_fixture_resolution(run_reframe):
917917 action = 'run'
918918 )
919919 assert returncode == 0
920+
921+
922+ def test_check_stdin_not_a_tty (run_reframe , tmp_path ):
923+ returncode , stdout , stderr = run_reframe (
924+ checkpath = [
925+ 'unittests/resources/checks_unlisted/test_stdin_not_a_tty.py'
926+ ])
927+ assert 'PASSED' in stdout
928+ assert 'FAILED' not in stdout
929+ assert returncode == 0
You can’t perform that action at this time.
0 commit comments