Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
git2
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
git2
Commits
bf55facf
Commit
bf55facf
authored
Oct 25, 2019
by
Edward Thomson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tests: allow users to use expect/continue
parent
7372573b
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
0 deletions
+26
-0
azure-pipelines/test.sh
+12
-0
tests/online/clone.c
+6
-0
tests/online/push.c
+8
-0
No files found.
azure-pipelines/test.sh
View file @
bf55facf
...
@@ -225,6 +225,18 @@ if [ -z "$SKIP_NEGOTIATE_TESTS" -a -n "$GITTEST_NEGOTIATE_PASSWORD" ]; then
...
@@ -225,6 +225,18 @@ if [ -z "$SKIP_NEGOTIATE_TESTS" -a -n "$GITTEST_NEGOTIATE_PASSWORD" ]; then
unset
GITTEST_REMOTE_URL
unset
GITTEST_REMOTE_URL
unset
GITTEST_REMOTE_DEFAULT
unset
GITTEST_REMOTE_DEFAULT
echo
""
echo
"Running SPNEGO tests (expect/continue)"
echo
""
export
GITTEST_REMOTE_URL
=
"https://test.libgit2.org/kerberos/empty.git"
export
GITTEST_REMOTE_DEFAULT
=
"true"
export
GITTEST_REMOTE_EXPECTCONTINUE
=
"true"
run_test authenticate
unset
GITTEST_REMOTE_URL
unset
GITTEST_REMOTE_DEFAULT
unset
GITTEST_REMOTE_EXPECTCONTINUE
kdestroy
-A
kdestroy
-A
fi
fi
...
...
tests/online/clone.c
View file @
bf55facf
...
@@ -30,6 +30,7 @@ static char *_remote_proxy_host = NULL;
...
@@ -30,6 +30,7 @@ static char *_remote_proxy_host = NULL;
static
char
*
_remote_proxy_user
=
NULL
;
static
char
*
_remote_proxy_user
=
NULL
;
static
char
*
_remote_proxy_pass
=
NULL
;
static
char
*
_remote_proxy_pass
=
NULL
;
static
char
*
_remote_proxy_selfsigned
=
NULL
;
static
char
*
_remote_proxy_selfsigned
=
NULL
;
static
char
*
_remote_expectcontinue
=
NULL
;
static
int
_orig_proxies_need_reset
=
0
;
static
int
_orig_proxies_need_reset
=
0
;
static
char
*
_orig_http_proxy
=
NULL
;
static
char
*
_orig_http_proxy
=
NULL
;
...
@@ -74,6 +75,10 @@ void test_online_clone__initialize(void)
...
@@ -74,6 +75,10 @@ void test_online_clone__initialize(void)
_remote_proxy_user
=
cl_getenv
(
"GITTEST_REMOTE_PROXY_USER"
);
_remote_proxy_user
=
cl_getenv
(
"GITTEST_REMOTE_PROXY_USER"
);
_remote_proxy_pass
=
cl_getenv
(
"GITTEST_REMOTE_PROXY_PASS"
);
_remote_proxy_pass
=
cl_getenv
(
"GITTEST_REMOTE_PROXY_PASS"
);
_remote_proxy_selfsigned
=
cl_getenv
(
"GITTEST_REMOTE_PROXY_SELFSIGNED"
);
_remote_proxy_selfsigned
=
cl_getenv
(
"GITTEST_REMOTE_PROXY_SELFSIGNED"
);
_remote_expectcontinue
=
cl_getenv
(
"GITTEST_REMOTE_EXPECTCONTINUE"
);
if
(
_remote_expectcontinue
)
git_libgit2_opts
(
GIT_OPT_ENABLE_HTTP_EXPECT_CONTINUE
,
1
);
_orig_proxies_need_reset
=
0
;
_orig_proxies_need_reset
=
0
;
}
}
...
@@ -99,6 +104,7 @@ void test_online_clone__cleanup(void)
...
@@ -99,6 +104,7 @@ void test_online_clone__cleanup(void)
git__free
(
_remote_proxy_user
);
git__free
(
_remote_proxy_user
);
git__free
(
_remote_proxy_pass
);
git__free
(
_remote_proxy_pass
);
git__free
(
_remote_proxy_selfsigned
);
git__free
(
_remote_proxy_selfsigned
);
git__free
(
_remote_expectcontinue
);
if
(
_orig_proxies_need_reset
)
{
if
(
_orig_proxies_need_reset
)
{
cl_setenv
(
"HTTP_PROXY"
,
_orig_http_proxy
);
cl_setenv
(
"HTTP_PROXY"
,
_orig_http_proxy
);
...
...
tests/online/push.c
View file @
bf55facf
...
@@ -19,6 +19,7 @@ static char *_remote_ssh_pubkey = NULL;
...
@@ -19,6 +19,7 @@ static char *_remote_ssh_pubkey = NULL;
static
char
*
_remote_ssh_passphrase
=
NULL
;
static
char
*
_remote_ssh_passphrase
=
NULL
;
static
char
*
_remote_default
=
NULL
;
static
char
*
_remote_default
=
NULL
;
static
char
*
_remote_expectcontinue
=
NULL
;
static
int
cred_acquire_cb
(
git_cred
**
,
const
char
*
,
const
char
*
,
unsigned
int
,
void
*
);
static
int
cred_acquire_cb
(
git_cred
**
,
const
char
*
,
const
char
*
,
unsigned
int
,
void
*
);
...
@@ -366,12 +367,16 @@ void test_online_push__initialize(void)
...
@@ -366,12 +367,16 @@ void test_online_push__initialize(void)
_remote_ssh_pubkey
=
cl_getenv
(
"GITTEST_REMOTE_SSH_PUBKEY"
);
_remote_ssh_pubkey
=
cl_getenv
(
"GITTEST_REMOTE_SSH_PUBKEY"
);
_remote_ssh_passphrase
=
cl_getenv
(
"GITTEST_REMOTE_SSH_PASSPHRASE"
);
_remote_ssh_passphrase
=
cl_getenv
(
"GITTEST_REMOTE_SSH_PASSPHRASE"
);
_remote_default
=
cl_getenv
(
"GITTEST_REMOTE_DEFAULT"
);
_remote_default
=
cl_getenv
(
"GITTEST_REMOTE_DEFAULT"
);
_remote_expectcontinue
=
cl_getenv
(
"GITTEST_REMOTE_EXPECTCONTINUE"
);
_remote
=
NULL
;
_remote
=
NULL
;
/* Skip the test if we're missing the remote URL */
/* Skip the test if we're missing the remote URL */
if
(
!
_remote_url
)
if
(
!
_remote_url
)
cl_skip
();
cl_skip
();
if
(
_remote_expectcontinue
)
git_libgit2_opts
(
GIT_OPT_ENABLE_HTTP_EXPECT_CONTINUE
,
1
);
cl_git_pass
(
git_remote_create
(
&
_remote
,
_repo
,
"test"
,
_remote_url
));
cl_git_pass
(
git_remote_create
(
&
_remote
,
_repo
,
"test"
,
_remote_url
));
record_callbacks_data_clear
(
&
_record_cbs_data
);
record_callbacks_data_clear
(
&
_record_cbs_data
);
...
@@ -417,10 +422,13 @@ void test_online_push__cleanup(void)
...
@@ -417,10 +422,13 @@ void test_online_push__cleanup(void)
git__free
(
_remote_ssh_pubkey
);
git__free
(
_remote_ssh_pubkey
);
git__free
(
_remote_ssh_passphrase
);
git__free
(
_remote_ssh_passphrase
);
git__free
(
_remote_default
);
git__free
(
_remote_default
);
git__free
(
_remote_expectcontinue
);
/* Freed by cl_git_sandbox_cleanup */
/* Freed by cl_git_sandbox_cleanup */
_repo
=
NULL
;
_repo
=
NULL
;
git_libgit2_opts
(
GIT_OPT_ENABLE_HTTP_EXPECT_CONTINUE
,
0
);
record_callbacks_data_clear
(
&
_record_cbs_data
);
record_callbacks_data_clear
(
&
_record_cbs_data
);
cl_fixture_cleanup
(
"testrepo.git"
);
cl_fixture_cleanup
(
"testrepo.git"
);
...
...
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