aboutsummaryrefslogtreecommitdiff
path: root/tests/netcat.test
blob: 81e6ec7dc33cea67cbf495ec19cce3788e4fe67f (plain)
1
2
3
4
5
6
7
8
9
10
11
#!/bin/bash

[ -f testing.sh ] && . testing.sh

#testing "name" "command" "result" "infile" "stdin"

{ dd if=/dev/zero bs=4k count=1 2>/dev/null | tr '\0' a; echo b; } > testfile
testing "more than buffer bytes left at end" \
  "netcat -lp 1234 wc -c & sleep .1 && cat testfile | netcat 127.0.0.1 1234" \
  "4098\n" "" ""
rm -f testfile