File: test_stdio_basic_stderr.py

package info (click to toggle)
gensio 3.0.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 8,364 kB
  • sloc: ansic: 90,328; python: 5,220; sh: 4,935; cpp: 3,258; makefile: 1,418
file content (25 lines) | stat: -rw-r--r-- 627 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#
#  gensio - A library for abstracting stream I/O
#  Copyright (C) 2018  Corey Minyard <minyard@acm.org>
#
#  SPDX-License-Identifier: GPL-2.0-only
#

from utils import *
import gensio

print("Test stdio basic stderr echo")
io = alloc_io(o, "stdio,sh -c 'cat 1>&2'", chunksize = 64)
io.handler.ignore_input = True
io.read_cb_enable(True)
err = io.alloc_channel(None, None)
err.open_s()
check_raddr(err, "stderr basic", 'stderr,"sh" "-c" "cat 1>&2"')
HandleData(o, "stderr", chunksize = 64, io = err)
test_dataxfer(io, err, "This is a test string!")
io_close((io, err))
del io
del err
del o
test_shutdown()
print("  Success!")