demux: mp4: check handler before dereferencing sample entry
[vlc.git] / test / modules / lua / telnet.sh
blob5716bf6f2f549d06698634f3e5998fca3c37524b
1 #!/bin/sh
3 TELNET_FAIL="telnet_fail"
4 PORT=`echo "$$+1024" | bc`
6 killer()
8 sleep 2 && ps $1 > /dev/null && touch $TELNET_FAIL && kill -9 $1
11 wait_or_quit()
13 wait $1
14 if [ `ls $TELNET_FAIL 2> /dev/null | wc -l` = 1 ]
15 then
16 rm -f $TELNET_FAIL
17 exit 1
21 # Remove the fail file if needed
22 rm -f $TELNET_FAIL
24 # Test that VLC handle options correctly
25 ../vlc -I luatelnet --telnet-port $PORT &
26 VLC1=$!
27 sleep 1
28 killer $VLC1 &
29 echo "admin\nshutdown\n" | nc localhost $PORT
30 wait_or_quit $VLC1
32 ../vlc -I luatelnet --telnet-port $PORT --telnet-password bla &
33 VLC2=$!
34 sleep 1
35 killer $VLC2 &
36 echo "bla\nshutdown\n" | nc localhost $PORT
37 wait_or_quit $VLC2
39 ../vlc -I luatelnet --telnet-port $PORT --telnet-password one_long_password &
40 VLC3=$!
41 sleep 1
42 killer $VLC3 &
43 echo "one_long_password\nshutdown\n" | nc localhost $PORT
44 wait_or_quit $VLC3
46 ../vlc -I luatelnet --telnet-port $PORT --telnet-password "" &
47 VLC4=$!
48 sleep 1
49 killer $VLC4 &
50 echo "\nshutdown\n" | nc localhost $PORT
51 wait_or_quit $VLC4
53 exit 0