pty: Test data transmission with SLIP line discipline
PATCH v3 1/1 pty: Test data transmission with SLIP line discipline
Basic transmission test and try to trigger a possible race between receiving and hangup (it appears there is none from my testing).
This only includes SLIP for now, but more disciplines can be added. Probably at least CAN. However the packet generation will be different for each.
---
V3:
* Use linux/tty.h
runtest/pty | 1 + testcases/kernel/pty/.gitignore | 1 + testcases/kernel/pty/pty04.c | 279 ++++++++++++++++++++++++++++++++ 3 files changed, 281 insertions(+) create mode 100644 testcases/kernel/pty/pty04.c
runtest/pty +1 -0
@@ -2,6 +2,7 @@ pty01 pty01 pty02 pty02 pty03 pty03 +pty04 pty04 ptem01 ptem01 hangup01 hangup01
testcases/kernel/pty/.gitignore +1 -0
@@ -3,3 +3,4 @@ /pty01 /pty02 /pty03 +/pty04
testcases/kernel/pty/pty04.c new file +279 -0
279 lines not on this page · raw message
Signature · 1 line
2.24.0
PATCH v3 1/1 pty: Test data transmission with SLIP line discipline
Hi Richard,
...
testcases/kernel/pty/pty04.c line 74
Quoted 13 lines
testcases/kernel/pty/pty04.c new file +13
-0+static int set_ldisc (int tty,struct ldisc_info *ldisc) +{ +TEST (ioctl (tty,TIOCSETD , &ldisc->n)); + +if (!TST_RET ) +return 0 ; + +if (TST_ERR ==EINVAL ) { +tst_res (TCONF |TTERRNO , +"You don't appear to have the %s TTY line discipline" , + ldisc->name); + }else { + tst_res(TBROK | TTERRNO,
This must be TFAIL now.
This can be done by person who merges this patch.
BTW as the same function (with corrected TBROK) is already in pty03.c (although struct ldisc_info is different).
Kind regards,
Petr
PATCH v3 1/1 pty: Test data transmission with SLIP line discipline
Hi,
Quoted 19 lines · Petr Vorel
Hi Richard,
...
testcases/kernel/pty/pty04.c line 74
Quoted 13 lines
testcases/kernel/pty/pty04.c new file +13
-0+static int set_ldisc (int tty,struct ldisc_info *ldisc) +{ +TEST (ioctl (tty,TIOCSETD , &ldisc->n)); + +if (!TST_RET ) +return 0 ; + +if (TST_ERR ==EINVAL ) { +tst_res (TCONF |TTERRNO , +"You don't appear to have the %s TTY line discipline" , + ldisc->name); + }else { + tst_res(TBROK | TTERRNO,This must be TFAIL now.
This can be done by person who merges this patch.
Quoted 2 lines
BTW as the same function (with corrected TBROK) is already in
pty03.c(although structldisc_infois different).
HHmm, I suppose this also means I should also either check the return value in open_pty or use tst_brk.
Quoted 3 lines
Kind regards,
Petr
Signature · 2 lines
Thank you, Richard.