⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 test

📁 intercept tty is using for listening a UART conversation
💻
字号:
#!/bin/bash# You can run this script after building to test out interceptty in a# safe way.# These two settings are adjustable, although the defaults will# probably work fine.INET_PORT=9999DELAY=2trap 'exec 2>/dev/null; [ -n "$kids" ] && kill $kids' EXITprintf "%40s" "Starting up echo server..."./interceptty -q '!cat' ./test1.tty &kids="$kids $!"sleep $DELAYif [ -c ./test1.tty ]then  echo "OK"else  echo "NO"  exit 1fiprintf "%40s" "Testing echo server..."if ./testport ./test1.tty "Test 1 OK"then  echo "OK"else  echo "NO"  exit 1fiprintf "%40s" "Starting up tty server..."./interceptty -q ./test1.tty ./test2.tty &kids="$kids $!"sleep $DELAYif [ -c ./test2.tty ]then  echo "OK"else  echo "NO"  exit 1fiprintf "%40s" "Testing tty server..."if ./testport ./test2.tty "Test 2 OK"then  echo "OK"else  echo "NO"  exit 1fiprintf "%40s" "Starting Unix socket server..."./interceptty -q ./test2.tty @./test3.sock &kids="$kids $!"sleep $DELAYif [ -r ./test3.sock ]then  echo "OK"else  echo "NO"  exit 1fiprintf "%40s" "Starting Unix socket client..."./interceptty -q @./test3.sock ./test4.tty &kids="$kids $!"sleep $DELAYif [ -c ./test4.tty ]then  echo "OK"else  echo "NO"  exit 1fiprintf "%40s" "Testing Unix sockets..."if ./testport ./test4.tty "Test 4 OK"then  echo "OK"else  echo "NO"  exit 1fiprintf "%40s" "Starting file descriptor server..."./interceptty -q =0,1 ./test5.tty <test4.tty >>test4.tty  &kids="$kids $!"sleep $DELAYif [ -c ./test5.tty ]then  echo "OK"else  echo "NO"  exit 1fiprintf "%40s" "Testing file descriptors..."if ./testport ./test5.tty "Test 5 OK"then  echo "OK"else  echo "NO"  exit 1fiprintf "%40s" "Starting Inet server on port $INET_PORT..."./interceptty -q ./test5.tty @localhost:$INET_PORT &kids="$kids $!"sleep $DELAY# The netstat test we used to do doesn't work in some configurations.echo "OK"printf "%40s" "Starting Inet client on port $INET_PORT..."./interceptty -q @localhost:$INET_PORT ./test6.tty  &kids="$kids $!"sleep $DELAYif [ -c ./test6.tty ]then  echo "OK"else  echo "NO"  echo "You may want to try changing the port used for testing, at the top of $0."  exit 1fiprintf "%40s" "Testing Internet socket server..."if ./testport ./test6.tty "Test 6 OK"then  echo "OK"else  echo "You may want to try changing the port used for testing, at the top of $0."  echo "NO"  exit 1fiexit 0

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -