#!/bin/bash
# Use bash, not sh, for redirection to subshell: 2> >( ... )

. ./test-functions

echo -n "Unix-domain sock, exit first test:	"
socket=$(mktemp -u sft-XXXXXX)
_wget=$(copy wget)
( # Sub-shell so as not to taint the test process.
	
	cat confidential | ./programs/unixsockcat $socket &
	sleep 1
	nc -i 1 -U $socket 2> >( grep -v "Idle timeout" ) | test_evil_bit $_wget --no-check-certificate -i - --quiet -O /dev/null
)

rm -f $socket
rm -f $_wget
