[run]
-omit = teuthology/test/*
+omit = */test/*
[pytest]
-norecursedirs = .git build virtualenv teuthology.egg-info .tox
+norecursedirs = .git build virtualenv teuthology.egg-info .tox */integration
--- /dev/null
+from teuthology.orchestra import monkey
+monkey.patch_all()
+
+from cStringIO import StringIO
+
+import os
+from teuthology.orchestra import connection, remote, run
+from teuthology.orchestra.test.util import assert_raises
+from teuthology.exceptions import CommandCrashedError, ConnectionLostError
+
+from pytest import skip
+
+HOST = None
+
+
+class TestIntegration():
+ def setup(self):
+ try:
+ host = os.environ['ORCHESTRA_TEST_HOST']
+ except KeyError:
+ skip('To run integration tests, set environment ' +
+ 'variable ORCHESTRA_TEST_HOST to user@host to use.')
+ global HOST
+ HOST = host
+
+ def test_crash(self):
+ ssh = connection.connect(HOST)
+ e = assert_raises(
+ CommandCrashedError,
+ run.run,
+ client=ssh,
+ args=['sh', '-c', 'kill -ABRT $$'],
+ )
+ assert e.command == "sh -c 'kill -ABRT $$'"
+ assert str(e) == "Command crashed: \"sh -c 'kill -ABRT $$'\""
+
+ def test_lost(self):
+ ssh = connection.connect(HOST)
+ e = assert_raises(
+ ConnectionLostError,
+ run.run,
+ client=ssh,
+ args=['sh', '-c', 'kill -ABRT $PPID'],
+ )
+ assert e.command == "sh -c 'kill -ABRT $PPID'"
+ assert str(e) == \
+ "SSH connection was lost: \"sh -c 'kill -ABRT $PPID'\""
+
+ def test_pipe(self):
+ ssh = connection.connect(HOST)
+ r = run.run(
+ client=ssh,
+ args=['cat'],
+ stdin=run.PIPE,
+ stdout=StringIO(),
+ wait=False,
+ )
+ assert r.stdout.getvalue() == ''
+ r.stdin.write('foo\n')
+ r.stdin.write('bar\n')
+ r.stdin.close()
+
+ r.wait()
+ got = r.exitstatus
+ assert got == 0
+ assert r.stdout.getvalue() == 'foo\nbar\n'
+
+ def test_and(self):
+ ssh = connection.connect(HOST)
+ r = run.run(
+ client=ssh,
+ args=['true', run.Raw('&&'), 'echo', 'yup'],
+ stdout=StringIO(),
+ )
+ assert r.stdout.getvalue() == 'yup\n'
+
+ def test_os(self):
+ rem = remote.Remote(HOST)
+ assert rem.os.name
+ assert rem.os.version
+++ /dev/null
-from .. import monkey
-monkey.patch_all()
-
-from cStringIO import StringIO
-
-import os
-from .. import connection, remote, run
-from .util import assert_raises
-from teuthology.exceptions import CommandCrashedError, ConnectionLostError
-
-from pytest import skip
-
-HOST = None
-
-
-class TestIntegration():
- def setup(self):
- try:
- host = os.environ['ORCHESTRA_TEST_HOST']
- except KeyError:
- skip('To run integration tests, set environment ' +
- 'variable ORCHESTRA_TEST_HOST to user@host to use.')
- global HOST
- HOST = host
-
- def test_crash(self):
- ssh = connection.connect(HOST)
- e = assert_raises(
- CommandCrashedError,
- run.run,
- client=ssh,
- args=['sh', '-c', 'kill -ABRT $$'],
- )
- assert e.command == "sh -c 'kill -ABRT $$'"
- assert str(e) == "Command crashed: \"sh -c 'kill -ABRT $$'\""
-
- def test_lost(self):
- ssh = connection.connect(HOST)
- e = assert_raises(
- ConnectionLostError,
- run.run,
- client=ssh,
- args=['sh', '-c', 'kill -ABRT $PPID'],
- )
- assert e.command == "sh -c 'kill -ABRT $PPID'"
- assert str(e) == \
- "SSH connection was lost: \"sh -c 'kill -ABRT $PPID'\""
-
- def test_pipe(self):
- ssh = connection.connect(HOST)
- r = run.run(
- client=ssh,
- args=['cat'],
- stdin=run.PIPE,
- stdout=StringIO(),
- wait=False,
- )
- assert r.stdout.getvalue() == ''
- r.stdin.write('foo\n')
- r.stdin.write('bar\n')
- r.stdin.close()
-
- r.wait()
- got = r.exitstatus
- assert got == 0
- assert r.stdout.getvalue() == 'foo\nbar\n'
-
- def test_and(self):
- ssh = connection.connect(HOST)
- r = run.run(
- client=ssh,
- args=['true', run.Raw('&&'), 'echo', 'yup'],
- stdout=StringIO(),
- )
- assert r.stdout.getvalue() == 'yup\n'
-
- def test_os(self):
- rem = remote.Remote(HOST)
- assert rem.os.name
- assert rem.os.version
--- /dev/null
+import os
+import requests
+from pytest import raises, skip
+
+from teuthology.config import config
+from teuthology import suite
+
+
+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_simple(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_kernel_hash_saya(self):
+ # We don't currently have these packages.
+ assert suite.get_hash('kernel', 'master', 'basic', 'saya') is None
+
+ def test_all_master_branches(self):
+ # Don't attempt to send email
+ config.results_email = None
+ job_config = suite.create_initial_config('suite', 'master',
+ 'master', 'master', 'testing',
+ 'basic', 'centos', 'plana')
+ assert ((job_config.branch, job_config.teuthology_branch,
+ job_config.suite_branch) == ('master', 'master', 'master'))
+
+ def test_config_bogus_kernel_branch(self):
+ # Don't attempt to send email
+ config.results_email = None
+ with raises(suite.ScheduleFailError):
+ suite.create_initial_config('s', None, 'master', 't',
+ 'bogus_kernel_branch', 'f', 'd', 'm')
+
+ def test_config_bogus_kernel_flavor(self):
+ # Don't attempt to send email
+ config.results_email = None
+ with raises(suite.ScheduleFailError):
+ suite.create_initial_config('s', None, 'master', 't', 'k',
+ 'bogus_kernel_flavor', 'd', 'm')
+
+ def test_config_bogus_ceph_branch(self):
+ # Don't attempt to send email
+ config.results_email = None
+ with raises(suite.ScheduleFailError):
+ suite.create_initial_config('s', None, 'bogus_ceph_branch', 't',
+ 'k', 'f', 'd', 'm')
+
+ def test_config_bogus_suite_branch(self):
+ # Don't attempt to send email
+ config.results_email = None
+ with raises(suite.ScheduleFailError):
+ suite.create_initial_config('s', 'bogus_suite_branch', 'master',
+ 't', 'k', 'f', 'd', 'm')
+
+ def test_config_bogus_teuthology_branch(self):
+ # Don't attempt to send email
+ config.results_email = None
+ with raises(suite.ScheduleFailError):
+ suite.create_initial_config('s', None, 'master',
+ 'bogus_teuth_branch', 'k', 'f', 'd',
+ 'm')
+
+ def test_config_substitution(self):
+ # Don't attempt to send email
+ config.results_email = None
+ job_config = suite.create_initial_config('MY_SUITE', 'master',
+ 'master', 'master', 'testing',
+ 'basic', 'centos', 'plana')
+ assert job_config['suite'] == 'MY_SUITE'
+
+ def test_config_kernel_section(self):
+ # Don't attempt to send email
+ config.results_email = None
+ job_config = suite.create_initial_config('MY_SUITE', 'master',
+ 'master', 'master', 'testing',
+ 'basic', 'centos', 'plana')
+ assert job_config['kernel']['kdb'] is True
+
+
+# maybe use notario for the above?
-import os
-import requests
from datetime import datetime
-from pytest import raises, skip
-from teuthology.config import config
from teuthology import suite
assert isinstance(
suite.dict_templ['overrides']['admin_socket']['branch'],
suite.Placeholder)
-
-
-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_simple(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_kernel_hash_saya(self):
- # We don't currently have these packages.
- assert suite.get_hash('kernel', 'master', 'basic', 'saya') is None
-
- def test_all_master_branches(self):
- # Don't attempt to send email
- config.results_email = None
- job_config = suite.create_initial_config('suite', 'master',
- 'master', 'master', 'testing',
- 'basic', 'centos', 'plana')
- assert ((job_config.branch, job_config.teuthology_branch,
- job_config.suite_branch) == ('master', 'master', 'master'))
-
- def test_config_bogus_kernel_branch(self):
- # Don't attempt to send email
- config.results_email = None
- with raises(suite.ScheduleFailError):
- suite.create_initial_config('s', None, 'master', 't',
- 'bogus_kernel_branch', 'f', 'd', 'm')
-
- def test_config_bogus_kernel_flavor(self):
- # Don't attempt to send email
- config.results_email = None
- with raises(suite.ScheduleFailError):
- suite.create_initial_config('s', None, 'master', 't', 'k',
- 'bogus_kernel_flavor', 'd', 'm')
-
- def test_config_bogus_ceph_branch(self):
- # Don't attempt to send email
- config.results_email = None
- with raises(suite.ScheduleFailError):
- suite.create_initial_config('s', None, 'bogus_ceph_branch', 't',
- 'k', 'f', 'd', 'm')
-
- def test_config_bogus_suite_branch(self):
- # Don't attempt to send email
- config.results_email = None
- with raises(suite.ScheduleFailError):
- suite.create_initial_config('s', 'bogus_suite_branch', 'master',
- 't', 'k', 'f', 'd', 'm')
-
- def test_config_bogus_teuthology_branch(self):
- # Don't attempt to send email
- config.results_email = None
- with raises(suite.ScheduleFailError):
- suite.create_initial_config('s', None, 'master',
- 'bogus_teuth_branch', 'k', 'f', 'd',
- 'm')
-
- def test_config_substitution(self):
- # Don't attempt to send email
- config.results_email = None
- job_config = suite.create_initial_config('MY_SUITE', 'master',
- 'master', 'master', 'testing',
- 'basic', 'centos', 'plana')
- assert job_config['suite'] == 'MY_SUITE'
-
- def test_config_kernel_section(self):
- # Don't attempt to send email
- config.results_email = None
- job_config = suite.create_initial_config('MY_SUITE', 'master',
- 'master', 'master', 'testing',
- 'basic', 'centos', 'plana')
- assert job_config['kernel']['kdb'] is True
-
-
-# maybe use notario for the above?
[tox]
-envlist = py27, flake8
+envlist = py27, py27-integration, flake8
[testenv:py27]
sitepackages=True
commands=py.test --cov=teuthology --cov-report=term -v {posargs:teuthology scripts}
+[testenv:py27-integration]
+sitepackages=True
+deps=
+ -r{toxinidir}/requirements.txt
+ pytest
+ mock
+ fudge
+ nose
+ pytest-cov==1.6
+ coverage==3.7.1
+
+commands=py.test --cov=teuthology --cov-report=term -v {posargs:teuthology/test/integration teuthology/orchestra/test/integration}
+basepython=python2.7
+
[testenv:flake8]
deps=
flake8