]> git-server-git.apps.pok.os.sepia.ceph.com Git - teuthology.git/commitdiff
Allow testing with online repos
authorZack Cerza <zack@cerza.org>
Wed, 2 Jul 2014 16:19:25 +0000 (10:19 -0600)
committerZack Cerza <zack@cerza.org>
Wed, 2 Jul 2014 16:19:25 +0000 (10:19 -0600)
It is not the default.

Signed-off-by: Zack Cerza <zack.cerza@inktank.com>
teuthology/test/test_repo_utils.py

index 0cb7b06022af1a6cfdeb1f8de1435257b0a881ad..c3954b176be6282c6d5aea75dffd0752ed37326a 100644 (file)
@@ -1,4 +1,5 @@
 import logging
+import os
 import os.path
 from pytest import raises
 import shutil
@@ -11,9 +12,18 @@ repo_utils.log.setLevel(logging.WARNING)
 
 class TestRepoUtils(object):
     src_path = '/tmp/empty_src'
-    repo_url = 'file://' + src_path
+    online_repo_url = 'https://github.com/ceph/empty.git'
+    offline_repo_url = 'file://' + src_path
+    repo_url = None
     dest_path = '/tmp/empty_dest'
 
+    @classmethod
+    def setup_class(cls):
+        if 'TEST_ONLINE' in os.environ:
+            cls.repo_url = cls.online_repo_url
+        else:
+            cls.repo_url = cls.offline_repo_url
+
     def setup_method(self, method):
         assert not os.path.exists(self.dest_path)
         proc = subprocess.Popen(
@@ -114,8 +124,7 @@ class TestRepoUtils(object):
         count = 5
         with parallel.parallel() as p:
             for i in range(count):
-                print "starting %s" % i
                 p.spawn(repo_utils.enforce_repo_state, self.repo_url,
                         self.dest_path, 'master')
             for result in p:
-                print "result %s %s" % (i, result)
+                assert result is None