Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
ffb601a5
Commit
ffb601a5
authored
Nov 08, 2010
by
Rémi Duraffort
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
luatelnet auto test: use the current PID as port number.
parent
0656ac9c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
12 deletions
+15
-12
test/modules/misc/lua/telnet.sh
test/modules/misc/lua/telnet.sh
+15
-12
No files found.
test/modules/misc/lua/telnet.sh
View file @
ffb601a5
#!/bin/sh
#!/bin/sh
TELNET_FAIL
=
"telnet_fail"
PORT
=
$$
killer
()
killer
()
{
{
sleep
2
&&
ps
$1
>
/dev/null
&&
touch
"telnet_fail"
&&
kill
-9
$1
sleep
2
&&
ps
$1
>
/dev/null
&&
touch
$TELNET_FAIL
&&
kill
-9
$1
}
}
wait_or_quit
()
wait_or_quit
()
{
{
wait
$1
wait
$1
if
[
`
ls
telnet_fail
2> /dev/null |
wc
-l
`
=
1
]
if
[
`
ls
$TELNET_FAIL
2> /dev/null |
wc
-l
`
=
1
]
then
then
rm
-f
telnet_fail
rm
-f
$TELNET_FAIL
exit
1
exit
1
fi
fi
}
}
# Remove the fail file if needed
# Remove the fail file if needed
rm
-f
telnet_fail
rm
-f
$TELNET_FAIL
# Test that VLC handle options correctly
# Test that VLC handle options correctly
../vlc
-I
luatelnet &
../vlc
-I
luatelnet
--telnet-port
$PORT
&
VLC1
=
$!
VLC1
=
$!
sleep
1
sleep
1
killer
$VLC1
&
killer
$VLC1
&
echo
"admin
\n
shutdown
\n
"
| nc localhost
4212
echo
"admin
\n
shutdown
\n
"
| nc localhost
$PORT
wait_or_quit
$VLC1
wait_or_quit
$VLC1
../vlc
-I
luatelnet
--telnet-port
4312
&
../vlc
-I
luatelnet
--telnet-port
$PORT
--telnet-password
bla
&
VLC2
=
$!
VLC2
=
$!
sleep
1
sleep
1
killer
$VLC2
&
killer
$VLC2
&
echo
"
admin
\n
shutdown
\n
"
| nc localhost 4312
echo
"
bla
\n
shutdown
\n
"
| nc localhost
$PORT
wait_or_quit
$VLC2
wait_or_quit
$VLC2
../vlc
-I
luatelnet
--telnet-port
1234
--telnet-password
bla
&
../vlc
-I
luatelnet
--telnet-port
$PORT
--telnet-password
one_long_password
&
VLC3
=
$!
VLC3
=
$!
sleep
1
sleep
1
killer
$VLC3
&
killer
$VLC3
&
echo
"
bla
\n
shutdown
\n
"
| nc localhost 1234
echo
"
one_long_password
\n
shutdown
\n
"
| nc localhost
$PORT
wait_or_quit
$VLC3
wait_or_quit
$VLC3
../vlc
-I
luatelnet
--telnet-port
1234
--telnet-password
one_long_password
&
../vlc
-I
luatelnet
--telnet-port
$PORT
--telnet-password
""
&
VLC4
=
$!
VLC4
=
$!
sleep
1
sleep
1
killer
$VLC4
&
killer
$VLC4
&
echo
"
one_long_password
\n
shutdown
\n
"
| nc localhost 1234
echo
"
\n
shutdown
\n
"
| nc localhost
$PORT
wait_or_quit
$VLC4
wait_or_quit
$VLC4
exit
0
exit
0
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment