From 71182fd86b7df7313217649b3a7818a094366497 Mon Sep 17 00:00:00 2001 From: Zack Cerza Date: Wed, 2 Jul 2014 10:19:25 -0600 Subject: [PATCH] Allow testing with online repos It is not the default. Signed-off-by: Zack Cerza --- teuthology/test/test_repo_utils.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/teuthology/test/test_repo_utils.py b/teuthology/test/test_repo_utils.py index 0cb7b0602..c3954b176 100644 --- a/teuthology/test/test_repo_utils.py +++ b/teuthology/test/test_repo_utils.py @@ -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 -- 2.47.3