summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Ipsum <richard.ipsum@codethink.co.uk>2014-02-18 14:24:29 +0000
committerRichard Ipsum <richard.ipsum@codethink.co.uk>2014-02-18 14:24:29 +0000
commit37985fc34cc966bce35dbe4faceda92db3f8b8da (patch)
treeb6f9596c6d76af4747beca382afe1972ee997071
parent23282afa300099cb67cf93760cf8ca63b636d754 (diff)
downloadsystem-tests-37985fc34cc966bce35dbe4faceda92db3f8b8da.tar.gz
add the https clone test
-rwxr-xr-xtest.py18
1 files changed, 13 insertions, 5 deletions
diff --git a/test.py b/test.py
index d44e84e..a79ccd0 100755
--- a/test.py
+++ b/test.py
@@ -17,12 +17,12 @@ def remote_runcmd(url, command):
# Err find out why this doesn't work when i'm less frazzled
#subprocess.Popen(['ssh', url] + command, shell=True)
-def run_git(args, working_dir):
+def run_git(args, working_dir, env=None):
#return cliapp.runcmd(['git'] + args, **kwargs)
#print 'args', args
#print ['git'] + args
- p = subprocess.Popen(['git'] + args, cwd=working_dir)
+ p = subprocess.Popen(['git'] + args, cwd=working_dir, env=env)
return_code = p.wait()
if return_code != 0:
@@ -54,10 +54,10 @@ def create_test_repo(remote_url, project, repo):
remote_runcmd(remote_url,
['create', "%s/%s/%s" % (trove_id, project, repo)])
-def can_clone(url):
+def can_clone(url, env=None):
workspace_dir = tempfile.mkdtemp()
- run_git(['clone', url], workspace_dir)
+ run_git(['clone', url], workspace_dir, env)
shutil.rmtree(workspace_dir)
@@ -149,4 +149,12 @@ can_clone('http://%s/git/delta/zip' % trove_id)
try:
can_push('http://%s/git/delta/zip' % trove_id, 'zip')
except:
- print("That's great, we're expecting this to fail!") \ No newline at end of file
+ print("That's great, we're expecting this to fail!")
+
+# Ok, now for https
+username = 'richardipsum'
+password = 'quack'
+
+can_clone('https://%s:%s@%s/git/%s/%s/%s' %
+ (username, password, trove_id, trove_id, project, repo),
+ env={'GIT_SSL_NO_VERIFY': '1'})