Linux Test Project
 help / color / mirror / Atom feed
* [LTP] [PATCH v2] kernel/pty07: Skip test when TTY not available
@ 2022-04-20  9:25 Bogdan Lezhepekov
  2022-04-20 10:18 ` Cyril Hrubis
  0 siblings, 1 reply; 2+ messages in thread
From: Bogdan Lezhepekov @ 2022-04-20  9:25 UTC (permalink / raw)
  To: ltp

Since TTY under test is hardcoded, it
might not be available in some systems.

Signed-off-by: Bogdan Lezhepekov <blezhepekov@suse.de>
---
 testcases/kernel/pty/pty07.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/testcases/kernel/pty/pty07.c b/testcases/kernel/pty/pty07.c
index 2887de6fa..c63b71c89 100644
--- a/testcases/kernel/pty/pty07.c
+++ b/testcases/kernel/pty/pty07.c
@@ -81,6 +81,9 @@ static void setup(void)
 	struct vt_stat stat;
 
 	sprintf(tty_path, "/dev/tty%d", test_tty_port);
+	if (access(tty_path, F_OK))
+		tst_brk(TCONF, "TTY (/dev/tty%d) under test not available in system", test_tty_port);
+
 	fd = SAFE_OPEN(tty_path, O_RDWR);
 	SAFE_IOCTL(fd, VT_GETSTATE, &stat);
 	vt_active = stat.v_active;
-- 
2.35.1


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-04-20 10:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-04-20  9:25 [LTP] [PATCH v2] kernel/pty07: Skip test when TTY not available Bogdan Lezhepekov
2022-04-20 10:18 ` Cyril Hrubis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox