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
0def60bf
Commit
0def60bf
authored
24 years ago
by
Daniel Stenberg
Browse files
Options
Downloads
Patches
Plain Diff
now supports checks for exit codes and check for memory even when curl
returns (expected) exit code
parent
16654350
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/runtests.pl
+51
-23
51 additions, 23 deletions
tests/runtests.pl
with
51 additions
and
23 deletions
tests/runtests.pl
+
51
−
23
View file @
0def60bf
...
...
@@ -335,13 +335,41 @@ sub singletest {
my
$res
=
system
("
$CMDLINE
");
$res
/=
256
;
my
$ERRORCODE
=
"
$TESTDIR
/error
$NUMBER
.txt
";
if
(
$res
!=
0
)
{
print
"
*** Failed to invoke curl for test
$NUMBER
***
\n
",
"
*** [
$DESC
] ***
\n
",
"
*** The command line was: ***
\n
$CMDLINE
\n
";
return
1
;
# the invoked command return an error code
my
$expectederror
=
0
;
if
(
-
f
$ERRORCODE
)
{
open
(
ERRO
,
"
<
$ERRORCODE
");
$expectederror
=
<
ERRO
>
;
close
(
ERRO
);
# strip non-digits
$expectederror
=~
s/[^0-9]//g
;
}
if
(
$expectederror
!=
$res
)
{
print
"
*** Failed to invoke curl for test
$NUMBER
***
\n
",
"
*** [
$DESC
] ***
\n
",
"
*** The command returned
$res
for: ***
\n
$CMDLINE
\n
";
return
1
;
}
elsif
(
!
$short
)
{
print
"
error OK
";
}
}
else
{
if
(
-
f
$ERRORCODE
)
{
# this command was meant to fail, it didn't and thats WRONG
if
(
!
$short
)
{
print
"
error FAILED
";
}
return
1
;
}
if
(
-
r
"
$VALIDOUT
"
)
{
# verify redirected stdout
$res
=
compare
(
$STDOUT
,
$VALIDOUT
,
"
data
");
...
...
@@ -385,27 +413,27 @@ sub singletest {
unlink
(
$STDOUT
);
unlink
(
$STDERR
);
if
(
$memory_debug
)
{
if
(
!
-
f
$memdump
)
{
print
"
\n
** ALERT! memory debuggin without any output file?
\n
";
}
if
(
$memory_debug
)
{
if
(
!
-
f
$memdump
)
{
print
"
\n
** ALERT! memory debuggin without any output file?
\n
";
}
else
{
my
@memdata
=
`
$memanalyze
<
$memdump
`;
my
$leak
=
0
;
for
(
@memdata
)
{
if
(
$_
=~
/Leak detected/
)
{
$leak
=
1
;
}
}
if
(
$leak
)
{
print
"
\n
** MEMORY LEAK
\n
";
print
@memdata
;
return
1
;
}
else
{
my
@memdata
=
`
$memanalyze
<
$memdump
`;
my
$leak
=
0
;
for
(
@memdata
)
{
if
(
$_
=~
/Leak detected/
)
{
$leak
=
1
;
}
}
if
(
$leak
)
{
print
"
\n
** MEMORY LEAK
\n
";
print
@memdata
;
return
1
;
}
else
{
if
(
!
$short
)
{
print
"
memory OK
";
}
if
(
!
$short
)
{
print
"
memory OK
";
}
}
}
...
...
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