All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP] [PATCH 1/2] pty07: Resize console to the same size as before
@ 2022-05-19 12:10 Martin Doucha
  2022-05-19 12:10 ` [LTP] [PATCH 2/2] pty04: Fix cleanup Martin Doucha
                   ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Martin Doucha @ 2022-05-19 12:10 UTC (permalink / raw)
  To: ltp

Resizing console to 1x1 breaks some QA automation systems. Keep the original
console dimensions throughout the test.

Signed-off-by: Martin Doucha <mdoucha@suse.cz>
---
 testcases/kernel/pty/pty07.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/testcases/kernel/pty/pty07.c b/testcases/kernel/pty/pty07.c
index c63b71c89..ae600b692 100644
--- a/testcases/kernel/pty/pty07.c
+++ b/testcases/kernel/pty/pty07.c
@@ -40,6 +40,7 @@ static int test_tty_port = 8;
 static int fd = -1;
 static struct tst_fzsync_pair fzp;
 
+static struct vt_consize consize;
 static unsigned short vt_active;
 
 static void *open_close(void *unused)
@@ -60,13 +61,12 @@ static void *open_close(void *unused)
 
 static void do_test(void)
 {
-	struct vt_consize sz = { 0x1, 0x1, 0x1, 0x1, 0x1, 0x1 };
 
 	tst_fzsync_pair_reset(&fzp, open_close);
 
 	while (tst_fzsync_run_a(&fzp)) {
 		tst_fzsync_start_race_a(&fzp);
-		ioctl(fd, VT_RESIZEX, &sz);
+		ioctl(fd, VT_RESIZEX, &consize);
 		tst_fzsync_end_race_a(&fzp);
 		if (tst_taint_check()) {
 			tst_res(TFAIL, "Kernel is buggy");
@@ -79,6 +79,7 @@ static void do_test(void)
 static void setup(void)
 {
 	struct vt_stat stat;
+	struct winsize wsize;
 
 	sprintf(tty_path, "/dev/tty%d", test_tty_port);
 	if (access(tty_path, F_OK))
@@ -90,6 +91,9 @@ static void setup(void)
 
 	tst_res(TINFO, "Saving active console %i", vt_active);
 
+	SAFE_IOCTL(fd, TIOCGWINSZ, &wsize);
+	consize.v_rows = wsize.ws_row;
+	consize.v_cols = wsize.ws_col;
 	tst_fzsync_pair_init(&fzp);
 }
 
-- 
2.36.0


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

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

end of thread, other threads:[~2022-05-20 11:56 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-19 12:10 [LTP] [PATCH 1/2] pty07: Resize console to the same size as before Martin Doucha
2022-05-19 12:10 ` [LTP] [PATCH 2/2] pty04: Fix cleanup Martin Doucha
2022-05-20  9:01   ` Petr Vorel
2022-05-20  9:08     ` Martin Doucha
2022-05-20  9:13       ` Petr Vorel
2022-05-20  9:21         ` Cyril Hrubis
2022-05-20 11:30           ` Petr Vorel
2022-05-20  9:22   ` Cyril Hrubis
2022-05-20 11:55     ` Petr Vorel
2022-05-20  9:05 ` [LTP] [PATCH 1/2] pty07: Resize console to the same size as before Petr Vorel
2022-05-20  9:26 ` Cyril Hrubis
2022-05-20  9:33   ` Martin Doucha
2022-05-20 11:50     ` Petr Vorel

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.