File tests/git2.php changed (mode: 100644) (index 6d4a7e3..25937f3) |
... |
... |
if (strstr($r['body'], 'a signature') === FALSE) { |
119 |
119 |
rg_log_exit(); |
rg_log_exit(); |
120 |
120 |
|
|
121 |
121 |
|
|
|
122 |
|
rg_log(''); |
|
123 |
|
rg_log_enter('Delete a branch must make it disappear also from web...'); |
|
124 |
|
// Pushing a branch |
|
125 |
|
$r = rg_exec("cd git2" |
|
126 |
|
. " && export GIT_SSH_COMMAND=\"ssh -v -o IdentityFile=../keys/git2 -o IdentitiesOnly=yes\"" |
|
127 |
|
. " && git checkout -b branch22" |
|
128 |
|
. " && git push origin branch22", '', FALSE, FALSE); |
|
129 |
|
if ($r['ok'] != 1) { |
|
130 |
|
rg_log_ml('out: ' . $r['errmsg']); |
|
131 |
|
rg_log("Seems I cannot push branch22! err=$err"); |
|
132 |
|
exit(1); |
|
133 |
|
} |
|
134 |
|
// Deleting the branch |
|
135 |
|
$r = rg_exec("cd git2" |
|
136 |
|
. " && export GIT_SSH_COMMAND=\"ssh -v -o IdentityFile=../keys/git2 -o IdentitiesOnly=yes\"" |
|
137 |
|
. " && git push origin :branch22", '', FALSE, FALSE); |
|
138 |
|
if ($r['ok'] != 1) { |
|
139 |
|
rg_log_ml('out: ' . $r['errmsg']); |
|
140 |
|
rg_log("Seems I cannot delete branch22! err=$err"); |
|
141 |
|
exit(1); |
|
142 |
|
} |
|
143 |
|
// Now, the branch should not be visible anymore |
|
144 |
|
$headers = array("Cookie: sid=" . $good_sid); |
|
145 |
|
$r = do_req($test_url . '/user/' . rawurlencode($rg_ui['username']) |
|
146 |
|
. '/' . rawurlencode($repo['name']) . '/source', $data, $headers); |
|
147 |
|
rg_log_ml($r['body']); |
|
148 |
|
if (strstr($r['body'], 'branch22') !== FALSE) { |
|
149 |
|
rg_log_ml('Seems the branch is still on the web!'); |
|
150 |
|
exit(1); |
|
151 |
|
} |
|
152 |
|
rg_log_exit(); |
|
153 |
|
|
|
154 |
|
|
122 |
155 |
rg_log("OK!"); |
rg_log("OK!"); |
123 |
156 |
?> |
?> |
File tests/pr_anon.php changed (mode: 100644) (index 53259e5..e88c08e) |
... |
... |
rg_log_exit(); |
110 |
110 |
|
|
111 |
111 |
|
|
112 |
112 |
rg_log(''); |
rg_log(''); |
113 |
|
rg_log_enter('Do an non-anonymous push...'); |
|
|
113 |
|
rg_log_enter('Do a non-anonymous push...'); |
114 |
114 |
$r = rg_exec('export GIT_SSH_COMMAND="ssh -o IdentityFile=../keys/pr_anon' |
$r = rg_exec('export GIT_SSH_COMMAND="ssh -o IdentityFile=../keys/pr_anon' |
115 |
115 |
. ' -o IdentitiesOnly=yes";' |
. ' -o IdentitiesOnly=yes";' |
116 |
116 |
. 'cd _pr_anon.git; echo "change1" > a;' |
. 'cd _pr_anon.git; echo "change1" > a;' |
File tests/wh_lambda.php changed (mode: 100644) (index b29a163..d3f8cdd) |
... |
... |
if ($r === FALSE) { |
45 |
45 |
rg_log_exit(); |
rg_log_exit(); |
46 |
46 |
|
|
47 |
47 |
|
|
|
48 |
|
$repo = array('name' => 'wh-cloud'); |
|
49 |
|
rg_test_create_repo($db, $rg_ui, $repo); |
|
50 |
|
|
|
51 |
|
|
48 |
52 |
rg_log(''); |
rg_log(''); |
49 |
53 |
rg_log_enter('Registering webhook...'); |
rg_log_enter('Registering webhook...'); |
50 |
54 |
$extra = array( |
$extra = array( |
|
... |
... |
$extra = array( |
52 |
56 |
'wh::description' => 'description2 <xss> lambda', |
'wh::description' => 'description2 <xss> lambda', |
53 |
57 |
'wh::repo' => '', |
'wh::repo' => '', |
54 |
58 |
'wh::refname' => '', |
'wh::refname' => '', |
55 |
|
'wh::idata::events[P]' => 'on', |
|
|
59 |
|
'wh::idata::events[C]' => 'on', // C = create branch |
|
60 |
|
'wh::idata::events[P]' => 'on', // P = push |
56 |
61 |
'wh::idata::access_key_id' => $a['access_key_id'], |
'wh::idata::access_key_id' => $a['access_key_id'], |
57 |
62 |
'wh::idata::secret_access_key' => $a['secret_access_key'], |
'wh::idata::secret_access_key' => $a['secret_access_key'], |
58 |
63 |
'wh::idata::region' => 'eu-central-1', |
'wh::idata::region' => 'eu-central-1', |
|
... |
... |
rg_log_exit(); |
93 |
98 |
|
|
94 |
99 |
|
|
95 |
100 |
rg_log(''); |
rg_log(''); |
96 |
|
rg_log_enter('Creating a repo and pushing it'); |
|
97 |
|
$repo = array('name' => 'wh-cloud'); |
|
98 |
|
rg_test_create_repo($db, $rg_ui, $repo); |
|
|
101 |
|
rg_log_enter('Pushing repo, so the trigger has a chanse to execute...'); |
99 |
102 |
// TODO: extract url from $repo |
// TODO: extract url from $repo |
100 |
103 |
$repo_url = 'ssh://rocketgit@' . $rg_ssh_host . ':' . $rg_ssh_port |
$repo_url = 'ssh://rocketgit@' . $rg_ssh_host . ':' . $rg_ssh_port |
101 |
104 |
. '/user/' . $rg_ui['username'] . '/' . $repo['name']; |
. '/user/' . $rg_ui['username'] . '/' . $repo['name']; |