Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
TLMSP curl
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
CYBER - Cyber Security
TS 103 523 MSP
TLMSP
TLMSP curl
Commits
7c6414eb
Commit
7c6414eb
authored
24 years ago
by
Daniel Stenberg
Browse files
Options
Downloads
Patches
Plain Diff
uses stricter output
parent
85705e10
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
tests/httpserver.pl
+21
-8
21 additions, 8 deletions
tests/httpserver.pl
tests/runtests.pl
+24
-8
24 additions, 8 deletions
tests/runtests.pl
with
45 additions
and
16 deletions
tests/httpserver.pl
+
21
−
8
View file @
7c6414eb
...
...
@@ -29,7 +29,9 @@ setsockopt(Server, SOL_SOCKET, SO_REUSEADDR,
bind
(
Server
,
sockaddr_in
(
$port
,
INADDR_ANY
))
||
die
"
bind: $!
";
listen
(
Server
,
SOMAXCONN
)
||
die
"
listen: $!
";
print
"
HTTP server started on port
$port
\n
";
if
(
$verbose
)
{
print
"
HTTP server started on port
$port
\n
";
}
open
(
PID
,
"
>.server.pid
");
print
PID
$$
;
...
...
@@ -115,10 +117,13 @@ for ( $waitedpid = 0;
my
$testnum
;
if
(
$path
=~
/.*\/(\d*)/
)
{
$testnum
=
$
1
;
if
(
$verbose
)
{
print
STDERR
"
sending reply
$testnum
\n
";
}
}
else
{
print
STDERR
"
UKNOWN TEST CASE
\n
";
exit
;
$testnum
=
0
;
}
open
(
INPUT
,
"
>log/server.input
");
for
(
@headers
)
{
...
...
@@ -126,12 +131,20 @@ for ( $waitedpid = 0;
}
close
(
INPUT
);
# send a reply to the client
open
(
DATA
,
"
<data/reply
$testnum
.txt
");
while
(
<
DATA
>
)
{
print
$_
;
if
(
0
==
$testnum
)
{
print
"
HTTP/1.1 200 OK
\r\n
",
"
header: yes
\r\n
",
"
\r\n
",
"
You must select a test number to get good data back
\r\n
";
}
else
{
# send a custom reply to the client
open
(
DATA
,
"
<data/reply
$testnum
.txt
");
while
(
<
DATA
>
)
{
print
$_
;
}
close
(
DATA
);
}
close
(
DATA
);
}
# print "Hello there, $name, it's now ", scalar localtime, "\r\n";
};
...
...
This diff is collapsed.
Click to expand it.
tests/runtests.pl
+
24
−
8
View file @
7c6414eb
...
...
@@ -44,6 +44,7 @@ my $memanalyze="../memanalyze.pl";
my
$short
;
my
$verbose
;
my
$anyway
;
#######################################################################
# Return the pid of the http server as found in the pid file
...
...
@@ -66,7 +67,7 @@ sub stopserver {
my
$res
=
kill
(
9
,
$PID
);
# die!
unlink
$PIDFILE
;
# server is killed
if
(
$res
)
{
if
(
$res
&&
$verbose
)
{
print
"
TCP server signalled to die
\n
";
}
}
...
...
@@ -223,11 +224,15 @@ sub compare {
$res
=
comparefiles
(
$first
,
$sec
);
if
(
$res
!=
0
)
{
print
"
$text
FAILED
";
if
(
!
$short
)
{
print
"
$text
FAILED
";
}
return
1
;
}
print
"
$text
OK
";
if
(
!
$short
)
{
print
"
$text
OK
";
}
return
0
;
}
...
...
@@ -244,16 +249,17 @@ sub displaydata {
print
"
Running tests on:
\n
",
"
*
$version
",
"
*
h
ost
$hostname
",
"
*
s
ystem
$hosttype
";
"
*
H
ost
:
$hostname
",
"
*
S
ystem
:
$hosttype
";
if
(
-
r
$memdump
)
{
# if this exists, curl was compiled with memory debugging
# enabled and we shall verify that no memory leaks exist
# after each and every test!
$memory_debug
=
1
;
print
"
** Memory debugging ENABLED
\n
";
}
printf
("
* Memory debugging: %s
\n
",
$memory_debug
?"
ON
":"
OFF
");
}
#######################################################################
...
...
@@ -399,11 +405,16 @@ sub singletest {
return
1
;
}
else
{
print
"
memory OK
";
if
(
!
$short
)
{
print
"
memory OK
";
}
}
}
}
}
if
(
$short
)
{
print
"
OK
";
}
print
"
\n
";
return
0
;
...
...
@@ -423,10 +434,15 @@ do {
# short output
$short
=
1
;
}
elsif
(
$ARGV
[
0
]
eq
"
-a
")
{
# continue anyway, even if a test fail
$anyway
=
1
;
}
elsif
(
$ARGV
[
0
]
eq
"
-h
")
{
# show help text
print
<<EOHELP
Usage: runtests.pl [-h][-s][-v][numbers]
-a continue even if a test fails
-h this help text
-s short output
-v verbose output
...
...
@@ -487,7 +503,7 @@ if ( $TESTCASES eq "all") {
my
$testnum
;
foreach
$testnum
(
split
("
",
$TESTCASES
))
{
if
(
singletest
(
$testnum
))
{
if
(
singletest
(
$testnum
)
&&
!
$anyway
)
{
# a test failed, abort
print
"
\n
- abort tests
\n
";
last
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment