summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Callaghan <dcallagh@redhat.com>2010-10-06 15:01:44 +1000
committerDan Callaghan <dcallagh@redhat.com>2010-10-06 15:18:26 +1000
commit84c3c4a66bf7a6e7cd48db3e2715a8ff34da406f (patch)
tree291372a10d4b330c42f16ad287c02c5b4c0f4caa
parent78e4b2da1cf347db1f4591ab8d02b84b52509fe2 (diff)
first go at a task for running the beaker test suite on beakerbeaker-distribution-beaker-setup-1_1-53
-rw-r--r--Server/bkr/server/test/selenium/__init__.py18
-rw-r--r--Tasks/distribution/beaker/dogfood/Makefile72
-rw-r--r--Tasks/distribution/beaker/dogfood/PURPOSE1
-rwxr-xr-xTasks/distribution/beaker/dogfood/runtest.sh20
-rwxr-xr-xTasks/distribution/beaker/setup/runtest.sh6
5 files changed, 105 insertions, 12 deletions
diff --git a/Server/bkr/server/test/selenium/__init__.py b/Server/bkr/server/test/selenium/__init__.py
index 427e734..6c365bd 100644
--- a/Server/bkr/server/test/selenium/__init__.py
+++ b/Server/bkr/server/test/selenium/__init__.py
@@ -37,8 +37,8 @@ class SeleniumTestCase(unittest.TestCase):
@classmethod
def get_selenium(cls):
cls.sel = selenium('localhost', 4444, '*chrome',
- 'http://%s:%s/' % (os.environ.get('SERVER', 'localhost'),
- turbogears.config.get('server.socket_port')))
+ os.environ.get('SERVER_BASE_URL', 'http://localhost:%s/'
+ % turbogears.config.get('server.socket_port')))
return cls.sel
@classmethod
@@ -98,10 +98,6 @@ class Process(object):
self.stop_signal = stop_signal
def start(self):
- if self.listen_port and check_listen(self.listen_port):
- log.warning('Another process is already listening on %d, not starting %s',
- self.listen_port, self.name)
- return
log.info('Spawning %s: %s %r', self.name, ' '.join(self.args), self.env)
env = dict(os.environ)
if self.env:
@@ -165,10 +161,14 @@ def setup_package():
'/usr/local/share/selenium/selenium-server-1.0.3/selenium-server.jar',
'-log', 'selenium.log'], env={'DISPLAY': ':4'},
listen_port=4444),
- Process('beaker', args=['./start-server.py', 'test.cfg'],
- listen_port=turbogears.config.get('server.socket_port'),
- stop_signal=signal.SIGINT)
])
+ if 'SERVER_BASE_URL' not in os.environ:
+ # need to start the server ourselves
+ processes.extend([
+ Process('beaker', args=['./start-server.py', 'test.cfg'],
+ listen_port=turbogears.config.get('server.socket_port'),
+ stop_signal=signal.SIGINT)
+ ])
try:
for process in processes:
process.start()
diff --git a/Tasks/distribution/beaker/dogfood/Makefile b/Tasks/distribution/beaker/dogfood/Makefile
new file mode 100644
index 0000000..f2bd52b
--- /dev/null
+++ b/Tasks/distribution/beaker/dogfood/Makefile
@@ -0,0 +1,72 @@
+# Copyright (c) 2010 Red Hat, Inc. All rights reserved. This copyrighted material
+# is made available to anyone wishing to use, modify, copy, or
+# redistribute it subject to the terms and conditions of the GNU General
+# Public License v.2.
+#
+# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# Author: Dan Callaghan <dcallagh@redhat.com>
+
+TOPLEVEL_NAMESPACE=distribution
+PACKAGE_NAME=beaker
+RELATIVE_PATH=dogfood
+export TESTVERSION=0.9
+export TEST=/$(TOPLEVEL_NAMESPACE)/$(PACKAGE_NAME)/$(RELATIVE_PATH)
+
+.PHONY: all install download clean
+
+# executables to be built should be added here, they will be generated on the system under test.
+BUILT_FILES=
+
+DOWNLOADED_FILES=selenium-remote-control-1.0.3.zip
+
+# data files, .c files, scripts anything needed to either compile the test and/or run it.
+FILES=$(METADATA) runtest.sh Makefile PURPOSE \
+ /usr/lib/python2.4/site-packages/selenium-2.0a5-py2.4.egg \
+ /usr/local/share/selenium/selenium-server-1.0.3
+
+run: $(FILES) build
+ ./runtest.sh
+
+build: $(BUILT_FILES)
+ chmod a+x ./runtest.sh
+
+download: $(DOWNLOADED_FILES)
+
+selenium-remote-control-1.0.3.zip:
+ wget http://selenium.googlecode.com/files/$@
+
+clean:
+ rm -f *~ *.rpm $(BUILT_FILES) $(DOWNLOADED_FILES)
+
+/usr/local/share/selenium/selenium-server-1.0.3:
+ unzip -d /usr/local/share/selenium selenium-remote-control-1.0.3.zip
+
+/usr/lib/python2.4/site-packages/selenium-2.0a5-py2.4.egg:
+ easy_install 'selenium==2.0a5'
+
+# Include Common Makefile
+include /usr/share/rhts/lib/rhts-make.include
+
+# Generate the testinfo.desc here:
+$(METADATA): Makefile
+ @touch $(METADATA)
+ @echo "Owner: Dan Callaghan <dcallagh@redhat.com>" > $(METADATA)
+ @echo "Name: $(TEST)" >> $(METADATA)
+ @echo "Path: $(TEST_DIR)" >> $(METADATA)
+ @echo "License: GPL-2" >> $(METADATA)
+ @echo "TestVersion: $(TESTVERSION)" >> $(METADATA)
+ @echo "Description: Runs Beaker's internal test suite" >> $(METADATA)
+ @echo "TestTime: 30m" >> $(METADATA)
+ @echo "RunFor: $(PACKAGE_NAME)-server" >> $(METADATA)
+ @echo "Requires: $(PACKAGE_NAME)-server" >> $(METADATA)
+ @echo "Requires: python-nose" >> $(METADATA)
+ @echo "Requires: java-1.6.0-openjdk" >> $(METADATA)
+
+ rhts-lint $(METADATA)
diff --git a/Tasks/distribution/beaker/dogfood/PURPOSE b/Tasks/distribution/beaker/dogfood/PURPOSE
new file mode 100644
index 0000000..974c88d
--- /dev/null
+++ b/Tasks/distribution/beaker/dogfood/PURPOSE
@@ -0,0 +1 @@
+Verify that Beaker's test suite passes in a production-like environment
diff --git a/Tasks/distribution/beaker/dogfood/runtest.sh b/Tasks/distribution/beaker/dogfood/runtest.sh
new file mode 100755
index 0000000..afbb814
--- /dev/null
+++ b/Tasks/distribution/beaker/dogfood/runtest.sh
@@ -0,0 +1,20 @@
+#!/bin/sh
+
+# Copyright (c) 2010 Red Hat, Inc. All rights reserved. This copyrighted material
+# is made available to anyone wishing to use, modify, copy, or
+# redistribute it subject to the terms and conditions of the GNU General
+# Public License v.2.
+#
+# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# Author: Dan Callaghan <dcallagh@redhat.com>
+
+export SERVER_BASE_URL="http://localhost/bkr/"
+
+rhts-run-simple-test $TEST nosetests -v bkr.server
diff --git a/Tasks/distribution/beaker/setup/runtest.sh b/Tasks/distribution/beaker/setup/runtest.sh
index a4a11d8..abaceae 100755
--- a/Tasks/distribution/beaker/setup/runtest.sh
+++ b/Tasks/distribution/beaker/setup/runtest.sh
@@ -171,13 +171,13 @@ test_password='$1$rhts$ShuaoxZPm2Dr79tpoP8NE.'
##
## TurboMail settings
##
-mail.on = False
+mail.on = True
mail.manager = 'immediate'
mail.transport = 'smtp'
mail.provider = 'smtp'
-mail.smtp.server = '127.0.0.1'
+mail.smtp.server = '127.0.0.1:19999'
-beaker_email='root@localhost.localdomain'
+beaker_email='$SUBMITTER'
# Authentication