summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Callaghan <dcallagh@redhat.com>2011-07-15 15:10:32 +1000
committerDan Callaghan <dcallagh@redhat.com>2011-07-20 13:33:12 +1000
commitdfad3a9401abc739baa7b9abb60c82ec6ef1072f (patch)
treef3c3584d7949e28ec4cc82a0f24faf65c6c9607e
parenta927dc15c520e7ab95b4e47d32e3f5cbdf0db0a5 (diff)
move integration tests into their own subpackagebeaker-distribution-beaker-dogfood-1_1-21
-rw-r--r--.gitignore3
-rw-r--r--IntegrationTests/Makefile19
-rwxr-xr-xIntegrationTests/run-tests.sh20
-rwxr-xr-xIntegrationTests/sanitize_xml.py (renamed from Server/bkr/server/test/sanitize_xml.py)0
-rw-r--r--[-rwxr-xr-x]IntegrationTests/server-test.cfg (renamed from Server/test.cfg)6
-rw-r--r--IntegrationTests/setup.py.in15
-rw-r--r--IntegrationTests/src/bkr/__init__.py6
-rw-r--r--IntegrationTests/src/bkr/inttest/__init__.py178
-rw-r--r--IntegrationTests/src/bkr/inttest/assertions.py (renamed from Server/bkr/server/test/assertions.py)0
-rw-r--r--IntegrationTests/src/bkr/inttest/complete-job.xml (renamed from Server/bkr/server/test/complete-job.xml)0
-rw-r--r--IntegrationTests/src/bkr/inttest/data_setup.py (renamed from Server/bkr/server/test/data_setup.py)0
-rw-r--r--IntegrationTests/src/bkr/inttest/job_35508.xml (renamed from Server/bkr/server/test/job_35508.xml)0
-rw-r--r--IntegrationTests/src/bkr/inttest/job_40214.xml (renamed from Server/bkr/server/test/job_40214.xml)0
-rw-r--r--IntegrationTests/src/bkr/inttest/mail_capture.py (renamed from Server/bkr/server/test/mail_capture.py)0
-rw-r--r--IntegrationTests/src/bkr/inttest/server/__init__.py (renamed from Server/bkr/server/test/tools/__init__.py)0
-rw-r--r--IntegrationTests/src/bkr/inttest/server/motd.xml (renamed from Server/bkr/server/test/motd.xml)0
-rw-r--r--IntegrationTests/src/bkr/inttest/server/selenium/__init__.py (renamed from Server/bkr/server/test/selenium/__init__.py)98
-rw-r--r--IntegrationTests/src/bkr/inttest/server/selenium/invalid-task_file (renamed from Server/bkr/server/test/selenium/invalid-task_file)0
-rw-r--r--IntegrationTests/src/bkr/inttest/server/selenium/test_activity.py (renamed from Server/bkr/server/test/selenium/test_activity.py)4
-rw-r--r--IntegrationTests/src/bkr/inttest/server/selenium/test_add_group.py (renamed from Server/bkr/server/test/selenium/test_add_group.py)6
-rw-r--r--IntegrationTests/src/bkr/inttest/server/selenium/test_add_system.py (renamed from Server/bkr/server/test/selenium/test_add_system.py)6
-rw-r--r--IntegrationTests/src/bkr/inttest/server/selenium/test_add_user.py (renamed from Server/bkr/server/test/selenium/test_add_user.py)6
-rw-r--r--IntegrationTests/src/bkr/inttest/server/selenium/test_add_user_to_group.py (renamed from Server/bkr/server/test/selenium/test_add_user_to_group.py)6
-rw-r--r--IntegrationTests/src/bkr/inttest/server/selenium/test_cancel.py (renamed from Server/bkr/server/test/selenium/test_cancel.py)6
-rw-r--r--IntegrationTests/src/bkr/inttest/server/selenium/test_csv_import.py (renamed from Server/bkr/server/test/selenium/test_csv_import.py)8
-rw-r--r--IntegrationTests/src/bkr/inttest/server/selenium/test_distro_search.py (renamed from Server/bkr/server/test/selenium/test_distro_search.py)6
-rw-r--r--IntegrationTests/src/bkr/inttest/server/selenium/test_distros.py (renamed from Server/bkr/server/test/selenium/test_distros.py)4
-rw-r--r--IntegrationTests/src/bkr/inttest/server/selenium/test_item_count.py (renamed from Server/bkr/server/test/selenium/test_item_count.py)6
-rw-r--r--IntegrationTests/src/bkr/inttest/server/selenium/test_job_ack.py (renamed from Server/bkr/server/test/selenium/test_job_ack.py)4
-rw-r--r--IntegrationTests/src/bkr/inttest/server/selenium/test_job_delete.py (renamed from Server/bkr/server/test/selenium/test_job_delete.py)6
-rw-r--r--IntegrationTests/src/bkr/inttest/server/selenium/test_job_delete_xmlrpc.py (renamed from Server/bkr/server/test/selenium/test_job_delete_xmlrpc.py)4
-rw-r--r--IntegrationTests/src/bkr/inttest/server/selenium/test_job_export_xml.py (renamed from Server/bkr/server/test/selenium/test_job_export_xml.py)6
-rw-r--r--IntegrationTests/src/bkr/inttest/server/selenium/test_job_matrix.py (renamed from Server/bkr/server/test/selenium/test_job_matrix.py)4
-rw-r--r--IntegrationTests/src/bkr/inttest/server/selenium/test_jobs.py (renamed from Server/bkr/server/test/selenium/test_jobs.py)6
-rw-r--r--IntegrationTests/src/bkr/inttest/server/selenium/test_jobs_xmlrpc.py (renamed from Server/bkr/server/test/selenium/test_jobs_xmlrpc.py)4
-rw-r--r--IntegrationTests/src/bkr/inttest/server/selenium/test_login.py (renamed from Server/bkr/server/test/selenium/test_login.py)4
-rw-r--r--IntegrationTests/src/bkr/inttest/server/selenium/test_manual_system_notloggedin.py (renamed from Server/bkr/server/test/selenium/test_manual_system_notloggedin.py)6
-rw-r--r--IntegrationTests/src/bkr/inttest/server/selenium/test_max_whiteboard.py (renamed from Server/bkr/server/test/selenium/test_max_whiteboard.py)6
-rw-r--r--IntegrationTests/src/bkr/inttest/server/selenium/test_motd.py (renamed from Server/bkr/server/test/selenium/test_motd.py)6
-rw-r--r--IntegrationTests/src/bkr/inttest/server/selenium/test_my_menu_tests.py (renamed from Server/bkr/server/test/selenium/test_my_menu_tests.py)6
-rw-r--r--IntegrationTests/src/bkr/inttest/server/selenium/test_product.py (renamed from Server/bkr/server/test/selenium/test_product.py)6
-rw-r--r--IntegrationTests/src/bkr/inttest/server/selenium/test_recipes.py (renamed from Server/bkr/server/test/selenium/test_recipes.py)6
-rw-r--r--IntegrationTests/src/bkr/inttest/server/selenium/test_remove_lc.py (renamed from Server/bkr/server/test/selenium/test_remove_lc.py)4
-rw-r--r--IntegrationTests/src/bkr/inttest/server/selenium/test_report_problem.py (renamed from Server/bkr/server/test/selenium/test_report_problem.py)6
-rw-r--r--IntegrationTests/src/bkr/inttest/server/selenium/test_reserve_system.py (renamed from Server/bkr/server/test/selenium/test_reserve_system.py)6
-rw-r--r--IntegrationTests/src/bkr/inttest/server/selenium/test_retentiontag.py (renamed from Server/bkr/server/test/selenium/test_retentiontag.py)4
-rw-r--r--IntegrationTests/src/bkr/inttest/server/selenium/test_system_available.py (renamed from Server/bkr/server/test/selenium/test_system_available.py)6
-rw-r--r--IntegrationTests/src/bkr/inttest/server/selenium/test_system_group_user_take.py (renamed from Server/bkr/server/test/selenium/test_system_group_user_take.py)6
-rw-r--r--IntegrationTests/src/bkr/inttest/server/selenium/test_system_loan.py (renamed from Server/bkr/server/test/selenium/test_system_loan.py)6
-rw-r--r--IntegrationTests/src/bkr/inttest/server/selenium/test_system_menu_tests.py (renamed from Server/bkr/server/test/selenium/test_system_menu_tests.py)6
-rw-r--r--IntegrationTests/src/bkr/inttest/server/selenium/test_system_search.py (renamed from Server/bkr/server/test/selenium/test_system_search.py)8
-rw-r--r--IntegrationTests/src/bkr/inttest/server/selenium/test_system_view.py (renamed from Server/bkr/server/test/selenium/test_system_view.py)4
-rw-r--r--IntegrationTests/src/bkr/inttest/server/selenium/test_systems.py (renamed from Server/bkr/server/test/selenium/test_systems.py)6
-rw-r--r--IntegrationTests/src/bkr/inttest/server/selenium/test_systems_xmlrpc.py (renamed from Server/bkr/server/test/selenium/test_systems_xmlrpc.py)6
-rw-r--r--IntegrationTests/src/bkr/inttest/server/selenium/test_task_by_name.py (renamed from Server/bkr/server/test/selenium/test_task_by_name.py)6
-rw-r--r--IntegrationTests/src/bkr/inttest/server/selenium/test_task_paginate.py (renamed from Server/bkr/server/test/selenium/test_task_paginate.py)6
-rw-r--r--IntegrationTests/src/bkr/inttest/server/selenium/test_task_search.py (renamed from Server/bkr/server/test/selenium/test_task_search.py)6
-rw-r--r--IntegrationTests/src/bkr/inttest/server/selenium/test_tasks.py (renamed from Server/bkr/server/test/selenium/test_tasks.py)6
-rw-r--r--IntegrationTests/src/bkr/inttest/server/selenium/tmp-distribution-beaker-dummy_for_bz681143-1.0-1.noarch.rpm (renamed from Server/bkr/server/test/selenium/tmp-distribution-beaker-dummy_for_bz681143-1.0-1.noarch.rpm)bin4015 -> 4015 bytes
-rw-r--r--IntegrationTests/src/bkr/inttest/server/selenium/tmp-distribution-beaker-task_test-1.1-0.noarch.rpm (renamed from Server/bkr/server/test/selenium/tmp-distribution-beaker-task_test-1.1-0.noarch.rpm)bin3947 -> 3947 bytes
-rw-r--r--IntegrationTests/src/bkr/inttest/server/selenium/tmp-distribution-beaker-task_test-2.0-2.noarch.rpm (renamed from Server/bkr/server/test/selenium/tmp-distribution-beaker-task_test-2.0-2.noarch.rpm)bin3963 -> 3963 bytes
-rw-r--r--IntegrationTests/src/bkr/inttest/server/test_ack_in_jobxml.py (renamed from Server/bkr/server/test/test_ack_in_jobxml.py)2
-rw-r--r--IntegrationTests/src/bkr/inttest/server/test_beakerd.py (renamed from Server/bkr/server/test/test_beakerd.py)4
-rw-r--r--IntegrationTests/src/bkr/inttest/server/test_deadrecipes.py (renamed from Server/bkr/server/test/test_deadrecipes.py)2
-rw-r--r--IntegrationTests/src/bkr/inttest/server/test_group_xml.py (renamed from Server/bkr/server/test/test_group_xml.py)4
-rw-r--r--IntegrationTests/src/bkr/inttest/server/test_jobs.py (renamed from Server/bkr/server/test/test_jobs.py)4
-rw-r--r--IntegrationTests/src/bkr/inttest/server/test_lab_controller.py (renamed from Server/bkr/server/test/test_lab_controller.py)2
-rw-r--r--IntegrationTests/src/bkr/inttest/server/test_mail.py (renamed from Server/bkr/server/test/test_mail.py)2
-rw-r--r--IntegrationTests/src/bkr/inttest/server/test_max_whiteboard.py (renamed from Server/bkr/server/test/test_max_whiteboard.py)2
-rw-r--r--IntegrationTests/src/bkr/inttest/server/test_model.py (renamed from Server/bkr/server/test/test_model.py)2
-rw-r--r--IntegrationTests/src/bkr/inttest/server/test_rdf.py (renamed from Server/bkr/server/test/test_rdf.py)2
-rw-r--r--IntegrationTests/src/bkr/inttest/server/test_tasks.py (renamed from Server/bkr/server/test/test_tasks.py)2
-rw-r--r--IntegrationTests/src/bkr/inttest/server/test_update_status.py (renamed from Server/bkr/server/test/test_update_status.py)6
-rw-r--r--IntegrationTests/src/bkr/inttest/server/test_utilisation.py (renamed from Server/bkr/server/test/test_utilisation.py)2
-rw-r--r--IntegrationTests/src/bkr/inttest/server/tools/__init__.py0
-rw-r--r--IntegrationTests/src/bkr/inttest/server/tools/test_delete_system.py (renamed from Server/bkr/server/test/tools/test_delete_system.py)2
-rw-r--r--IntegrationTests/src/bkr/inttest/server/tools/test_log_delete.py (renamed from Server/bkr/server/test/test_log_delete.py)2
-rw-r--r--IntegrationTests/src/bkr/inttest/server/tools/test_nag_mail.py (renamed from Server/bkr/server/test/test_nag_mail.py)3
-rw-r--r--IntegrationTests/src/bkr/inttest/stub_cobbler.py (renamed from Server/bkr/server/test/stub_cobbler.py)0
-rw-r--r--Makefile2
-rw-r--r--Server/bkr/server/test/__init__.py72
-rw-r--r--Tasks/distribution/beaker/dogfood/Makefile4
-rw-r--r--beaker.spec24
83 files changed, 407 insertions, 307 deletions
diff --git a/.gitignore b/.gitignore
index 3bca0dd..99dfa7c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -16,4 +16,7 @@ Client/build
Client/setup.py
LabController/proxy/build
LabController/proxy/setup.py
+IntegrationTests/build
+IntegrationTests/setup.py
*.diff
+selenium.log
diff --git a/IntegrationTests/Makefile b/IntegrationTests/Makefile
new file mode 100644
index 0000000..6381f85
--- /dev/null
+++ b/IntegrationTests/Makefile
@@ -0,0 +1,19 @@
+# License: GPL v2 or later
+# Copyright Red Hat Inc. 2008
+
+PKGNAME=beaker
+
+.PHONY: all
+all: build
+
+include ../rpmspec_rules.mk
+include ../py_rules.mk
+
+.PHONY: build
+build: py-build
+
+.PHONY: install
+install: py-install
+
+.PHONY: clean
+clean: py-clean
diff --git a/IntegrationTests/run-tests.sh b/IntegrationTests/run-tests.sh
new file mode 100755
index 0000000..aef4360
--- /dev/null
+++ b/IntegrationTests/run-tests.sh
@@ -0,0 +1,20 @@
+#!/bin/bash
+
+# Beaker's tests are spread across several places. Unit tests live beside the
+# code they are testing, usually in a module named test_*.py. Integration
+# tests, which depend on external resources (such as databases) and create new
+# processes and are generally expensive, live here under IntegrationTests.
+#
+# This is a convenience script to run all tests in one go from a Beaker source
+# checkout, without building anything.
+
+if [ $(pwd) != $(readlink -f $(dirname "$0") ) ] ; then
+ # Unfortunately there is at least one place in tests where we are sensitive
+ # to cwd (beaker.motd in server-test.cfg) :-(
+ echo "Run this script from the IntegrationTests directory" >&2
+ exit 1
+fi
+
+set -x
+env PYTHONPATH=../Common:../Server:../Client/src:../IntegrationTests/src${PYTHONPATH:+:$PYTHONPATH} \
+ nosetests ${*:--v bkr}
diff --git a/Server/bkr/server/test/sanitize_xml.py b/IntegrationTests/sanitize_xml.py
index 8ae1970..8ae1970 100755
--- a/Server/bkr/server/test/sanitize_xml.py
+++ b/IntegrationTests/sanitize_xml.py
diff --git a/Server/test.cfg b/IntegrationTests/server-test.cfg
index 12c9132..a5dd494 100755..100644
--- a/Server/test.cfg
+++ b/IntegrationTests/server-test.cfg
@@ -24,14 +24,14 @@ mail.provider = 'smtp'
mail.smtp.server = '127.0.0.1:19999'
beaker_email = 'beaker-integration-tests@example.com'
beaker.reliable_distro_tag = 'RELEASED'
-beaker.motd = 'bkr/server/test/motd.xml'
+beaker.motd = 'src/bkr/inttest/server/motd.xml'
[logging]
[[loggers]]
-[[[bkr.server]]]
+[[[bkr]]]
level='DEBUG'
-qualname='bkr.server'
+qualname='bkr'
handlers=['debug_out']
propagate=0
diff --git a/IntegrationTests/setup.py.in b/IntegrationTests/setup.py.in
new file mode 100644
index 0000000..fa9b4d6
--- /dev/null
+++ b/IntegrationTests/setup.py.in
@@ -0,0 +1,15 @@
+from glob import glob
+from setuptools import setup, find_packages
+setup(
+ name='bkr.inttest',
+ version='@VERSION@',
+ packages=find_packages('src'),
+ package_dir={'': 'src'},
+ package_data={'': [
+ '*.xml',
+ 'server/motd.xml',
+ 'server/selenium/*.rpm',
+ 'server/selenium/invalid-task_file',
+ ]},
+ namespace_packages=['bkr'],
+)
diff --git a/IntegrationTests/src/bkr/__init__.py b/IntegrationTests/src/bkr/__init__.py
new file mode 100644
index 0000000..f48ad10
--- /dev/null
+++ b/IntegrationTests/src/bkr/__init__.py
@@ -0,0 +1,6 @@
+# See http://peak.telecommunity.com/DevCenter/setuptools#namespace-packages
+try:
+ __import__('pkg_resources').declare_namespace(__name__)
+except ImportError:
+ from pkgutil import extend_path
+ __path__ = extend_path(__path__, __name__)
diff --git a/IntegrationTests/src/bkr/inttest/__init__.py b/IntegrationTests/src/bkr/inttest/__init__.py
new file mode 100644
index 0000000..846996c
--- /dev/null
+++ b/IntegrationTests/src/bkr/inttest/__init__.py
@@ -0,0 +1,178 @@
+# Beaker
+#
+# Copyright (C) 2010 dcallagh@redhat.com
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+import sys
+import os
+import time
+import threading
+import subprocess
+from StringIO import StringIO
+import logging, logging.config
+import signal
+import cherrypy
+import turbogears
+from turbogears import update_config
+from turbogears.database import session
+from bkr.server.controllers import Root
+from bkr.server.util import log_to_stream
+
+# hack to make turbogears.testutil not do dumb stuff at import time
+orig_cwd = os.getcwd()
+os.chdir('/tmp')
+import turbogears.testutil
+os.chdir(orig_cwd)
+
+# workaround for weird sqlalchemy-0.4 bug :-S
+# http://markmail.org/message/rnnzdebfzrjt3kmi
+from sqlalchemy.orm.dynamic import DynamicAttributeImpl
+DynamicAttributeImpl.accepts_scalar_loader = False
+
+log = logging.getLogger(__name__)
+
+CONFIG_FILE = os.environ.get('BEAKER_CONFIG_FILE', 'server-test.cfg')
+
+def get_server_base():
+ return os.environ.get('BEAKER_SERVER_BASE_URL',
+ 'http://localhost:%s/' % turbogears.config.get('server.socket_port'))
+
+def check_listen(port):
+ """
+ Returns True iff any process on the system is listening
+ on the given TCP port.
+ """
+ # with newer lsof we could just use -sTCP:LISTEN,
+ # but RHEL5's lsof is too old so we have to filter for LISTEN state ourselves
+ output, _ = subprocess.Popen(['/usr/sbin/lsof', '-iTCP:%d' % port],
+ stdout=subprocess.PIPE).communicate()
+ for line in output.splitlines():
+ if '(LISTEN)' in line:
+ return True
+ return False
+
+class Process(object):
+ """
+ Thin wrapper around subprocess.Popen which supports starting and killing
+ the process in setup/teardown.
+ """
+
+ def __init__(self, name, args, env=None, listen_port=None,
+ stop_signal=signal.SIGTERM):
+ self.name = name
+ self.args = args
+ self.env = env
+ self.listen_port = listen_port
+ self.stop_signal = stop_signal
+
+ def start(self):
+ log.info('Spawning %s: %s %r', self.name, ' '.join(self.args), self.env)
+ env = dict(os.environ)
+ if self.env:
+ env.update(self.env)
+ self.popen = subprocess.Popen(self.args, stdout=subprocess.PIPE,
+ stderr=subprocess.STDOUT, env=env)
+ CommunicateThread(popen=self.popen).start()
+ if self.listen_port:
+ self._wait_for_listen(self.listen_port)
+
+ def _wait_for_listen(self, port):
+ """
+ Blocks until some process on the system is listening
+ on the given TCP port.
+ """
+ # XXX is there a better way to do this?
+ for i in range(20):
+ log.info('Waiting for %s to listen on port %d', self.name, port)
+ if check_listen(self.listen_port):
+ return
+ time.sleep(1)
+ raise RuntimeError('Gave up waiting for LISTEN %d' % port)
+
+ def stop(self):
+ if not hasattr(self, 'popen'):
+ log.warning('%s never started, not killing', self.name)
+ elif self.popen.poll() is not None:
+ log.warning('%s (pid %d) already dead, not killing', self.name, self.popen.pid)
+ else:
+ log.info('Sending signal %r to %s (pid %d)',
+ self.stop_signal, self.name, self.popen.pid)
+ os.kill(self.popen.pid, self.stop_signal)
+ self.popen.wait()
+
+class CommunicateThread(threading.Thread):
+ """
+ Nose has support for capturing stdout during tests, by fiddling with sys.stdout.
+ Subprocesses' stdout streams won't be captured that way, however. So for each subprocess
+ one of these threads will read from its stdout and write back to sys.stdout
+ for nose to capture.
+ """
+
+ def __init__(self, popen, **kwargs):
+ super(CommunicateThread, self).__init__(**kwargs)
+ self.popen = popen
+
+ def run(self):
+ while True:
+ data = self.popen.stdout.readline()
+ if not data: break
+ sys.stdout.write(data)
+
+processes = []
+
+def setup_package():
+ log.info('Loading test configuration from %s', CONFIG_FILE)
+ assert os.path.exists(CONFIG_FILE), 'Config file %s must exist' % CONFIG_FILE
+ update_config(configfile=CONFIG_FILE, modulename='bkr.server.config')
+
+ # Override loaded logging config, in case we are using the server's config file
+ # (we really always want our tests' logs to go to stdout, not /var/log/beaker/)
+ log_to_stream(sys.stdout, level=logging.NOTSET)
+
+ if not 'BEAKER_SKIP_INIT_DB' in os.environ:
+ from bkr.inttest import data_setup
+ data_setup.setup_model()
+ data_setup.create_distro()
+ data_setup.create_labcontroller() #always need a labcontroller
+ session.flush()
+
+ if not os.path.exists(turbogears.config.get('basepath.rpms')):
+ os.mkdir(turbogears.config.get('basepath.rpms'))
+
+ cherrypy.root = Root()
+ turbogears.testutil.start_cp()
+
+ if 'BEAKER_SERVER_BASE_URL' not in os.environ:
+ # need to start the server ourselves
+ # (this only works from the IntegrationTests dir of a Beaker checkout)
+ processes.extend([
+ Process('beaker', args=['../Server/start-server.py', CONFIG_FILE],
+ listen_port=turbogears.config.get('server.socket_port'),
+ stop_signal=signal.SIGINT)
+ ])
+ try:
+ for process in processes:
+ process.start()
+ except:
+ for process in processes:
+ process.stop()
+ raise
+
+def teardown_package():
+ for process in processes:
+ process.stop()
+
+ cherrypy.server.stop()
diff --git a/Server/bkr/server/test/assertions.py b/IntegrationTests/src/bkr/inttest/assertions.py
index 5eaded5..5eaded5 100644
--- a/Server/bkr/server/test/assertions.py
+++ b/IntegrationTests/src/bkr/inttest/assertions.py
diff --git a/Server/bkr/server/test/complete-job.xml b/IntegrationTests/src/bkr/inttest/complete-job.xml
index 906580b..906580b 100644
--- a/Server/bkr/server/test/complete-job.xml
+++ b/IntegrationTests/src/bkr/inttest/complete-job.xml
diff --git a/Server/bkr/server/test/data_setup.py b/IntegrationTests/src/bkr/inttest/data_setup.py
index 1cc4fd6..1cc4fd6 100644
--- a/Server/bkr/server/test/data_setup.py
+++ b/IntegrationTests/src/bkr/inttest/data_setup.py
diff --git a/Server/bkr/server/test/job_35508.xml b/IntegrationTests/src/bkr/inttest/job_35508.xml
index 400cddd..400cddd 100644
--- a/Server/bkr/server/test/job_35508.xml
+++ b/IntegrationTests/src/bkr/inttest/job_35508.xml
diff --git a/Server/bkr/server/test/job_40214.xml b/IntegrationTests/src/bkr/inttest/job_40214.xml
index 42dea7f..42dea7f 100644
--- a/Server/bkr/server/test/job_40214.xml
+++ b/IntegrationTests/src/bkr/inttest/job_40214.xml
diff --git a/Server/bkr/server/test/mail_capture.py b/IntegrationTests/src/bkr/inttest/mail_capture.py
index 12458ec..12458ec 100644
--- a/Server/bkr/server/test/mail_capture.py
+++ b/IntegrationTests/src/bkr/inttest/mail_capture.py
diff --git a/Server/bkr/server/test/tools/__init__.py b/IntegrationTests/src/bkr/inttest/server/__init__.py
index e69de29..e69de29 100644
--- a/Server/bkr/server/test/tools/__init__.py
+++ b/IntegrationTests/src/bkr/inttest/server/__init__.py
diff --git a/Server/bkr/server/test/motd.xml b/IntegrationTests/src/bkr/inttest/server/motd.xml
index 1931414..1931414 100644
--- a/Server/bkr/server/test/motd.xml
+++ b/IntegrationTests/src/bkr/inttest/server/motd.xml
diff --git a/Server/bkr/server/test/selenium/__init__.py b/IntegrationTests/src/bkr/inttest/server/selenium/__init__.py
index 1d8a67a..49d81f6 100644
--- a/Server/bkr/server/test/selenium/__init__.py
+++ b/IntegrationTests/src/bkr/inttest/server/selenium/__init__.py
@@ -21,17 +21,14 @@ import os
import re
import logging
import subprocess
-import signal
import time
-import turbogears.config
from selenium import selenium
import unittest
-import threading
import xmlrpclib
from urlparse import urljoin
import kobo.xmlrpc
from datetime import datetime
-import bkr.server.test
+from bkr.inttest import get_server_base, Process
from bkr.server.bexceptions import BX
from time import sleep
import pkg_resources
@@ -74,8 +71,7 @@ class SeleniumTestCase(unittest.TestCase):
@classmethod
def get_selenium(cls):
- cls.sel = selenium('localhost', 4444, '*chrome',
- bkr.server.test.get_server_base())
+ cls.sel = selenium('localhost', 4444, '*chrome', get_server_base())
return cls.sel
@classmethod
@@ -116,94 +112,13 @@ class XmlRpcTestCase(unittest.TestCase):
@classmethod
def get_server(cls):
- endpoint = urljoin(bkr.server.test.get_server_base(), 'RPC2')
+ endpoint = urljoin(get_server_base(), 'RPC2')
transport = endpoint.startswith('https:') and \
kobo.xmlrpc.SafeCookieTransport() or \
kobo.xmlrpc.CookieTransport()
return xmlrpclib.ServerProxy(endpoint, transport=transport,
allow_none=True)
-def check_listen(port):
- """
- Returns True iff any process on the system is listening
- on the given TCP port.
- """
- # with newer lsof we could just use -sTCP:LISTEN,
- # but RHEL5's lsof is too old so we have to filter for LISTEN state ourselves
- output, _ = subprocess.Popen(['/usr/sbin/lsof', '-iTCP:%d' % port],
- stdout=subprocess.PIPE).communicate()
- for line in output.splitlines():
- if '(LISTEN)' in line:
- return True
- return False
-
-class Process(object):
- """
- Thin wrapper around subprocess.Popen which supports starting and killing
- the process in setup/teardown.
- """
-
- def __init__(self, name, args, env=None, listen_port=None,
- stop_signal=signal.SIGTERM):
- self.name = name
- self.args = args
- self.env = env
- self.listen_port = listen_port
- self.stop_signal = stop_signal
-
- def start(self):
- log.info('Spawning %s: %s %r', self.name, ' '.join(self.args), self.env)
- env = dict(os.environ)
- if self.env:
- env.update(self.env)
- self.popen = subprocess.Popen(self.args, stdout=subprocess.PIPE,
- stderr=subprocess.STDOUT, env=env)
- CommunicateThread(popen=self.popen).start()
- if self.listen_port:
- self._wait_for_listen(self.listen_port)
-
- def _wait_for_listen(self, port):
- """
- Blocks until some process on the system is listening
- on the given TCP port.
- """
- # XXX is there a better way to do this?
- for i in range(20):
- log.info('Waiting for %s to listen on port %d', self.name, port)
- if check_listen(self.listen_port):
- return
- time.sleep(1)
- raise RuntimeError('Gave up waiting for LISTEN %d' % port)
-
- def stop(self):
- if not hasattr(self, 'popen'):
- log.warning('%s never started, not killing', self.name)
- elif self.popen.poll() is not None:
- log.warning('%s (pid %d) already dead, not killing', self.name, self.popen.pid)
- else:
- log.info('Sending signal %r to %s (pid %d)',
- self.stop_signal, self.name, self.popen.pid)
- os.kill(self.popen.pid, self.stop_signal)
- self.popen.wait()
-
-class CommunicateThread(threading.Thread):
- """
- Nose has support for capturing stdout during tests, by fiddling with sys.stdout.
- Subprocesses' stdout streams won't be captured that way, however. So for each subprocess
- one of these threads will read from its stdout and write back to sys.stdout
- for nose to capture.
- """
-
- def __init__(self, popen, **kwargs):
- super(CommunicateThread, self).__init__(**kwargs)
- self.popen = popen
-
- def run(self):
- while True:
- data = self.popen.stdout.readline()
- if not data: break
- sys.stdout.write(data)
-
def jvm_version():
popen = subprocess.Popen(['java', '-version'], stdout=subprocess.PIPE,
stderr=subprocess.STDOUT)
@@ -228,13 +143,6 @@ def setup_package():
'-log', 'selenium.log'], env={'DISPLAY': ':4'},
listen_port=4444),
])
- if 'BEAKER_SERVER_BASE_URL' not in os.environ:
- # need to start the server ourselves
- processes.extend([
- Process('beaker', args=['./start-server.py', bkr.server.test.CONFIG_FILE],
- listen_port=turbogears.config.get('server.socket_port'),
- stop_signal=signal.SIGINT)
- ])
try:
for process in processes:
process.start()
diff --git a/Server/bkr/server/test/selenium/invalid-task_file b/IntegrationTests/src/bkr/inttest/server/selenium/invalid-task_file
index 3ea77e0..3ea77e0 100644
--- a/Server/bkr/server/test/selenium/invalid-task_file
+++ b/IntegrationTests/src/bkr/inttest/server/selenium/invalid-task_file
diff --git a/Server/bkr/server/test/selenium/test_activity.py b/IntegrationTests/src/bkr/inttest/server/selenium/test_activity.py
index 51e21ef..244c0a7 100644
--- a/Server/bkr/server/test/selenium/test_activity.py
+++ b/IntegrationTests/src/bkr/inttest/server/selenium/test_activity.py
@@ -1,7 +1,7 @@
from turbogears.database import session
-from bkr.server.test.selenium import SeleniumTestCase
-from bkr.server.test import data_setup
+from bkr.inttest.server.selenium import SeleniumTestCase
+from bkr.inttest import data_setup
from bkr.server.model import User, DistroActivity, SystemActivity
def is_activity_row_present(sel, via=u'testdata', object_=None, property_=None,
diff --git a/Server/bkr/server/test/selenium/test_add_group.py b/IntegrationTests/src/bkr/inttest/server/selenium/test_add_group.py
index d5b4340..6ca366e 100644
--- a/Server/bkr/server/test/selenium/test_add_group.py
+++ b/IntegrationTests/src/bkr/inttest/server/selenium/test_add_group.py
@@ -1,10 +1,10 @@
#!/usr/bin/python
-import bkr.server.test.selenium
-from bkr.server.test import data_setup
+from bkr.inttest.server.selenium import SeleniumTestCase
+from bkr.inttest import data_setup
import unittest, time, re, os
from turbogears.database import session
-class AddGroup(bkr.server.test.selenium.SeleniumTestCase):
+class AddGroup(SeleniumTestCase):
def setUp(self):
self.verificationErrors = []
self.selenium = self.get_selenium()
diff --git a/Server/bkr/server/test/selenium/test_add_system.py b/IntegrationTests/src/bkr/inttest/server/selenium/test_add_system.py
index 28fcf8e..819d5a0 100644
--- a/Server/bkr/server/test/selenium/test_add_system.py
+++ b/IntegrationTests/src/bkr/inttest/server/selenium/test_add_system.py
@@ -1,10 +1,10 @@
#!/usr/bin/python
-import bkr.server.test.selenium
-from bkr.server.test import data_setup
+from bkr.inttest.server.selenium import SeleniumTestCase
+from bkr.inttest import data_setup
import unittest, time, re, os
from turbogears.database import session, get_engine
-class AddSystem(bkr.server.test.selenium.SeleniumTestCase):
+class AddSystem(SeleniumTestCase):
def setUp(self):
data_setup.create_labcontroller(fqdn=u'lab-devel.rhts.eng.bos.redhat.com')
session.flush()
diff --git a/Server/bkr/server/test/selenium/test_add_user.py b/IntegrationTests/src/bkr/inttest/server/selenium/test_add_user.py
index dd9f9e6..7acd6a9 100644
--- a/Server/bkr/server/test/selenium/test_add_user.py
+++ b/IntegrationTests/src/bkr/inttest/server/selenium/test_add_user.py
@@ -1,9 +1,9 @@
#!/usr/bin/python
-import bkr.server.test.selenium
-from bkr.server.test import data_setup
+from bkr.inttest.server.selenium import SeleniumTestCase
+from bkr.inttest import data_setup
import unittest, time, re, os
-class AddUser(bkr.server.test.selenium.SeleniumTestCase):
+class AddUser(SeleniumTestCase):
BEAKER_DISABLE_USER = os.environ.get('BEAKER_TEST_USER_2','disabled')
BEAKER_DISABLE_EMAIL = os.environ.get('BEAKER_TEST_USER_2','disabled@my.com')
diff --git a/Server/bkr/server/test/selenium/test_add_user_to_group.py b/IntegrationTests/src/bkr/inttest/server/selenium/test_add_user_to_group.py
index 8a05d3c..4a9d379 100644
--- a/Server/bkr/server/test/selenium/test_add_user_to_group.py
+++ b/IntegrationTests/src/bkr/inttest/server/selenium/test_add_user_to_group.py
@@ -1,10 +1,10 @@
#!/usr/bin/python
-import bkr.server.test.selenium
-from bkr.server.test import data_setup
+from bkr.inttest.server.selenium import SeleniumTestCase
+from bkr.inttest import data_setup
import unittest, time, re, os
from turbogears.database import session
-class TestAddUserToGroup(bkr.server.test.selenium.SeleniumTestCase):
+class TestAddUserToGroup(SeleniumTestCase):
def setUp(self):
self.verificationErrors = []
self.selenium = self.get_selenium()
diff --git a/Server/bkr/server/test/selenium/test_cancel.py b/IntegrationTests/src/bkr/inttest/server/selenium/test_cancel.py
index fe6254f..538ab5e 100644
--- a/Server/bkr/server/test/selenium/test_cancel.py
+++ b/IntegrationTests/src/bkr/inttest/server/selenium/test_cancel.py
@@ -1,11 +1,11 @@
#!/usr/bin/python
-import bkr.server.test.selenium
-from bkr.server.test import data_setup
+from bkr.inttest.server.selenium import SeleniumTestCase
+from bkr.inttest import data_setup
import unittest, time, re, os
from turbogears.database import session
-class Cancel(bkr.server.test.selenium.SeleniumTestCase):
+class Cancel(SeleniumTestCase):
def setUp(self):
self.password = 'password'
diff --git a/Server/bkr/server/test/selenium/test_csv_import.py b/IntegrationTests/src/bkr/inttest/server/selenium/test_csv_import.py
index cb60960..cd81137 100644
--- a/Server/bkr/server/test/selenium/test_csv_import.py
+++ b/IntegrationTests/src/bkr/inttest/server/selenium/test_csv_import.py
@@ -1,15 +1,15 @@
#!/usr/bin/python
# vim: set fileencoding=utf-8 :
-import bkr.server.test.selenium
-from bkr.server.test import data_setup
-from bkr.server.test.assertions import assert_has_key_with_value
+from bkr.inttest.server.selenium import SeleniumTestCase
+from bkr.inttest import data_setup
+from bkr.inttest.assertions import assert_has_key_with_value
from bkr.server.model import Arch
from turbogears.database import session
import unittest
from tempfile import NamedTemporaryFile
-class CSVImportTest(bkr.server.test.selenium.SeleniumTestCase):
+class CSVImportTest(SeleniumTestCase):
def setUp(self):
self.system = data_setup.create_system()
diff --git a/Server/bkr/server/test/selenium/test_distro_search.py b/IntegrationTests/src/bkr/inttest/server/selenium/test_distro_search.py
index c026c81..c065d0b 100644
--- a/Server/bkr/server/test/selenium/test_distro_search.py
+++ b/IntegrationTests/src/bkr/inttest/server/selenium/test_distro_search.py
@@ -1,10 +1,10 @@
#!/usr/bin/python
-import bkr.server.test.selenium
-from bkr.server.test import data_setup
+from bkr.inttest.server.selenium import SeleniumTestCase
+from bkr.inttest import data_setup
import unittest, time, re, os
from turbogears.database import session
-class Search(bkr.server.test.selenium.SeleniumTestCase):
+class Search(SeleniumTestCase):
def setUp(self):
self.verificationErrors = []
self.selenium = self.get_selenium()
diff --git a/Server/bkr/server/test/selenium/test_distros.py b/IntegrationTests/src/bkr/inttest/server/selenium/test_distros.py
index 0e052de..fa0d072 100644
--- a/Server/bkr/server/test/selenium/test_distros.py
+++ b/IntegrationTests/src/bkr/inttest/server/selenium/test_distros.py
@@ -1,8 +1,8 @@
import xmlrpclib
from turbogears.database import session
-from bkr.server.test.selenium import SeleniumTestCase, XmlRpcTestCase
-from bkr.server.test import data_setup
+from bkr.inttest.server.selenium import SeleniumTestCase, XmlRpcTestCase
+from bkr.inttest import data_setup
def go_to_distro_view(sel, distro):
sel.open('distros/view?id=%s' % distro.id)
diff --git a/Server/bkr/server/test/selenium/test_item_count.py b/IntegrationTests/src/bkr/inttest/server/selenium/test_item_count.py
index 30f5e8c..e0043d9 100644
--- a/Server/bkr/server/test/selenium/test_item_count.py
+++ b/IntegrationTests/src/bkr/inttest/server/selenium/test_item_count.py
@@ -1,10 +1,10 @@
#!/usr/bin/python
-import bkr.server.test.selenium
-from bkr.server.test import data_setup
+from bkr.inttest.server.selenium import SeleniumTestCase
+from bkr.inttest import data_setup
import unittest, time, re, os
from turbogears.database import session
-class ItemCount(bkr.server.test.selenium.SeleniumTestCase):
+class ItemCount(SeleniumTestCase):
def setUp(self):
self.verificationErrors = []
self.selenium = self.get_selenium()
diff --git a/Server/bkr/server/test/selenium/test_job_ack.py b/IntegrationTests/src/bkr/inttest/server/selenium/test_job_ack.py
index b578e99..0a1c06b 100644
--- a/Server/bkr/server/test/selenium/test_job_ack.py
+++ b/IntegrationTests/src/bkr/inttest/server/selenium/test_job_ack.py
@@ -1,7 +1,7 @@
from turbogears.database import session
-from bkr.server.test.selenium import SeleniumTestCase
-from bkr.server.test import data_setup
+from bkr.inttest.server.selenium import SeleniumTestCase
+from bkr.inttest import data_setup
from bkr.server.model import User, DistroActivity, SystemActivity
class JobAckTest(SeleniumTestCase):
diff --git a/Server/bkr/server/test/selenium/test_job_delete.py b/IntegrationTests/src/bkr/inttest/server/selenium/test_job_delete.py
index cdcd5d4..59c525d 100644
--- a/Server/bkr/server/test/selenium/test_job_delete.py
+++ b/IntegrationTests/src/bkr/inttest/server/selenium/test_job_delete.py
@@ -1,10 +1,10 @@
#!/usr/bin/python
-import bkr.server.test.selenium
-from bkr.server.test import data_setup
+from bkr.inttest.server.selenium import SeleniumTestCase
+from bkr.inttest import data_setup
from turbogears.database import session
from bkr.server.model import Group
-class JobDelete(bkr.server.test.selenium.SeleniumTestCase):
+class JobDelete(SeleniumTestCase):
def setUp(self):
diff --git a/Server/bkr/server/test/selenium/test_job_delete_xmlrpc.py b/IntegrationTests/src/bkr/inttest/server/selenium/test_job_delete_xmlrpc.py
index ab822ed..ec9c957 100644
--- a/Server/bkr/server/test/selenium/test_job_delete_xmlrpc.py
+++ b/IntegrationTests/src/bkr/inttest/server/selenium/test_job_delete_xmlrpc.py
@@ -4,8 +4,8 @@ import logging
import xmlrpclib
from turbogears.database import session
-from bkr.server.test.selenium import XmlRpcTestCase
-from bkr.server.test import data_setup
+from bkr.inttest.server.selenium import XmlRpcTestCase
+from bkr.inttest import data_setup
class TestJobDelete(XmlRpcTestCase):
diff --git a/Server/bkr/server/test/selenium/test_job_export_xml.py b/IntegrationTests/src/bkr/inttest/server/selenium/test_job_export_xml.py
index 880111f..0890a01 100644
--- a/Server/bkr/server/test/selenium/test_job_export_xml.py
+++ b/IntegrationTests/src/bkr/inttest/server/selenium/test_job_export_xml.py
@@ -1,13 +1,13 @@
#!/usr/bin/python
-import bkr.server.test.selenium
-from bkr.server.test import data_setup
+from bkr.inttest.server.selenium import SeleniumTestCase
+from bkr.inttest import data_setup
from turbogears.database import session
from bkr.server.model import Job
import lxml.etree
from StringIO import StringIO
-class JobExportXML(bkr.server.test.selenium.SeleniumTestCase):
+class JobExportXML(SeleniumTestCase):
@classmethod
diff --git a/Server/bkr/server/test/selenium/test_job_matrix.py b/IntegrationTests/src/bkr/inttest/server/selenium/test_job_matrix.py
index f9d76fb..5f46efc 100644
--- a/Server/bkr/server/test/selenium/test_job_matrix.py
+++ b/IntegrationTests/src/bkr/inttest/server/selenium/test_job_matrix.py
@@ -19,8 +19,8 @@ import time
import tempfile
from turbogears.database import session
-from bkr.server.test.selenium import SeleniumTestCase
-from bkr.server.test import data_setup
+from bkr.inttest.server.selenium import SeleniumTestCase
+from bkr.inttest import data_setup
class TestJobMatrix(SeleniumTestCase):
diff --git a/Server/bkr/server/test/selenium/test_jobs.py b/IntegrationTests/src/bkr/inttest/server/selenium/test_jobs.py
index 240e6b4..3d05283 100644
--- a/Server/bkr/server/test/selenium/test_jobs.py
+++ b/IntegrationTests/src/bkr/inttest/server/selenium/test_jobs.py
@@ -25,8 +25,8 @@ import pkg_resources
from turbogears.database import session
from sqlalchemy import and_
-from bkr.server.test.selenium import SeleniumTestCase
-from bkr.server.test import data_setup
+from bkr.inttest.server.selenium import SeleniumTestCase
+from bkr.inttest import data_setup
from bkr.server.jobs import RetentionTag, Product, Distro
class TestViewJob(SeleniumTestCase):
@@ -204,7 +204,7 @@ class NewJobTest(SeleniumTestCase):
sel.click('link=New Job')
sel.wait_for_page_to_load('30000')
sel.type('jobs_filexml', pkg_resources.resource_filename(
- 'bkr.server.test', 'complete-job.xml'))
+ 'bkr.inttest', 'complete-job.xml'))
sel.click('//input[@value="Submit Data"]')
sel.wait_for_page_to_load('30000')
sel.click('//input[@value="Queue"]')
diff --git a/Server/bkr/server/test/selenium/test_jobs_xmlrpc.py b/IntegrationTests/src/bkr/inttest/server/selenium/test_jobs_xmlrpc.py
index 194e8c7..d4e850e 100644
--- a/Server/bkr/server/test/selenium/test_jobs_xmlrpc.py
+++ b/IntegrationTests/src/bkr/inttest/server/selenium/test_jobs_xmlrpc.py
@@ -21,8 +21,8 @@ import unittest
import logging
import xmlrpclib
from turbogears.database import session
-from bkr.server.test.selenium import XmlRpcTestCase
-from bkr.server.test import data_setup
+from bkr.inttest.server.selenium import XmlRpcTestCase
+from bkr.inttest import data_setup
from bkr.server.model import Job, Distro
class JobUploadTest(XmlRpcTestCase):
diff --git a/Server/bkr/server/test/selenium/test_login.py b/IntegrationTests/src/bkr/inttest/server/selenium/test_login.py
index f5d8bf5..2004543 100644
--- a/Server/bkr/server/test/selenium/test_login.py
+++ b/IntegrationTests/src/bkr/inttest/server/selenium/test_login.py
@@ -29,8 +29,8 @@ try:
import krbV
except ImportError:
krbV = None
-from bkr.server.test import data_setup
-from bkr.server.test.selenium import SeleniumTestCase, XmlRpcTestCase
+from bkr.inttest import data_setup
+from bkr.inttest.server.selenium import SeleniumTestCase, XmlRpcTestCase
log = logging.getLogger(__name__)
diff --git a/Server/bkr/server/test/selenium/test_manual_system_notloggedin.py b/IntegrationTests/src/bkr/inttest/server/selenium/test_manual_system_notloggedin.py
index e7d8414..9e6dea6 100644
--- a/Server/bkr/server/test/selenium/test_manual_system_notloggedin.py
+++ b/IntegrationTests/src/bkr/inttest/server/selenium/test_manual_system_notloggedin.py
@@ -1,10 +1,10 @@
#!/usr/bin/python
-import bkr.server.test.selenium
-from bkr.server.test import data_setup
+from bkr.inttest.server.selenium import SeleniumTestCase
+from bkr.inttest import data_setup
import unittest, time, re, os
from turbogears.database import session, get_engine
-class NotLoggedInManualSystem(bkr.server.test.selenium.SeleniumTestCase):
+class NotLoggedInManualSystem(SeleniumTestCase):
def setUp(self):
self.system = data_setup.create_system(status=u'Manual')
self.system.shared = True
diff --git a/Server/bkr/server/test/selenium/test_max_whiteboard.py b/IntegrationTests/src/bkr/inttest/server/selenium/test_max_whiteboard.py
index caa51fb..e6b0425 100644
--- a/Server/bkr/server/test/selenium/test_max_whiteboard.py
+++ b/IntegrationTests/src/bkr/inttest/server/selenium/test_max_whiteboard.py
@@ -1,10 +1,10 @@
-from bkr.server.test import selenium
-from bkr.server.test import data_setup
+from bkr.inttest.server.selenium import SeleniumTestCase
+from bkr.inttest import data_setup
from bkr.server.model import Job
from turbogears.database import session
-class MaxWhiteboard(selenium.SeleniumTestCase):
+class MaxWhiteboard(SeleniumTestCase):
@classmethod
def setupClass(cls):
diff --git a/Server/bkr/server/test/selenium/test_motd.py b/IntegrationTests/src/bkr/inttest/server/selenium/test_motd.py
index 034df41..b535dff 100644
--- a/Server/bkr/server/test/selenium/test_motd.py
+++ b/IntegrationTests/src/bkr/inttest/server/selenium/test_motd.py
@@ -1,10 +1,10 @@
#!/usr/bin/python
-import bkr.server.test.selenium
-from bkr.server.test import data_setup
+from bkr.inttest.server.selenium import SeleniumTestCase
+from bkr.inttest import data_setup
import turbogears as tg
from lxml import etree
-class TestMOTD(bkr.server.test.selenium.SeleniumTestCase):
+class TestMOTD(SeleniumTestCase):
@classmethod
def setupClass(cls):
diff --git a/Server/bkr/server/test/selenium/test_my_menu_tests.py b/IntegrationTests/src/bkr/inttest/server/selenium/test_my_menu_tests.py
index b77912b..aae3f91 100644
--- a/Server/bkr/server/test/selenium/test_my_menu_tests.py
+++ b/IntegrationTests/src/bkr/inttest/server/selenium/test_my_menu_tests.py
@@ -1,10 +1,10 @@
#!/usr/bin/python
-import bkr.server.test.selenium
-from bkr.server.test import data_setup
+from bkr.inttest.server.selenium import SeleniumTestCase
+from bkr.inttest import data_setup
import unittest, time, re, os
from turbogears.database import session
-class Menu(bkr.server.test.selenium.SeleniumTestCase):
+class Menu(SeleniumTestCase):
def setUp(self):
self.verificationErrors = []
self.selenium = self.get_selenium()
diff --git a/Server/bkr/server/test/selenium/test_product.py b/IntegrationTests/src/bkr/inttest/server/selenium/test_product.py
index f1cf1d3..4efcb22 100644
--- a/Server/bkr/server/test/selenium/test_product.py
+++ b/IntegrationTests/src/bkr/inttest/server/selenium/test_product.py
@@ -1,11 +1,11 @@
#!/usr/bin/python
-import bkr.server.test.selenium
-from bkr.server.test import data_setup
+from bkr.inttest.server.selenium import SeleniumTestCase
+from bkr.inttest import data_setup
import unittest, time, re, os
from turbogears.database import session
-class TestProduct(bkr.server.test.selenium.SeleniumTestCase):
+class TestProduct(SeleniumTestCase):
@classmethod
def setupClass(cls):
diff --git a/Server/bkr/server/test/selenium/test_recipes.py b/IntegrationTests/src/bkr/inttest/server/selenium/test_recipes.py
index 6a4ff93..8bc2bbc 100644
--- a/Server/bkr/server/test/selenium/test_recipes.py
+++ b/IntegrationTests/src/bkr/inttest/server/selenium/test_recipes.py
@@ -22,9 +22,9 @@ import re
from turbogears.database import session
from bkr.server.model import Job
-from bkr.server.test.selenium import SeleniumTestCase
-from bkr.server.test import data_setup
-from bkr.server.test.assertions import assert_sorted
+from bkr.inttest.server.selenium import SeleniumTestCase
+from bkr.inttest import data_setup
+from bkr.inttest.assertions import assert_sorted
class TestRecipesDataGrid(SeleniumTestCase):
diff --git a/Server/bkr/server/test/selenium/test_remove_lc.py b/IntegrationTests/src/bkr/inttest/server/selenium/test_remove_lc.py
index 17af3cb..50448d7 100644
--- a/Server/bkr/server/test/selenium/test_remove_lc.py
+++ b/IntegrationTests/src/bkr/inttest/server/selenium/test_remove_lc.py
@@ -1,5 +1,5 @@
-from bkr.server.test.selenium import SeleniumTestCase
-from bkr.server.test import data_setup
+from bkr.inttest.server.selenium import SeleniumTestCase
+from bkr.inttest import data_setup
from turbogears.database import session
class RemoveLabController(SeleniumTestCase):
diff --git a/Server/bkr/server/test/selenium/test_report_problem.py b/IntegrationTests/src/bkr/inttest/server/selenium/test_report_problem.py
index dfc7b9b..31bf3ca 100644
--- a/Server/bkr/server/test/selenium/test_report_problem.py
+++ b/IntegrationTests/src/bkr/inttest/server/selenium/test_report_problem.py
@@ -21,9 +21,9 @@ import logging
import email
from turbogears.database import session
-from bkr.server.test.selenium import SeleniumTestCase
-from bkr.server.test.mail_capture import MailCaptureThread
-from bkr.server.test import data_setup, get_server_base
+from bkr.inttest.server.selenium import SeleniumTestCase
+from bkr.inttest.mail_capture import MailCaptureThread
+from bkr.inttest import data_setup, get_server_base
class TestReportProblem(SeleniumTestCase):
diff --git a/Server/bkr/server/test/selenium/test_reserve_system.py b/IntegrationTests/src/bkr/inttest/server/selenium/test_reserve_system.py
index a093160..f728eb8 100644
--- a/Server/bkr/server/test/selenium/test_reserve_system.py
+++ b/IntegrationTests/src/bkr/inttest/server/selenium/test_reserve_system.py
@@ -1,6 +1,6 @@
#!/usr/bin/python
-import bkr.server.test.selenium
-from bkr.server.test import data_setup
+from bkr.inttest.server.selenium import SeleniumTestCase
+from bkr.inttest import data_setup
from bkr.server.model import Arch, ExcludeOSMajor
import unittest, time, re, os
from turbogears.database import session
@@ -14,7 +14,7 @@ def click_reserve_now(sel, system):
'and preceding-sibling::td[7]/a/text() = "%s"]/a'
% system.fqdn)
-class ReserveSystem(bkr.server.test.selenium.SeleniumTestCase):
+class ReserveSystem(SeleniumTestCase):
def setUp(self):
self.verificationErrors = []
self.selenium = self.get_selenium()
diff --git a/Server/bkr/server/test/selenium/test_retentiontag.py b/IntegrationTests/src/bkr/inttest/server/selenium/test_retentiontag.py
index 09b6cd2..84c383c 100644
--- a/Server/bkr/server/test/selenium/test_retentiontag.py
+++ b/IntegrationTests/src/bkr/inttest/server/selenium/test_retentiontag.py
@@ -1,6 +1,6 @@
from turbogears.database import session
-from bkr.server.test.selenium import SeleniumTestCase
-from bkr.server.test import data_setup
+from bkr.inttest.server.selenium import SeleniumTestCase
+from bkr.inttest import data_setup
class RetentionTagTest(SeleniumTestCase):
diff --git a/Server/bkr/server/test/selenium/test_system_available.py b/IntegrationTests/src/bkr/inttest/server/selenium/test_system_available.py
index 994821d..d5ff9ac 100644
--- a/Server/bkr/server/test/selenium/test_system_available.py
+++ b/IntegrationTests/src/bkr/inttest/server/selenium/test_system_available.py
@@ -1,9 +1,9 @@
-import bkr.server.test.selenium
-from bkr.server.test import data_setup
+from bkr.inttest.server.selenium import SeleniumTestCase
+from bkr.inttest import data_setup
import unittest, time, re, os
from turbogears.database import session
-class SystemAvailable(bkr.server.test.selenium.SeleniumTestCase):
+class SystemAvailable(SeleniumTestCase):
def setUp(self):
self.selenium = self.get_selenium()
diff --git a/Server/bkr/server/test/selenium/test_system_group_user_take.py b/IntegrationTests/src/bkr/inttest/server/selenium/test_system_group_user_take.py
index 72234e8..aaa4c28 100644
--- a/Server/bkr/server/test/selenium/test_system_group_user_take.py
+++ b/IntegrationTests/src/bkr/inttest/server/selenium/test_system_group_user_take.py
@@ -1,10 +1,10 @@
#!/usr/bin/python
-import bkr.server.test.selenium
+from bkr.inttest.server.selenium import SeleniumTestCase
from turbogears.database import session
-from bkr.server.test import data_setup
+from bkr.inttest import data_setup
import unittest, time, os
-class SystemGroupUserTake(bkr.server.test.selenium.SeleniumTestCase):
+class SystemGroupUserTake(SeleniumTestCase):
"""
Tests the following scenarios for take in both Automated and Manual machines:
diff --git a/Server/bkr/server/test/selenium/test_system_loan.py b/IntegrationTests/src/bkr/inttest/server/selenium/test_system_loan.py
index b690e14..3ce9476 100644
--- a/Server/bkr/server/test/selenium/test_system_loan.py
+++ b/IntegrationTests/src/bkr/inttest/server/selenium/test_system_loan.py
@@ -1,10 +1,10 @@
-import bkr.server.test.selenium
-from bkr.server.test import data_setup
+from bkr.inttest.server.selenium import SeleniumTestCase
+from bkr.inttest import data_setup
import unittest, time, re, os
from turbogears.database import session
-class SystemLoanTest(bkr.server.test.selenium.SeleniumTestCase):
+class SystemLoanTest(SeleniumTestCase):
def setUp(self):
self.selenium = self.get_selenium()
self.selenium.start()
diff --git a/Server/bkr/server/test/selenium/test_system_menu_tests.py b/IntegrationTests/src/bkr/inttest/server/selenium/test_system_menu_tests.py
index 4c2e158..890a404 100644
--- a/Server/bkr/server/test/selenium/test_system_menu_tests.py
+++ b/IntegrationTests/src/bkr/inttest/server/selenium/test_system_menu_tests.py
@@ -1,11 +1,11 @@
#!/usr/bin/python
-import bkr.server.test.selenium
-from bkr.server.test import data_setup
+from bkr.inttest.server.selenium import SeleniumTestCase
+from bkr.inttest import data_setup
import unittest, time, re, os
from turbogears.database import session
-class Menu(bkr.server.test.selenium.SeleniumTestCase):
+class Menu(SeleniumTestCase):
def setUp(self):
diff --git a/Server/bkr/server/test/selenium/test_system_search.py b/IntegrationTests/src/bkr/inttest/server/selenium/test_system_search.py
index 44baadd..f2a4005 100644
--- a/Server/bkr/server/test/selenium/test_system_search.py
+++ b/IntegrationTests/src/bkr/inttest/server/selenium/test_system_search.py
@@ -1,11 +1,11 @@
#!/usr/bin/python
from bkr.server.model import Numa, User
-import bkr.server.test.selenium
-from bkr.server.test import data_setup
+from bkr.inttest.server.selenium import SeleniumTestCase
+from bkr.inttest import data_setup
import unittest, time, re, os, datetime
from turbogears.database import session
-class SearchColumns(bkr.server.test.selenium.SeleniumTestCase):
+class SearchColumns(SeleniumTestCase):
@classmethod
def setUpClass(cls):
@@ -72,7 +72,7 @@ class SearchColumns(bkr.server.test.selenium.SeleniumTestCase):
-class Search(bkr.server.test.selenium.SeleniumTestCase):
+class Search(SeleniumTestCase):
@classmethod
def setUpClass(cls):
diff --git a/Server/bkr/server/test/selenium/test_system_view.py b/IntegrationTests/src/bkr/inttest/server/selenium/test_system_view.py
index 7a6776f..03985d1 100644
--- a/Server/bkr/server/test/selenium/test_system_view.py
+++ b/IntegrationTests/src/bkr/inttest/server/selenium/test_system_view.py
@@ -27,8 +27,8 @@ from urllib import urlencode, quote
import rdflib.graph
from turbogears.database import session
-from bkr.server.test.selenium import SeleniumTestCase
-from bkr.server.test import data_setup, get_server_base, stub_cobbler, \
+from bkr.inttest.server.selenium import SeleniumTestCase
+from bkr.inttest import data_setup, get_server_base, stub_cobbler, \
assertions
from bkr.server.model import Key, Key_Value_String, Key_Value_Int, System, \
Provision, ProvisionFamily, ProvisionFamilyUpdate, Hypervisor
diff --git a/Server/bkr/server/test/selenium/test_systems.py b/IntegrationTests/src/bkr/inttest/server/selenium/test_systems.py
index 7ce4aa5..ffa0761 100644
--- a/Server/bkr/server/test/selenium/test_systems.py
+++ b/IntegrationTests/src/bkr/inttest/server/selenium/test_systems.py
@@ -26,9 +26,9 @@ from urllib import urlencode, urlopen
import lxml.etree
from turbogears.database import session
-from bkr.server.test.selenium import SeleniumTestCase
-from bkr.server.test import data_setup, get_server_base
-from bkr.server.test.assertions import assert_sorted
+from bkr.inttest.server.selenium import SeleniumTestCase
+from bkr.inttest import data_setup, get_server_base
+from bkr.inttest.assertions import assert_sorted
from bkr.server.model import Cpu
def atom_xpath(expr):
diff --git a/Server/bkr/server/test/selenium/test_systems_xmlrpc.py b/IntegrationTests/src/bkr/inttest/server/selenium/test_systems_xmlrpc.py
index 214f890..1f6782a 100644
--- a/Server/bkr/server/test/selenium/test_systems_xmlrpc.py
+++ b/IntegrationTests/src/bkr/inttest/server/selenium/test_systems_xmlrpc.py
@@ -26,10 +26,10 @@ import datetime
import xmlrpclib
from turbogears.database import session
-from bkr.server.test.selenium import XmlRpcTestCase
-from bkr.server.test.assertions import assert_datetime_within, \
+from bkr.inttest.server.selenium import XmlRpcTestCase
+from bkr.inttest.assertions import assert_datetime_within, \
assert_durations_not_overlapping
-from bkr.server.test import data_setup, stub_cobbler
+from bkr.inttest import data_setup, stub_cobbler
from bkr.server.model import User, Cpu, Key, Key_Value_String, Key_Value_Int, \
System, SystemActivity, Provision, Hypervisor
from bkr.server.util import parse_xmlrpc_datetime
diff --git a/Server/bkr/server/test/selenium/test_task_by_name.py b/IntegrationTests/src/bkr/inttest/server/selenium/test_task_by_name.py
index d5c1a0f..4e5d850 100644
--- a/Server/bkr/server/test/selenium/test_task_by_name.py
+++ b/IntegrationTests/src/bkr/inttest/server/selenium/test_task_by_name.py
@@ -1,10 +1,10 @@
#!/usr/bin/python
-import bkr.server.test.selenium
-from bkr.server.test import data_setup
+from bkr.inttest.server.selenium import SeleniumTestCase
+from bkr.inttest import data_setup
import unittest, time, re, os
from turbogears.database import session
-class TaskByName(bkr.server.test.selenium.SeleniumTestCase):
+class TaskByName(SeleniumTestCase):
def setUp(self):
self.my_task = data_setup.create_task()
diff --git a/Server/bkr/server/test/selenium/test_task_paginate.py b/IntegrationTests/src/bkr/inttest/server/selenium/test_task_paginate.py
index 73783f5..bc8ed30 100644
--- a/Server/bkr/server/test/selenium/test_task_paginate.py
+++ b/IntegrationTests/src/bkr/inttest/server/selenium/test_task_paginate.py
@@ -1,10 +1,10 @@
#!/usr/bin/python
-import bkr.server.test.selenium
-from bkr.server.test import data_setup
+from bkr.inttest.server.selenium import SeleniumTestCase
+from bkr.inttest import data_setup
from turbogears.database import session
from datetime import datetime
-class TaskPaginate(bkr.server.test.selenium.SeleniumTestCase):
+class TaskPaginate(SeleniumTestCase):
@classmethod
def setupClass(cls):
diff --git a/Server/bkr/server/test/selenium/test_task_search.py b/IntegrationTests/src/bkr/inttest/server/selenium/test_task_search.py
index 6a1b78d..5d1ab33 100644
--- a/Server/bkr/server/test/selenium/test_task_search.py
+++ b/IntegrationTests/src/bkr/inttest/server/selenium/test_task_search.py
@@ -1,10 +1,10 @@
#!/usr/bin/python
-import bkr.server.test.selenium
-from bkr.server.test import data_setup
+from bkr.inttest.server.selenium import SeleniumTestCase
+from bkr.inttest import data_setup
import unittest, time, re, os
from turbogears.database import session
-class Search(bkr.server.test.selenium.SeleniumTestCase):
+class Search(SeleniumTestCase):
def setUp(self):
self.verificationErrors = []
self.selenium = self.get_selenium()
diff --git a/Server/bkr/server/test/selenium/test_tasks.py b/IntegrationTests/src/bkr/inttest/server/selenium/test_tasks.py
index 3c1fcb6..b6d97d4 100644
--- a/Server/bkr/server/test/selenium/test_tasks.py
+++ b/IntegrationTests/src/bkr/inttest/server/selenium/test_tasks.py
@@ -1,13 +1,13 @@
#!/usr/bin/python
-import bkr.server.test.selenium
-from bkr.server.test import data_setup
+from bkr.inttest.server.selenium import SeleniumTestCase
+from bkr.inttest import data_setup
import unittest, time, re, os, shutil, turbogears
import pkg_resources
from turbogears.database import session
from bkr.server.model import TaskPackage
import turbogears as tg
-class TestSubmitTask(bkr.server.test.selenium.SeleniumTestCase):
+class TestSubmitTask(SeleniumTestCase):
@classmethod
def setupClass(cls):
diff --git a/Server/bkr/server/test/selenium/tmp-distribution-beaker-dummy_for_bz681143-1.0-1.noarch.rpm b/IntegrationTests/src/bkr/inttest/server/selenium/tmp-distribution-beaker-dummy_for_bz681143-1.0-1.noarch.rpm
index e37710e..e37710e 100644
--- a/Server/bkr/server/test/selenium/tmp-distribution-beaker-dummy_for_bz681143-1.0-1.noarch.rpm
+++ b/IntegrationTests/src/bkr/inttest/server/selenium/tmp-distribution-beaker-dummy_for_bz681143-1.0-1.noarch.rpm
Binary files differ
diff --git a/Server/bkr/server/test/selenium/tmp-distribution-beaker-task_test-1.1-0.noarch.rpm b/IntegrationTests/src/bkr/inttest/server/selenium/tmp-distribution-beaker-task_test-1.1-0.noarch.rpm
index 49f63ed..49f63ed 100644
--- a/Server/bkr/server/test/selenium/tmp-distribution-beaker-task_test-1.1-0.noarch.rpm
+++ b/IntegrationTests/src/bkr/inttest/server/selenium/tmp-distribution-beaker-task_test-1.1-0.noarch.rpm
Binary files differ
diff --git a/Server/bkr/server/test/selenium/tmp-distribution-beaker-task_test-2.0-2.noarch.rpm b/IntegrationTests/src/bkr/inttest/server/selenium/tmp-distribution-beaker-task_test-2.0-2.noarch.rpm
index dce2053..dce2053 100644
--- a/Server/bkr/server/test/selenium/tmp-distribution-beaker-task_test-2.0-2.noarch.rpm
+++ b/IntegrationTests/src/bkr/inttest/server/selenium/tmp-distribution-beaker-task_test-2.0-2.noarch.rpm
Binary files differ
diff --git a/Server/bkr/server/test/test_ack_in_jobxml.py b/IntegrationTests/src/bkr/inttest/server/test_ack_in_jobxml.py
index 5aba114..67260e1 100644
--- a/Server/bkr/server/test/test_ack_in_jobxml.py
+++ b/IntegrationTests/src/bkr/inttest/server/test_ack_in_jobxml.py
@@ -1,6 +1,6 @@
import unittest
from turbogears.database import session
-from bkr.server.test import data_setup
+from bkr.inttest import data_setup
from bkr.server.model import Job, Response, RecipeSetResponse
import xmltramp
from bkr.server.jobxml import XmlJob
diff --git a/Server/bkr/server/test/test_beakerd.py b/IntegrationTests/src/bkr/inttest/server/test_beakerd.py
index 4ed3653..f558b7d 100644
--- a/Server/bkr/server/test/test_beakerd.py
+++ b/IntegrationTests/src/bkr/inttest/server/test_beakerd.py
@@ -4,8 +4,8 @@ from time import sleep
from bkr.server.model import TaskStatus, Job, System, User
import sqlalchemy.orm
from turbogears.database import session
-from bkr.server.test import data_setup
-from bkr.server.test.assertions import assert_datetime_within, \
+from bkr.inttest import data_setup
+from bkr.inttest.assertions import assert_datetime_within, \
assert_durations_not_overlapping
from bkr.server.tools import beakerd
import threading
diff --git a/Server/bkr/server/test/test_deadrecipes.py b/IntegrationTests/src/bkr/inttest/server/test_deadrecipes.py
index ef97831..76466ec 100644
--- a/Server/bkr/server/test/test_deadrecipes.py
+++ b/IntegrationTests/src/bkr/inttest/server/test_deadrecipes.py
@@ -6,7 +6,7 @@ import time
from bkr.server.model import TaskStatus, Job, LabControllerDistro, Distro
import sqlalchemy.orm
from turbogears.database import session
-from bkr.server.test import data_setup
+from bkr.inttest import data_setup
from bkr.server.tools import beakerd
from bkr.server.jobxml import XmlJob
from bkr.server.jobs import Jobs
diff --git a/Server/bkr/server/test/test_group_xml.py b/IntegrationTests/src/bkr/inttest/server/test_group_xml.py
index 73479ca..f0f7e6d 100644
--- a/Server/bkr/server/test/test_group_xml.py
+++ b/IntegrationTests/src/bkr/inttest/server/test_group_xml.py
@@ -4,8 +4,8 @@ from time import sleep
from bkr.server.model import TaskStatus, Job, System, User
import sqlalchemy.orm
from turbogears.database import session
-from bkr.server.test import data_setup
-from bkr.server.test.assertions import assert_datetime_within, \
+from bkr.inttest import data_setup
+from bkr.inttest.assertions import assert_datetime_within, \
assert_durations_not_overlapping
class TestGroupXml(unittest.TestCase):
diff --git a/Server/bkr/server/test/test_jobs.py b/IntegrationTests/src/bkr/inttest/server/test_jobs.py
index 5f9a13d..3a7e7e4 100644
--- a/Server/bkr/server/test/test_jobs.py
+++ b/IntegrationTests/src/bkr/inttest/server/test_jobs.py
@@ -6,7 +6,7 @@ from turbogears import testutil
from turbogears.database import session
from bkr.server.jobxml import XmlJob
from bkr.server.bexceptions import BX
-from bkr.server.test import data_setup
+from bkr.inttest import data_setup
from bkr.server.model import Distro
class TestJobsController(unittest.TestCase):
@@ -62,7 +62,7 @@ class TestJobsController(unittest.TestCase):
def test_job_xml_can_be_roundtripped(self):
# Ideally the logic for parsing job XML into a Job instance would live in model code,
# so that this test doesn't have to go through the web layer...
- complete_job_xml = pkg_resources.resource_string('bkr.server.test', 'complete-job.xml')
+ complete_job_xml = pkg_resources.resource_string('bkr.inttest', 'complete-job.xml')
xmljob = XmlJob(xmltramp.parse(complete_job_xml))
job = testutil.call(self.controller.process_xmljob, xmljob, self.user)
roundtripped_xml = job.to_xml(clone=True).toprettyxml(indent=' ')
diff --git a/Server/bkr/server/test/test_lab_controller.py b/IntegrationTests/src/bkr/inttest/server/test_lab_controller.py
index 002a0d4..461e634 100644
--- a/Server/bkr/server/test/test_lab_controller.py
+++ b/IntegrationTests/src/bkr/inttest/server/test_lab_controller.py
@@ -6,7 +6,7 @@ from turbogears.database import session
from bkr.server.model import TaskStatus, RecipeSet
from bkr.server.jobxml import XmlJob
from bkr.server.bexceptions import BX
-from bkr.server.test import data_setup
+from bkr.inttest import data_setup
from bkr.server.tools import beakerd
class TestLabController(unittest.TestCase):
diff --git a/Server/bkr/server/test/test_mail.py b/IntegrationTests/src/bkr/inttest/server/test_mail.py
index 41f28bb..dd6b041 100644
--- a/Server/bkr/server/test/test_mail.py
+++ b/IntegrationTests/src/bkr/inttest/server/test_mail.py
@@ -21,7 +21,7 @@ import email
import unittest
from turbogears.database import session
from bkr.server.model import Arch
-from bkr.server.test import data_setup, mail_capture, get_server_base
+from bkr.inttest import data_setup, mail_capture, get_server_base
import bkr.server.mail
class BrokenSystemNotificationTest(unittest.TestCase):
diff --git a/Server/bkr/server/test/test_max_whiteboard.py b/IntegrationTests/src/bkr/inttest/server/test_max_whiteboard.py
index 58ad1d7..2be9096 100644
--- a/Server/bkr/server/test/test_max_whiteboard.py
+++ b/IntegrationTests/src/bkr/inttest/server/test_max_whiteboard.py
@@ -1,7 +1,7 @@
import unittest
from bkr.server.model import Job
from turbogears.database import session
-from bkr.server.test import data_setup
+from bkr.inttest import data_setup
class MaxWhiteboard(unittest.TestCase):
diff --git a/Server/bkr/server/test/test_model.py b/IntegrationTests/src/bkr/inttest/server/test_model.py
index 3592ede..bce3f46 100644
--- a/Server/bkr/server/test/test_model.py
+++ b/IntegrationTests/src/bkr/inttest/server/test_model.py
@@ -6,7 +6,7 @@ from turbogears.database import session
from bkr.server.model import System, SystemStatus, SystemActivity, TaskStatus, \
SystemType, Job, JobCc, Key, Key_Value_Int, Key_Value_String, \
Cpu, Numa, Provision, job_cc_table, Arch
-from bkr.server.test import data_setup
+from bkr.inttest import data_setup
from nose.plugins.skip import SkipTest
class SchemaSanityTest(unittest.TestCase):
diff --git a/Server/bkr/server/test/test_rdf.py b/IntegrationTests/src/bkr/inttest/server/test_rdf.py
index 854f0c3..ff3a5fd 100644
--- a/Server/bkr/server/test/test_rdf.py
+++ b/IntegrationTests/src/bkr/inttest/server/test_rdf.py
@@ -18,7 +18,7 @@
import unittest
from decimal import Decimal
from turbogears.database import session
-from bkr.server.test import data_setup, get_server_base
+from bkr.inttest import data_setup, get_server_base
from bkr.server.model import Cpu, Arch
from rdflib.term import URIRef, Literal
from rdflib.graph import Graph
diff --git a/Server/bkr/server/test/test_tasks.py b/IntegrationTests/src/bkr/inttest/server/test_tasks.py
index 5afa749..a9704eb 100644
--- a/Server/bkr/server/test/test_tasks.py
+++ b/IntegrationTests/src/bkr/inttest/server/test_tasks.py
@@ -6,7 +6,7 @@ from turbogears.database import session
from bkr.server.model import TaskStatus, RecipeSet
from bkr.server.jobxml import XmlJob
from bkr.server.bexceptions import BX
-from bkr.server.test import data_setup
+from bkr.inttest import data_setup
from bkr.server.tools import beakerd
class TestTasks(unittest.TestCase):
diff --git a/Server/bkr/server/test/test_update_status.py b/IntegrationTests/src/bkr/inttest/server/test_update_status.py
index 7b014c3..ffec8c2 100644
--- a/Server/bkr/server/test/test_update_status.py
+++ b/IntegrationTests/src/bkr/inttest/server/test_update_status.py
@@ -5,7 +5,7 @@ import pkg_resources
from turbogears.database import session
from bkr.server.jobxml import XmlJob
from bkr.server.bexceptions import BX
-from bkr.server.test import data_setup
+from bkr.inttest import data_setup
from bkr.server.model import TaskStatus, Watchdog, RecipeSet, Distro
def watchdogs_for_job(job):
@@ -87,7 +87,7 @@ class TestUpdateStatus(unittest.TestCase):
self.assertEquals(job.status, aborted)
def test_update_status_can_be_roundtripped_35508(self):
- complete_job_xml = pkg_resources.resource_string('bkr.server.test', 'job_35508.xml')
+ complete_job_xml = pkg_resources.resource_string('bkr.inttest', 'job_35508.xml')
xmljob = XmlJob(xmltramp.parse(complete_job_xml))
data_setup.create_tasks(xmljob)
@@ -122,7 +122,7 @@ class TestUpdateStatus(unittest.TestCase):
self.assertEquals(len(watchdogs_for_job(job)), 0)
def test_update_status_can_be_roundtripped_40214(self):
- complete_job_xml = pkg_resources.resource_string('bkr.server.test', 'job_40214.xml')
+ complete_job_xml = pkg_resources.resource_string('bkr.inttest', 'job_40214.xml')
xmljob = XmlJob(xmltramp.parse(complete_job_xml))
data_setup.create_tasks(xmljob)
diff --git a/Server/bkr/server/test/test_utilisation.py b/IntegrationTests/src/bkr/inttest/server/test_utilisation.py
index dac49a7..78962a1 100644
--- a/Server/bkr/server/test/test_utilisation.py
+++ b/IntegrationTests/src/bkr/inttest/server/test_utilisation.py
@@ -4,7 +4,7 @@ import datetime
from turbogears.database import session
from bkr.server.model import SystemStatus, SystemStatusDuration
from bkr.server.utilisation import system_utilisation
-from bkr.server.test import data_setup
+from bkr.inttest import data_setup
class SystemUtilisationTest(unittest.TestCase):
diff --git a/IntegrationTests/src/bkr/inttest/server/tools/__init__.py b/IntegrationTests/src/bkr/inttest/server/tools/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/IntegrationTests/src/bkr/inttest/server/tools/__init__.py
diff --git a/Server/bkr/server/test/tools/test_delete_system.py b/IntegrationTests/src/bkr/inttest/server/tools/test_delete_system.py
index 6410780..77c748e 100644
--- a/Server/bkr/server/test/tools/test_delete_system.py
+++ b/IntegrationTests/src/bkr/inttest/server/tools/test_delete_system.py
@@ -3,7 +3,7 @@ import unittest
from bkr.server.model import System, LabInfo, Provision, \
ProvisionFamily, ProvisionFamilyUpdate
from turbogears.database import session
-from bkr.server.test import data_setup
+from bkr.inttest import data_setup
from bkr.server.tools.delete_system import delete_system
class DeleteSystemTest(unittest.TestCase):
diff --git a/Server/bkr/server/test/test_log_delete.py b/IntegrationTests/src/bkr/inttest/server/tools/test_log_delete.py
index 7c97d1f..cbd4b43 100644
--- a/Server/bkr/server/test/test_log_delete.py
+++ b/IntegrationTests/src/bkr/inttest/server/tools/test_log_delete.py
@@ -1,6 +1,6 @@
import unittest, datetime, os, errno, shutil
from bkr.server.model import LogRecipe, TaskBase
-from bkr.server.test import data_setup
+from bkr.inttest import data_setup
from bkr.server.tools import log_delete
from turbogears.database import session
diff --git a/Server/bkr/server/test/test_nag_mail.py b/IntegrationTests/src/bkr/inttest/server/tools/test_nag_mail.py
index 75ba86e..a79734a 100644
--- a/Server/bkr/server/test/test_nag_mail.py
+++ b/IntegrationTests/src/bkr/inttest/server/tools/test_nag_mail.py
@@ -5,8 +5,7 @@ import sys
from tempfile import TemporaryFile
from turbogears.database import session
from bkr.server.model import SystemActivity
-from bkr.server.test import data_setup
-from bkr.server.test import mail_capture
+from bkr.inttest import data_setup, mail_capture
from bkr.server.tools.nag_email import identify_nags
class TestNagMail(unittest.TestCase):
diff --git a/Server/bkr/server/test/stub_cobbler.py b/IntegrationTests/src/bkr/inttest/stub_cobbler.py
index 3ff4d55..3ff4d55 100644
--- a/Server/bkr/server/test/stub_cobbler.py
+++ b/IntegrationTests/src/bkr/inttest/stub_cobbler.py
diff --git a/Makefile b/Makefile
index 6bddfa1..bbece58 100644
--- a/Makefile
+++ b/Makefile
@@ -6,7 +6,7 @@ PKGNAME=beaker
SCM_REMOTEREPO_RE = ^ssh://(.*@)?git.fedorahosted.org/git/$(PKGNAME).git$
UPLOAD_URL = ssh://fedorahosted.org/$(PKGNAME)
-SUBDIRS := Common Client LabController Server
+SUBDIRS := Common Client LabController Server IntegrationTests
build:
for i in $(SUBDIRS); do $(MAKE) -C $$i build; done
diff --git a/Server/bkr/server/test/__init__.py b/Server/bkr/server/test/__init__.py
deleted file mode 100644
index eeda79f..0000000
--- a/Server/bkr/server/test/__init__.py
+++ /dev/null
@@ -1,72 +0,0 @@
-# Beaker
-#
-# Copyright (C) 2010 dcallagh@redhat.com
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-import sys
-import os
-from StringIO import StringIO
-import logging, logging.config
-import cherrypy
-import turbogears
-from turbogears import update_config
-from turbogears.database import session
-from bkr.server.controllers import Root
-from bkr.server.util import log_to_stream
-from bkr.server.test import data_setup
-
-# hack to make turbogears.testutil not do dumb stuff at import time
-orig_cwd = os.getcwd()
-os.chdir('/tmp')
-import turbogears.testutil
-os.chdir(orig_cwd)
-
-# workaround for weird sqlalchemy-0.4 bug :-S
-# http://markmail.org/message/rnnzdebfzrjt3kmi
-from sqlalchemy.orm.dynamic import DynamicAttributeImpl
-DynamicAttributeImpl.accepts_scalar_loader = False
-
-log = logging.getLogger(__name__)
-
-CONFIG_FILE = os.environ.get('BEAKER_CONFIG_FILE', 'test.cfg')
-
-def get_server_base():
- return os.environ.get('BEAKER_SERVER_BASE_URL',
- 'http://localhost:%s/' % turbogears.config.get('server.socket_port'))
-
-def setup_package():
- log.info('Loading test configuration from %s', CONFIG_FILE)
- assert os.path.exists(CONFIG_FILE), 'Config file %s must exist' % CONFIG_FILE
- update_config(configfile=CONFIG_FILE, modulename='bkr.server.config')
-
- # Override loaded logging config, in case we are using the server's config file
- # (we really always want our tests' logs to go to stdout, not /var/log/beaker/)
- log_to_stream(sys.stdout, level=logging.NOTSET)
-
- if not 'BEAKER_SKIP_INIT_DB' in os.environ:
- data_setup.setup_model()
- data_setup.create_distro()
- data_setup.create_labcontroller() #always need a labcontroller
- session.flush()
-
- if not os.path.exists(turbogears.config.get('basepath.rpms')):
- os.mkdir(turbogears.config.get('basepath.rpms'))
-
- cherrypy.root = Root()
- turbogears.testutil.start_cp()
-
-def teardown_package():
- cherrypy.server.stop()
diff --git a/Tasks/distribution/beaker/dogfood/Makefile b/Tasks/distribution/beaker/dogfood/Makefile
index 66162cd..b042404 100644
--- a/Tasks/distribution/beaker/dogfood/Makefile
+++ b/Tasks/distribution/beaker/dogfood/Makefile
@@ -68,7 +68,7 @@ $(METADATA): Makefile
@echo "Description: Runs Beaker's internal test suite" >> $(METADATA)
@echo "TestTime: 4h" >> $(METADATA)
@echo "RunFor: $(PACKAGE_NAME)-server" >> $(METADATA)
- @echo "Requires: $(PACKAGE_NAME)-server" >> $(METADATA)
+ @echo "Requires: $(PACKAGE_NAME)-integration-tests" >> $(METADATA)
@echo "Requires: python-nose" >> $(METADATA)
@echo "Requires: kobo" >> $(METADATA)
@echo "Requires: java-1.6.0-openjdk" >> $(METADATA)
@@ -79,6 +79,6 @@ $(METADATA): Makefile
@echo "Environment: BEAKER_SERVER_BASE_URL=http://localhost/bkr/" >> $(METADATA)
# @echo "Environment: BEAKER_SKIP_INIT_DB=1" >> $(METADATA)
@echo "Environment: BEAKER_CONFIG_FILE=/etc/beaker/server.cfg" >> $(METADATA)
- @echo "Environment: NOSEARGS=bkr.server" >> $(METADATA)
+ @echo "Environment: NOSEARGS=bkr" >> $(METADATA)
rhts-lint $(METADATA)
diff --git a/beaker.spec b/beaker.spec
index 293e00f..96f86cb 100644
--- a/beaker.spec
+++ b/beaker.spec
@@ -72,6 +72,19 @@ Requires: createrepo
Requires: yum-utils
+%package integration-tests
+Summary: Integration tests for Beaker
+Group: Applications/Internet
+Requires: %{name} = %{version}-%{release}
+Requires: %{name}-server = %{version}-%{release}
+Requires: %{name}-client = %{version}-%{release}
+Requires: python-nose >= 0.10
+Requires: kobo
+Requires: java-1.6.0-openjdk
+Requires: Xvfb
+Requires: firefox
+
+
%package lab-controller
Summary: Lab Controller xmlrpc server
Group: Applications/Internet
@@ -115,6 +128,11 @@ This is the command line interface used to interact with the Beaker Server.
To Be Filled in - Server Side..
+%description integration-tests
+This package contains integration tests for Beaker, which require a running
+database and Beaker server.
+
+
%description lab-controller
This is the interface to link Medusa and Cobbler together. Mostly provides
snippets and kickstarts.
@@ -213,6 +231,12 @@ fi
%attr(-,apache,root) %dir %{_localstatedir}/www/%{name}/repos
%attr(-,apache,root) %dir %{_localstatedir}/run/%{name}
+%files integration-tests
+%defattr(-,root,root,-)
+%{python_sitelib}/bkr/inttest/
+%{python_sitelib}/bkr.inttest-%{version}-*
+%{python_sitelib}/bkr.inttest-%{version}-py%{pyver}.egg-info/
+
%files client
%defattr(-,root,root,-)
%config(noreplace) %{_sysconfdir}/beaker/client.conf