summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Callaghan <dcallagh@redhat.com>2010-11-11 15:45:45 +1000
committerDan Callaghan <dcallagh@redhat.com>2010-11-11 15:45:45 +1000
commitd46dcaaa378c1dccfb292fdd6352a584ab50f0cb (patch)
tree6527aa25951b4216e5cdf322707aed74c5793872
parent63b336218dc00c38d01dc7c4ccd88c42ca676bee (diff)
parente5cc5ab8b2eff2c9440e5a480fbc097f037ee8bd (diff)
Merge branch 'dogfood' into developbeaker-distribution-beaker-dogfood-0_9-1
-rw-r--r--Server/bkr/server/test/__init__.py31
-rw-r--r--Server/bkr/server/test/selenium/__init__.py22
-rw-r--r--Server/bkr/server/test/selenium/test_add_group.py6
-rw-r--r--Server/bkr/server/test/selenium/test_add_system.py24
-rw-r--r--Server/bkr/server/test/selenium/test_add_system_group.py2
-rw-r--r--Server/bkr/server/test/selenium/test_add_user.py6
-rw-r--r--Server/bkr/server/test/selenium/test_add_user_to_group.py8
-rw-r--r--Server/bkr/server/test/selenium/test_import_keyvalue.py2
-rw-r--r--Server/bkr/server/test/selenium/test_item_count.py2
-rw-r--r--Server/bkr/server/test/selenium/test_my_menu_tests.py2
-rw-r--r--Server/bkr/server/test/selenium/test_report_problem.py7
-rw-r--r--Server/bkr/server/test/selenium/test_reserve_system.py14
-rw-r--r--Server/bkr/server/test/selenium/test_system_group_user_take.py12
-rw-r--r--Server/bkr/server/test/selenium/test_system_has_user_can_loan.py8
-rw-r--r--Server/bkr/server/test/selenium/test_system_menu_tests.py2
-rw-r--r--Server/bkr/server/test/test_mail.py7
-rw-r--r--Server/bkr/server/widgets.py2
-rw-r--r--Tasks/distribution/beaker/dogfood/Makefile72
-rw-r--r--Tasks/distribution/beaker/dogfood/PURPOSE1
-rwxr-xr-xTasks/distribution/beaker/dogfood/runtest.sh22
-rwxr-xr-xTasks/distribution/beaker/setup/runtest.sh9
21 files changed, 187 insertions, 74 deletions
diff --git a/Server/bkr/server/test/__init__.py b/Server/bkr/server/test/__init__.py
index 4bfc8a2..149b743 100644
--- a/Server/bkr/server/test/__init__.py
+++ b/Server/bkr/server/test/__init__.py
@@ -16,8 +16,11 @@
# 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 logging
+from StringIO import StringIO
+import logging, logging.config
+import turbogears
from turbogears import update_config
from turbogears.database import session
import turbomail.adapters.tg1
@@ -25,16 +28,32 @@ from bkr.server.test import data_setup
log = logging.getLogger(__name__)
-CONFIG_FILE='test.cfg' #Fixme, get this from opts perhaps?
+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')
- data_setup.setup_model()
- data_setup.create_distro()
- data_setup.create_labcontroller() #always need a labcontroller
- session.flush()
+
+ # 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/)
+ stream_handler = logging.StreamHandler(sys.stdout)
+ stream_handler.setFormatter(logging.Formatter('%(asctime)s %(name)s %(levelname)s %(message)s'))
+ # XXX terrible hack, but there is no better way in Python 2.4 :-(
+ for logger in logging.Logger.manager.loggerDict.itervalues():
+ if getattr(logger, 'handlers', None):
+ logger.handlers = [stream_handler]
+
+ 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()
+
turbomail.adapters.tg1.start_extension()
def teardown_package():
diff --git a/Server/bkr/server/test/selenium/__init__.py b/Server/bkr/server/test/selenium/__init__.py
index 6f8b795..69ca7d7 100644
--- a/Server/bkr/server/test/selenium/__init__.py
+++ b/Server/bkr/server/test/selenium/__init__.py
@@ -26,6 +26,7 @@ import turbogears.config
from selenium import selenium
import unittest
import threading
+import bkr.server.test
from bkr.server.bexceptions import BX
log = logging.getLogger(__name__)
@@ -42,15 +43,14 @@ 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')))
+ bkr.server.test.get_server_base())
return cls.sel
@classmethod
def logout(cls):
sel = getattr(cls,'sel',None)
if sel is not None:
- sel.open("/")
+ sel.open("")
try:
sel.click("link=Logout")
except Exception, e:
@@ -67,7 +67,7 @@ class SeleniumTestCase(unittest.TestCase):
sel = getattr(cls,'sel',None)
if sel is not None:
- sel.open("/")
+ sel.open("")
try:
sel.click("link=Login")
except Exception, e:
@@ -109,10 +109,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:
@@ -176,10 +172,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 '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/test_add_group.py b/Server/bkr/server/test/selenium/test_add_group.py
index e3f87d7..d5b4340 100644
--- a/Server/bkr/server/test/selenium/test_add_group.py
+++ b/Server/bkr/server/test/selenium/test_add_group.py
@@ -14,10 +14,8 @@ class AddGroup(bkr.server.test.selenium.SeleniumTestCase):
def test_add_group(self):
sel = self.selenium
- sel.open("/")
- try:
- self.login()
- except:pass
+ sel.open("")
+ self.login()
sel.click("link=Groups")
sel.wait_for_page_to_load("3000")
sel.click("link=Add ( + )")
diff --git a/Server/bkr/server/test/selenium/test_add_system.py b/Server/bkr/server/test/selenium/test_add_system.py
index 5728812..650e488 100644
--- a/Server/bkr/server/test/selenium/test_add_system.py
+++ b/Server/bkr/server/test/selenium/test_add_system.py
@@ -6,6 +6,10 @@ from turbogears.database import session, get_engine
class AddSystem(bkr.server.test.selenium.SeleniumTestCase):
def setUp(self):
+ data_setup.create_labcontroller(fqdn=u'lab-devel.rhts.eng.bos.redhat.com')
+ data_setup.create_system(fqdn=u'preexisting-system')
+ session.flush()
+
try:
self.verificationErrors = []
self.selenium = self.get_selenium()
@@ -36,7 +40,7 @@ class AddSystem(bkr.server.test.selenium.SeleniumTestCase):
# type,private,shared,vendor,model,location,mac]
try:
sel = self.selenium
- sel.open("/")
+ sel.open("")
sel.wait_for_page_to_load("3000")
sel.click("//div[@id='fedora-content']/a")
sel.wait_for_page_to_load("3000")
@@ -73,7 +77,7 @@ class AddSystem(bkr.server.test.selenium.SeleniumTestCase):
# type,private,shared,vendor,model,location,mac]
try:
sel = self.selenium
- sel.open("/")
+ sel.open("")
sel.wait_for_page_to_load("3000")
sel.click("//div[@id='fedora-content']/a")
sel.wait_for_page_to_load("3000")
@@ -107,7 +111,7 @@ class AddSystem(bkr.server.test.selenium.SeleniumTestCase):
# type,private,shared,vendor,model,location,mac]
try:
sel = self.selenium
- sel.open("/")
+ sel.open("")
sel.wait_for_page_to_load("3000")
sel.click("//div[@id='fedora-content']/a")
sel.wait_for_page_to_load("3000")
@@ -140,7 +144,7 @@ class AddSystem(bkr.server.test.selenium.SeleniumTestCase):
# type,private,shared,vendor,model,location,mac]
try:
sel = self.selenium
- sel.open("/")
+ sel.open("")
sel.wait_for_page_to_load("3000")
sel.click("//div[@id='fedora-content']/a")
sel.wait_for_page_to_load("3000")
@@ -157,7 +161,7 @@ class AddSystem(bkr.server.test.selenium.SeleniumTestCase):
except Exception,e:self.verificationErrors.append(str(e))
def test_case_5(self):
- system_details = dict(fqdn = 'test_system_1', #should fail as system is already in db
+ system_details = dict(fqdn = 'preexisting-system', #should fail as system is already in db
lender = 'lender',
serial = '444g!!!444',
status = 'Broken',
@@ -174,18 +178,12 @@ class AddSystem(bkr.server.test.selenium.SeleniumTestCase):
# type,private,shared,vendor,model,location,mac]
try:
sel = self.selenium
- sel.open("/")
+ sel.open("")
sel.wait_for_page_to_load("3000")
sel.click("//div[@id='fedora-content']/a")
sel.wait_for_page_to_load("3000")
self.add_system(**system_details)
-
- for i in range(60):
- try:
- if sel.is_text_present("test_system_1 already exists!"): break
- except: pass
- time.sleep(1)
- else: self.fail("time out waiting for error message when adding existing system name")
+ self.assert_(sel.is_text_present("preexisting-system already exists!"))
except Exception,e:self.verificationErrors.append(str(e))
def check_db(self,fqdn):
diff --git a/Server/bkr/server/test/selenium/test_add_system_group.py b/Server/bkr/server/test/selenium/test_add_system_group.py
index f690889..f024e51 100644
--- a/Server/bkr/server/test/selenium/test_add_system_group.py
+++ b/Server/bkr/server/test/selenium/test_add_system_group.py
@@ -21,7 +21,7 @@ class AddSystemGroupTest(bkr.server.test.selenium.SeleniumTestCase):
# as admin, assign the system to our test group
self.login()
- sel.open("/view/%s" % self.system.fqdn)
+ sel.open("view/%s" % self.system.fqdn)
sel.click('//ul[@class="tabbernav"]//a[text()="Groups"]')
sel.type("groups_group_text", "%s" % self.group.group_name)
sel.click('link=Add ( + )')
diff --git a/Server/bkr/server/test/selenium/test_add_user.py b/Server/bkr/server/test/selenium/test_add_user.py
index f53a67d..b12646a 100644
--- a/Server/bkr/server/test/selenium/test_add_user.py
+++ b/Server/bkr/server/test/selenium/test_add_user.py
@@ -19,7 +19,7 @@ class AddUser(bkr.server.test.selenium.SeleniumTestCase):
def test_adduser(self):
sel = self.selenium
- sel.open("/")
+ sel.open("")
sel.click("link=Login")
sel.wait_for_page_to_load("3000")
sel.type("user_name", data_setup.ADMIN_USER)
@@ -40,7 +40,7 @@ class AddUser(bkr.server.test.selenium.SeleniumTestCase):
try: self.failUnless(sel.is_text_present("saved"))
except AssertionError, e: self.verificationErrors.append(str(e))
- sel.open("/users")
+ sel.open("users")
#Test that user 1 is listed as part of users
try: self.failUnless(sel.is_text_present("%s" % self.BEAKER_TEST_USER_1))
except AssertionError, e: self.verificationErrors.append(str(e))
@@ -57,7 +57,7 @@ class AddUser(bkr.server.test.selenium.SeleniumTestCase):
#Test Saved message came up
try: self.failUnless(sel.is_text_present("%s saved" % self.BEAKER_TEST_USER_2))
except AssertionError, e: self.verificationErrors.append(str(e))
- sel.open("/users")
+ sel.open("users")
#Test that user 2 is listed as part of users
try: self.failUnless(sel.is_text_present("%s" % self.BEAKER_TEST_USER_2))
except AssertionError, e: self.verificationErrors.append(str(e))
diff --git a/Server/bkr/server/test/selenium/test_add_user_to_group.py b/Server/bkr/server/test/selenium/test_add_user_to_group.py
index 64bf767..8a05d3c 100644
--- a/Server/bkr/server/test/selenium/test_add_user_to_group.py
+++ b/Server/bkr/server/test/selenium/test_add_user_to_group.py
@@ -17,14 +17,14 @@ class TestAddUserToGroup(bkr.server.test.selenium.SeleniumTestCase):
def test_add_user_to_admin_group(self):
sel = self.selenium
- sel.open("/")
+ sel.open("")
sel.click("link=Login")
sel.wait_for_page_to_load("3000")
sel.type("user_name", self.BEAKER_LOGIN_USER)
sel.type("password", self.BEAKER_LOGIN_PASSWORD)
sel.click("login")
sel.wait_for_page_to_load("3000")
- sel.open("/users/")
+ sel.open("users/")
sel.click("link=Groups")
sel.wait_for_page_to_load("3000")
sel.click("link=admin")
@@ -41,14 +41,14 @@ class TestAddUserToGroup(bkr.server.test.selenium.SeleniumTestCase):
def test_add_user_to_nonadmin_group(self):
sel = self.selenium
- sel.open("/")
+ sel.open("")
sel.click("link=Login")
sel.wait_for_page_to_load("3000")
sel.type("user_name", self.BEAKER_LOGIN_USER)
sel.type("password", self.BEAKER_LOGIN_PASSWORD)
sel.click("login")
sel.wait_for_page_to_load("3000")
- sel.open("/users/")
+ sel.open("users/")
sel.click("link=Groups")
sel.wait_for_page_to_load("3000")
sel.click("link=%s" % self.GROUP)
diff --git a/Server/bkr/server/test/selenium/test_import_keyvalue.py b/Server/bkr/server/test/selenium/test_import_keyvalue.py
index 71710f6..6c5d34f 100644
--- a/Server/bkr/server/test/selenium/test_import_keyvalue.py
+++ b/Server/bkr/server/test/selenium/test_import_keyvalue.py
@@ -13,7 +13,7 @@ class ImportKeyValue(bkr.server.test.selenium.SeleniumTestCase):
def test_keyvalue(self):
sel = self.selenium
- sel.open("/")
+ sel.open("")
try:
self.logout()
except: pass
diff --git a/Server/bkr/server/test/selenium/test_item_count.py b/Server/bkr/server/test/selenium/test_item_count.py
index a64b42d..30f5e8c 100644
--- a/Server/bkr/server/test/selenium/test_item_count.py
+++ b/Server/bkr/server/test/selenium/test_item_count.py
@@ -20,7 +20,7 @@ class ItemCount(bkr.server.test.selenium.SeleniumTestCase):
def test_itemcount(self):
sel = self.selenium
- sel.open("/")
+ sel.open("")
self.login()
sel.click("link=All")
sel.wait_for_page_to_load("3000")
diff --git a/Server/bkr/server/test/selenium/test_my_menu_tests.py b/Server/bkr/server/test/selenium/test_my_menu_tests.py
index ea25b91..b77912b 100644
--- a/Server/bkr/server/test/selenium/test_my_menu_tests.py
+++ b/Server/bkr/server/test/selenium/test_my_menu_tests.py
@@ -17,7 +17,7 @@ class Menu(bkr.server.test.selenium.SeleniumTestCase):
def test_my_menu(self):
sel = self.selenium
try:
- sel.open("/")
+ sel.open("")
sel.click("link=My Jobs")
sel.wait_for_page_to_load("3000")
sel.click("link=My Recipes")
diff --git a/Server/bkr/server/test/selenium/test_report_problem.py b/Server/bkr/server/test/selenium/test_report_problem.py
index 0804802..5330b77 100644
--- a/Server/bkr/server/test/selenium/test_report_problem.py
+++ b/Server/bkr/server/test/selenium/test_report_problem.py
@@ -23,7 +23,7 @@ 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
+from bkr.server.test import data_setup, get_server_base
class TestReportProblem(SeleniumTestCase):
@@ -71,10 +71,11 @@ class TestReportProblem(SeleniumTestCase):
self.assertEqual(msg['X-Beaker-System'], 'ncc1701d')
self.assertEqual(msg.get_payload(),
'A Beaker user has reported a problem with system \n'
- 'ncc1701d <http://localhost:9090/view/ncc1701d>.\n\n'
+ 'ncc1701d <%sview/ncc1701d>.\n\n'
'Reported by: Beverley Crusher\n\n'
'Problem description:\n'
- 'Make it so!')
+ 'Make it so!'
+ % get_server_base())
def test_reporting_problem_requires_login(self):
system = data_setup.create_system()
diff --git a/Server/bkr/server/test/selenium/test_reserve_system.py b/Server/bkr/server/test/selenium/test_reserve_system.py
index 04ba046..fc76586 100644
--- a/Server/bkr/server/test/selenium/test_reserve_system.py
+++ b/Server/bkr/server/test/selenium/test_reserve_system.py
@@ -10,8 +10,8 @@ class ReserveSystem(bkr.server.test.selenium.SeleniumTestCase):
self.selenium = self.get_selenium()
self.selenium.start()
self.lc = data_setup.create_labcontroller()
- self.system = data_setup.create_system(fqdn=u'test_reserve_system',arch=u'i386')
- self.distro = data_setup.create_distro(name=u'test_reserve_system_distro')
+ self.system = data_setup.create_system(arch=u'i386')
+ self.distro = data_setup.create_distro(name=u'test_reserve_system_distro', arch=u'i386')
data_setup.create_task(name=u'/distribution/install')
data_setup.create_task(name=u'/distribution/reservesys')
self.system.lab_controller = self.lc
@@ -19,19 +19,19 @@ class ReserveSystem(bkr.server.test.selenium.SeleniumTestCase):
session.flush()
def test_by_distro(self):
- try:
- self.logout()
- except: pass
self.login()
sel = self.selenium
- sel.open("/distros/")
+ sel.open("distros/")
sel.type("simplesearch", "%s" % self.distro.name)
sel.click("search")
sel.wait_for_page_to_load("3000")
sel.click("link=Pick System")
sel.wait_for_page_to_load("3000")
self.failUnless(sel.is_text_present("%s" % self.system.fqdn))
- sel.click("link=Reserve Now")
+ # click Reserve Now link in the same row as the system we created in setUp
+ sel.click('//table[@id="widget"]//td[a/text()="Reserve Now" '
+ 'and preceding-sibling::td[7]/a/text() = "%s"]/a'
+ % self.system.fqdn)
sel.wait_for_page_to_load("30000")
sel.type("form_whiteboard", "testing")
sel.type("form_whiteboard", "test_reserve_system_distro")
diff --git a/Server/bkr/server/test/selenium/test_system_group_user_take.py b/Server/bkr/server/test/selenium/test_system_group_user_take.py
index f0c3051..2192392 100644
--- a/Server/bkr/server/test/selenium/test_system_group_user_take.py
+++ b/Server/bkr/server/test/selenium/test_system_group_user_take.py
@@ -67,7 +67,7 @@ class SystemGroupUserTake(bkr.server.test.selenium.SeleniumTestCase):
#Auto Machine
session.flush()
sel = self.selenium
- sel.open("/")
+ sel.open("")
sel.type("simplesearch", "%s" % self.automated_system.fqdn)
sel.click("search")
sel.wait_for_page_to_load("30000")
@@ -78,7 +78,7 @@ class SystemGroupUserTake(bkr.server.test.selenium.SeleniumTestCase):
#Manual machine
#import pdb;pdb.set_trace()
- sel.open("/")
+ sel.open("")
sel.type("simplesearch", "%s" % self.manual_system.fqdn)
sel.click("search")
sel.wait_for_page_to_load("30000")
@@ -93,7 +93,7 @@ class SystemGroupUserTake(bkr.server.test.selenium.SeleniumTestCase):
data_setup.add_group_to_system(self.automated_system,self.group) # Add systemgroup
session.flush()
sel = self.selenium
- sel.open("/")
+ sel.open("")
sel.type("simplesearch", "%s" % self.automated_system.fqdn)
sel.click("search")
sel.wait_for_page_to_load("30000")
@@ -113,7 +113,7 @@ class SystemGroupUserTake(bkr.server.test.selenium.SeleniumTestCase):
data_setup.add_group_to_system(self.manual_system, self.group) # Add systemgroup
session.flush()
sel = self.selenium
- sel.open("/")
+ sel.open("")
sel.type("simplesearch", "%s" % self.manual_system.fqdn)
sel.click("search")
sel.wait_for_page_to_load("30000")
@@ -136,7 +136,7 @@ class SystemGroupUserTake(bkr.server.test.selenium.SeleniumTestCase):
data_setup.add_user_to_group(self.user,self.group) # Add user to group
session.flush()
sel = self.selenium
- sel.open("/")
+ sel.open("")
sel.type("simplesearch", "%s" % self.automated_system.fqdn)
sel.click("search")
sel.wait_for_page_to_load("30000")
@@ -151,7 +151,7 @@ class SystemGroupUserTake(bkr.server.test.selenium.SeleniumTestCase):
data_setup.add_group_to_system(self.manual_system, self.group) # Add systemgroup
session.flush()
sel = self.selenium
- sel.open("/")
+ sel.open("")
sel.type("simplesearch", "%s" % self.manual_system.fqdn)
sel.click("search")
sel.wait_for_page_to_load("30000")
diff --git a/Server/bkr/server/test/selenium/test_system_has_user_can_loan.py b/Server/bkr/server/test/selenium/test_system_has_user_can_loan.py
index 6bae32a..7c6b4fe 100644
--- a/Server/bkr/server/test/selenium/test_system_has_user_can_loan.py
+++ b/Server/bkr/server/test/selenium/test_system_has_user_can_loan.py
@@ -6,7 +6,6 @@ from turbogears.database import session
class SystemHasUserCanLoan(bkr.server.test.selenium.SeleniumTestCase):
def setUp(self):
- self.verificationErrors = []
self.selenium = self.get_selenium()
self.selenium.start()
self.user = data_setup.create_user()
@@ -14,14 +13,13 @@ class SystemHasUserCanLoan(bkr.server.test.selenium.SeleniumTestCase):
self.system.user = self.user
session.flush()
+ def tearDown(self):
+ self.selenium.stop()
def test_can_loan(self):
- try:
- self.logout()
- except: pass
self.login()
sel = self.selenium
- sel.open('/view/%s' % self.system.fqdn)
+ sel.open('view/%s' % self.system.fqdn)
sel.wait_for_page_to_load("30000")
# This is the (Loan) link...
diff --git a/Server/bkr/server/test/selenium/test_system_menu_tests.py b/Server/bkr/server/test/selenium/test_system_menu_tests.py
index df85512..4c2e158 100644
--- a/Server/bkr/server/test/selenium/test_system_menu_tests.py
+++ b/Server/bkr/server/test/selenium/test_system_menu_tests.py
@@ -24,7 +24,7 @@ class Menu(bkr.server.test.selenium.SeleniumTestCase):
def test_menulist(self):
sel = self.selenium
- sel.open("/")
+ sel.open("")
sel.click("link=All")
sel.wait_for_page_to_load("3000")
sel.click("link=My Systems")
diff --git a/Server/bkr/server/test/test_mail.py b/Server/bkr/server/test/test_mail.py
index d4c7932..1ed13ff 100644
--- a/Server/bkr/server/test/test_mail.py
+++ b/Server/bkr/server/test/test_mail.py
@@ -20,7 +20,7 @@ import sys
import email
import unittest
from turbogears.database import session
-from bkr.server.test import data_setup, mail_capture
+from bkr.server.test import data_setup, mail_capture, get_server_base
import bkr.server.mail
class MailTest(unittest.TestCase):
@@ -51,10 +51,11 @@ class MailTest(unittest.TestCase):
self.assertEqual(msg['X-Beaker-System'], 'home-one')
self.assertEqual(msg.get_payload(),
'Beaker has automatically marked system \n'
- 'home-one <http://localhost:9090/view/home-one> \n'
+ 'home-one <%sview/home-one> \n'
'as broken, due to:\n\n'
'It\'s a tarp!\n\n'
'Please investigate this error and take appropriate action.\n\n'
'Power type: drac\n'
'Power address: pdu2.home-one\n'
- 'Power id: 42')
+ 'Power id: 42'
+ % get_server_base())
diff --git a/Server/bkr/server/widgets.py b/Server/bkr/server/widgets.py
index 60dec2b..fa72688 100644
--- a/Server/bkr/server/widgets.py
+++ b/Server/bkr/server/widgets.py
@@ -1193,7 +1193,7 @@ class SystemForm(Form):
TextArea(name='status_reason', label=_(u'Condition Report'),attrs={'rows':3,'cols':27},validator=validators.MaxLength(255)),
SingleSelectField(name='lab_controller_id',
label=_(u'Lab Controller'),
- options=[(0,"None")] + model.LabController.get_all()),
+ options=lambda: [(0,"None")] + model.LabController.get_all()),
TextField(name='vendor', label=_(u'Vendor')),
TextField(name='model', label=_(u'Model')),
TextField(name='date_added', label=_(u'Date Created')),
diff --git a/Tasks/distribution/beaker/dogfood/Makefile b/Tasks/distribution/beaker/dogfood/Makefile
new file mode 100644
index 0000000..81a956d
--- /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
+
+run: $(FILES) build \
+ /usr/lib/python2.4/site-packages/selenium-2.0a5-py2.4.egg \
+ /usr/local/share/selenium/selenium-server-1.0.3
+ ./runtest.sh
+
+build: $(BUILT_FILES)
+ chmod a+x ./runtest.sh
+
+download: $(DOWNLOADED_FILES)
+
+selenium-remote-control-1.0.3.zip:
+ wget -nv http://selenium.googlecode.com/files/$@
+
+clean:
+ rm -f *~ *.rpm $(BUILT_FILES) $(DOWNLOADED_FILES)
+
+/usr/local/share/selenium/selenium-server-1.0.3: selenium-remote-control-1.0.3.zip
+ unzip -o -d /usr/local/share/selenium $<
+
+/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..01a9fde
--- /dev/null
+++ b/Tasks/distribution/beaker/dogfood/runtest.sh
@@ -0,0 +1,22 @@
+#!/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 BEAKER_SERVER_BASE_URL="http://localhost/bkr/"
+export BEAKER_SKIP_INIT_DB=1
+export BEAKER_CONFIG_FILE=/etc/beaker/server.cfg
+
+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 796d0a6..a7d61ee 100755
--- a/Tasks/distribution/beaker/setup/runtest.sh
+++ b/Tasks/distribution/beaker/setup/runtest.sh
@@ -191,13 +191,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
@@ -212,6 +212,9 @@ identity.krb_auth_keytab='/etc/httpd/conf/httpd.keytab'
# SERVER
+tg.url_domain='localhost'
+tg.url_scheme='http'
+
server.socket_port=8084
server.environment="development"
server.webpath="/bkr/"