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
f764da8a
Commit
f764da8a
authored
13 years ago
by
Yang Tse
Browse files
Options
Downloads
Patches
Plain Diff
test case 583: ensure that test failures don't go unnoticed
parent
c8ba8740
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/data/test583
+3
-4
3 additions, 4 deletions
tests/data/test583
tests/libtest/lib583.c
+50
-18
50 additions, 18 deletions
tests/libtest/lib583.c
with
53 additions
and
22 deletions
tests/data/test583
+
3
−
4
View file @
f764da8a
...
...
@@ -35,9 +35,8 @@ sftp://localhost:%SSHPORT%PWD/log/upload583.txt %USER:
# Verify data after the test has been "shot"
<verify>
<strip>
</strip>
<protocol>
</protocol>
<errorcode>
0
</errorcode>
</verify>
</testcase>
This diff is collapsed.
Click to expand it.
tests/libtest/lib583.c
+
50
−
18
View file @
f764da8a
...
...
@@ -34,43 +34,75 @@
int
test
(
char
*
URL
)
{
CURLMcode
retVal
;
int
stillRunning
;
CURLM
*
multiHandle
;
CURL
*
curl
;
int
res1
=
0
;
int
res
;
curl_global_init
(
CURL_GLOBAL_ALL
);
if
(
curl_global_init
(
CURL_GLOBAL_ALL
)
!=
CURLE_OK
)
{
fprintf
(
stderr
,
"curl_global_init() failed
\n
"
);
return
TEST_ERR_MAJOR_BAD
;
}
multiHandle
=
curl_multi_init
();
curl
=
curl_easy_init
();
if
((
multiHandle
=
curl_multi_init
())
==
NULL
)
{
fprintf
(
stderr
,
"curl_multi_init() failed
\n
"
);
curl_global_cleanup
();
return
TEST_ERR_MAJOR_BAD
;
}
if
((
curl
=
curl_easy_init
())
==
NULL
)
{
fprintf
(
stderr
,
"curl_easy_init() failed
\n
"
);
curl_multi_cleanup
(
multiHandle
);
curl_global_cleanup
();
return
TEST_ERR_MAJOR_BAD
;
}
test_setopt
(
curl
,
CURLOPT_USERPWD
,
libtest_arg2
);
test_setopt
(
curl
,
CURLOPT_SSH_PUBLIC_KEYFILE
,
"curl_client_key.pub"
);
test_setopt
(
curl
,
CURLOPT_SSH_PRIVATE_KEYFILE
,
"curl_client_key"
);
curl_easy_setopt
(
curl
,
CURLOPT_UPLOAD
,
1
);
curl_easy_setopt
(
curl
,
CURLOPT_VERBOSE
,
1
);
test_setopt
(
curl
,
CURLOPT_UPLOAD
,
1
);
test_setopt
(
curl
,
CURLOPT_VERBOSE
,
1
);
test_setopt
(
curl
,
CURLOPT_URL
,
URL
);
test_setopt
(
curl
,
CURLOPT_INFILESIZE
,
(
long
)
5
);
curl_easy_setopt
(
curl
,
CURLOPT_URL
,
URL
);
curl_easy_setopt
(
curl
,
CURLOPT_INFILESIZE
,
(
long
)
5
);
if
((
res
=
(
int
)
curl_multi_add_handle
(
multiHandle
,
curl
))
!=
CURLM_OK
)
{
fprintf
(
stderr
,
"curl_multi_add_handle() failed, "
"with code %d
\n
"
,
res
);
curl_easy_cleanup
(
curl
);
curl_multi_cleanup
(
multiHandle
);
curl_global_cleanup
();
return
TEST_ERR_MAJOR_BAD
;
}
curl_multi_add_handle
(
multiHandle
,
curl
);
retVal
=
curl_multi_perform
(
multiHandle
,
&
stillRunning
);
if
(
retVal
!=
CURLM_OK
)
fprintf
(
stderr
,
"curl_multi_perform() failed!n"
);
/* this tests if removing an easy handle immediately after multi
perform has been called succeeds or not. Logged afterwards */
res1
=
(
int
)
curl_multi_perform
(
multiHandle
,
&
stillRunning
);
res
=
(
int
)
curl_multi_remove_handle
(
multiHandle
,
curl
);
fprintf
(
stderr
,
"curl_multi_remove_handle()!
\n
"
);
retVal
=
curl_multi_remove_handle
(
multiHandle
,
curl
);
if
(
retVal
==
CURLM_OK
)
fprintf
(
stderr
,
"curl_multi_remove_handle() was successful!
\n
"
);
if
(
res1
)
fprintf
(
stderr
,
"curl_multi_perform() failed, "
"with code %d
\n
"
,
res1
);
else
fprintf
(
stderr
,
"curl_multi_remove_handle() failed
\n
"
);
fprintf
(
stderr
,
"curl_multi_perform() succeeded
\n
"
);
if
(
res
)
fprintf
(
stderr
,
"curl_multi_remove_handle() failed, "
"with code %d
\n
"
,
res
);
else
fprintf
(
stderr
,
"curl_multi_remove_handle() succeeded
\n
"
);
test_cleanup:
curl_easy_cleanup
(
curl
);
curl_multi_cleanup
(
multiHandle
);
curl_global_cleanup
();
return
res
;
if
(
res
)
return
res
;
else
return
res1
;
}
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