]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
Don't execute network-using tests by default
authorZack Cerza <zack@cerza.org>
Thu, 10 Jul 2014 18:32:02 +0000 (12:32 -0600)
committerZack Cerza <zack@cerza.org>
Thu, 10 Jul 2014 18:32:02 +0000 (12:32 -0600)
Set TEST_ONLINE to use them.

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

index abf8edbc121bc2bdb1043e284b2f79d46a47fc23..0a9fb5e08ed4df5be55072dd6694ce2702805b09 100644 (file)
@@ -1,12 +1,13 @@
+import os
 import requests
 from datetime import datetime
-from pytest import raises
+from pytest import raises, skip
 
 from teuthology.config import config
 from teuthology import suite
 
 
-class TestSuite(object):
+class TestSuiteOffline(object):
     def test_name_timestamp_passed(self):
         stamp = datetime.now().strftime('%Y-%m-%d_%H:%M:%S')
         name = suite.make_run_name('suite', 'ceph', 'kernel', 'flavor',
@@ -24,12 +25,6 @@ class TestSuite(object):
                                    'mtype', user='USER')
         assert name.startswith('USER-')
 
-    def test_ceph_hash(self):
-        resp = requests.get(
-            'https://api.github.com/repos/ceph/ceph/git/refs/heads/master')
-        ref_hash = resp.json()['object']['sha']
-        assert suite.get_hash('ceph') == ref_hash
-
     def test_distro_defaults_saya(self):
         assert suite.get_distro_defaults('ubuntu', 'saya') == ('armv7l',
                                                                'saucy', 'deb')
@@ -44,6 +39,18 @@ class TestSuite(object):
         assert suite.get_gitbuilder_url('ceph', 'squeeze', 'deb', 'x86_64',
                                         'basic') == ref_url
 
+
+class TestSuiteOnline(object):
+    def setup(self):
+        if 'TEST_ONLINE' not in os.environ:
+            skip("To run these sets, set the environment variable TEST_ONLINE")
+
+    def test_ceph_hash(self):
+        resp = requests.get(
+            'https://api.github.com/repos/ceph/ceph/git/refs/heads/master')
+        ref_hash = resp.json()['object']['sha']
+        assert suite.get_hash('ceph') == ref_hash
+
     def test_config_bogus_kernel_branch(self):
         # Don't attempt to send email
         config.results_email = None