rhmessaging commits: r1679 - store/trunk/cpp.
by rhmessaging-commits@lists.jboss.org
Author: nunofsantos
Date: 2008-02-11 13:58:09 -0500 (Mon, 11 Feb 2008)
New Revision: 1679
Modified:
store/trunk/cpp/mrg-grid.spec
store/trunk/cpp/mrg-messaging.spec
store/trunk/cpp/mrg.spec
Log:
fix dates in changelog
Modified: store/trunk/cpp/mrg-grid.spec
===================================================================
--- store/trunk/cpp/mrg-grid.spec 2008-02-11 17:56:31 UTC (rev 1678)
+++ store/trunk/cpp/mrg-grid.spec 2008-02-11 18:58:09 UTC (rev 1679)
@@ -29,7 +29,7 @@
%changelog
-* Mon Feb 11 2007 Rafael Schloming <rafaels(a)redhat.com> - 1.0-4
+* Mon Feb 11 2008 Rafael Schloming <rafaels(a)redhat.com> - 1.0-4
- Bumped for Beta 3 update
* Wed Nov 28 2007 Nuno Santos <nsantos(a)redhat.com> - 1.0-1
Modified: store/trunk/cpp/mrg-messaging.spec
===================================================================
--- store/trunk/cpp/mrg-messaging.spec 2008-02-11 17:56:31 UTC (rev 1678)
+++ store/trunk/cpp/mrg-messaging.spec 2008-02-11 18:58:09 UTC (rev 1679)
@@ -33,7 +33,7 @@
%changelog
-* Mon Feb 11 2007 Rafael Schloming <rafaels(a)redhat.com> - 1.0-5
+* Mon Feb 11 2008 Rafael Schloming <rafaels(a)redhat.com> - 1.0-5
- Bumped for Beta 3 update
* Wed Jan 23 2008 Nuno Santos <nsantos(a)redhat.com> - 1.0-4
Modified: store/trunk/cpp/mrg.spec
===================================================================
--- store/trunk/cpp/mrg.spec 2008-02-11 17:56:31 UTC (rev 1678)
+++ store/trunk/cpp/mrg.spec 2008-02-11 18:58:09 UTC (rev 1679)
@@ -31,7 +31,7 @@
%changelog
-* Mon Feb 11 2007 Rafael Schloming <rafaels(a)redhat.com> - 1.0-4
+* Mon Feb 11 2008 Rafael Schloming <rafaels(a)redhat.com> - 1.0-4
- Bumped for Beta 3 update
* Wed Nov 28 2007 Nuno Santos <nsantos(a)redhat.com> - 1.0-1
18 years, 2 months
rhmessaging commits: r1678 - mgmt/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2008-02-11 12:56:31 -0500 (Mon, 11 Feb 2008)
New Revision: 1678
Modified:
mgmt/cumin/python/cumin/broker.strings
Log:
Disables some unused code.
Modified: mgmt/cumin/python/cumin/broker.strings
===================================================================
--- mgmt/cumin/python/cumin/broker.strings 2008-02-11 17:37:59 UTC (rev 1677)
+++ mgmt/cumin/python/cumin/broker.strings 2008-02-11 17:56:31 UTC (rev 1678)
@@ -138,10 +138,6 @@
<table class="props">
<tr><th>Address</th><td>{address}</td></tr>
-<!--
- <tr><th>Cluster</th><td>{cluster_link}</td></tr>
- <tr><th>Profile</th><td>{profile_link}</td></tr>
--->
<tr><th>Groups</th><td>{group_links}</td></tr>
<tr>
<th class="actions" colspan="2">
@@ -185,15 +181,7 @@
<h2>Filter by Group</h2>
<ul class="slist">{group_filters}</ul>
-
-<!--
- <h2>Filter by Profile</h2>
- <ul class="slist">{profile_filters}</ul>
-
- <h2>Filter by Cluster</h2>
- <ul class="slist">{cluster_filters}</ul>
</td>
--->
<td class="view">
<ul class="actions">
<li><a class="nav" href="{add_broker_href}">Register New Brokers</a></li>
18 years, 2 months
rhmessaging commits: r1677 - store/trunk/cpp.
by rhmessaging-commits@lists.jboss.org
Author: nunofsantos
Date: 2008-02-11 12:37:59 -0500 (Mon, 11 Feb 2008)
New Revision: 1677
Modified:
store/trunk/cpp/mrg-grid.spec
store/trunk/cpp/mrg-messaging.spec
store/trunk/cpp/mrg.spec
store/trunk/cpp/rhm.spec.in
Log:
bumped for beta 3 update
Modified: store/trunk/cpp/mrg-grid.spec
===================================================================
--- store/trunk/cpp/mrg-grid.spec 2008-02-11 17:33:12 UTC (rev 1676)
+++ store/trunk/cpp/mrg-grid.spec 2008-02-11 17:37:59 UTC (rev 1677)
@@ -1,7 +1,7 @@
Summary: MRG - Grid component
Name: mrg-grid
Version: 1.0
-Release: 1%{?dist}
+Release: 4%{?dist}
License: LGPL
Group: System Environment/Libraries
URL: http://redhat.com/mrg
@@ -9,6 +9,7 @@
BuildArch: noarch
Requires: condor
+Requires: mrg-grid-docs
%description
This is the top-level package that includes the MRG Grid component.
@@ -28,6 +29,9 @@
%changelog
+* Mon Feb 11 2007 Rafael Schloming <rafaels(a)redhat.com> - 1.0-4
+- Bumped for Beta 3 update
+
* Wed Nov 28 2007 Nuno Santos <nsantos(a)redhat.com> - 1.0-1
- Initial build.
Modified: store/trunk/cpp/mrg-messaging.spec
===================================================================
--- store/trunk/cpp/mrg-messaging.spec 2008-02-11 17:33:12 UTC (rev 1676)
+++ store/trunk/cpp/mrg-messaging.spec 2008-02-11 17:37:59 UTC (rev 1677)
@@ -1,7 +1,7 @@
Summary: MRG - Messaging component
Name: mrg-messaging
Version: 1.0
-Release: 4%{?dist}
+Release: 5%{?dist}
License: LGPL
Group: System Environment/Libraries
URL: http://redhat.com/mrg
@@ -33,6 +33,9 @@
%changelog
+* Mon Feb 11 2007 Rafael Schloming <rafaels(a)redhat.com> - 1.0-5
+- Bumped for Beta 3 update
+
* Wed Jan 23 2008 Nuno Santos <nsantos(a)redhat.com> - 1.0-4
- Added dependencies for -devel packages, so that examples work
as per the tutorial
Modified: store/trunk/cpp/mrg.spec
===================================================================
--- store/trunk/cpp/mrg.spec 2008-02-11 17:33:12 UTC (rev 1676)
+++ store/trunk/cpp/mrg.spec 2008-02-11 17:37:59 UTC (rev 1677)
@@ -1,7 +1,7 @@
Summary: MRG - Messaging, Real-Time, and Grid components
Name: mrg
Version: 1.0
-Release: 1%{?dist}
+Release: 4%{?dist}
License: LGPL
Group: System Environment/Libraries
URL: http://redhat.com/mrg
@@ -31,6 +31,9 @@
%changelog
+* Mon Feb 11 2007 Rafael Schloming <rafaels(a)redhat.com> - 1.0-4
+- Bumped for Beta 3 update
+
* Wed Nov 28 2007 Nuno Santos <nsantos(a)redhat.com> - 1.0-1
- Initial build.
Modified: store/trunk/cpp/rhm.spec.in
===================================================================
--- store/trunk/cpp/rhm.spec.in 2008-02-11 17:33:12 UTC (rev 1676)
+++ store/trunk/cpp/rhm.spec.in 2008-02-11 17:37:59 UTC (rev 1677)
@@ -3,7 +3,7 @@
#
Name: rhm
Version: @VERSION@
-Release: 14%{?dist}
+Release: 15%{?dist}
Summary: Red Hat extensions to the Qpid messaging system
Group: System Environment/Libraries
License: LGPL
@@ -86,6 +86,9 @@
%changelog
+* Mon Feb 11 2007 Rafael Schloming <rafaels(a)redhat.com> - 0.2-15
+- Bumped for Beta 3 update
+
* Tue Jan 22 2008 Nuno Santos <nsantos(a)redhat.com> - 0.2-14
- fix syntax in configuration file
18 years, 2 months
rhmessaging commits: r1676 - mgmt.
by rhmessaging-commits@lists.jboss.org
Author: nunofsantos
Date: 2008-02-11 12:33:12 -0500 (Mon, 11 Feb 2008)
New Revision: 1676
Modified:
mgmt/cumin.spec
Log:
bumped for Beta 3 update
Modified: mgmt/cumin.spec
===================================================================
--- mgmt/cumin.spec 2008-02-11 14:15:30 UTC (rev 1675)
+++ mgmt/cumin.spec 2008-02-11 17:33:12 UTC (rev 1676)
@@ -1,7 +1,7 @@
Summary: management component of MRG
Name: cumin
Version: 0.1
-Release: 1%{?dist}
+Release: 4%{?dist}
License: LGPL
Group: System Environment/Libraries
URL: http://redhat.com/mrg
@@ -17,6 +17,7 @@
Requires: python >= 2.4
Requires: postgresql >= 8.1.9
+Requires: postgresql-server >= 8.1.9
Requires: python-sqlobject >= 0.9.2
Requires: python-psycopg2 >= 2.0.6
Requires: python-qpid
@@ -78,6 +79,16 @@
%{python_sitelib}/wooly
%changelog
+* Mon Feb 11 2008 Rafael Schloming <rafaels(a)redhat.com> - 0.1-4
+- Bumped for Beta 3 update
+
+* Fri Jan 25 2008 Nuno Santos <nsantos(a)redhat.com> - 0.1-3
+- Workaround to fix charts issue
+
+* Thu Jan 24 2008 Nuno Santos <nsantos(a)redhat.com> - 0.1-2
+- Fix data url in /etc/cumin.conf; work around query divide-by-zero issues
+- Add dependency on postgresql-server
+
* Fri Jan 18 2008 Nuno Santos <nsantos(a)redhat.com> - 0.1-1
- Initial build.
18 years, 2 months
rhmessaging commits: r1675 - in mgmt/cumin: python/cumin and 1 other directory.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2008-02-11 09:15:30 -0500 (Mon, 11 Feb 2008)
New Revision: 1675
Modified:
mgmt/cumin/bin/cumin-test
mgmt/cumin/python/cumin/test.py
Log:
Adds a number of tests.
Improves test result reporting.
Modified: mgmt/cumin/bin/cumin-test
===================================================================
--- mgmt/cumin/bin/cumin-test 2008-02-11 14:14:08 UTC (rev 1674)
+++ mgmt/cumin/bin/cumin-test 2008-02-11 14:15:30 UTC (rev 1675)
@@ -39,10 +39,7 @@
env = TestEnvironment(app, broker_host, broker_port)
env.init();
- main = MainTest(env)
-
- session = TestSession(env)
- main.run(session)
+ session = env.run_test(MainTest(env))
session.report(sys.stdout)
def main():
Modified: mgmt/cumin/python/cumin/test.py
===================================================================
--- mgmt/cumin/python/cumin/test.py 2008-02-11 14:14:08 UTC (rev 1674)
+++ mgmt/cumin/python/cumin/test.py 2008-02-11 14:15:30 UTC (rev 1675)
@@ -1,9 +1,8 @@
import sys, os
from mint import *
-from traceback import print_exc
+from traceback import print_exc, extract_tb
from datetime import datetime
-from wooly import Session
-import qpid, quirk
+import qpid, quirk, wooly
from cumin import Cumin
from util import *
@@ -35,59 +34,90 @@
finally:
session.close()
+ def run_test(self, test):
+ session = TestSession(self)
+ test.run(session)
+ return session
+
+ def page_and_session(self, page=None):
+ if page is None:
+ page = self.app.main_page
+
+ s = wooly.Session(self.app)
+ s.set_page(page)
+
+ return page, s
+
class TestSession(object):
def __init__(self, env):
self.env = env
+ self.id = datetime.now().strftime("test-%Y-%m-%d-%H-%M-%S")
- self.successes = list()
- self.failures = list()
+ self.stack = list()
+ self.passed = list()
+ self.failed = list()
- def add_success(self, test, message, exception):
- result = TestResult(test, message, exception)
- self.successes.append(result)
+ def report(self, out):
+ out.write("Tests:")
+ out.write(os.linesep)
- def add_failure(self, test, message, exception):
- if exception:
- print_exc()
+ self.stack[0].report(sys.stdout, 1)
- result = TestResult(test, message, exception)
- self.failures.append(result)
+ out.write("Failures:")
+ out.write(os.linesep)
- def report(self, out):
- out.write("Succcesses (%i)\n" % len(self.successes))
+ if self.failed:
+ for call in self.failed:
+ out.write(" %s: %s" % \
+ (call.test.path(), call.exception.message))
+ out.write(os.linesep)
- for success in self.successes:
- out.write(" %s\n" % success)
+ for spec in extract_tb(call.traceback):
+ file, line, func, text = spec
+ out.write(" File \"%s\", line %i, in %s" % spec[:3])
+ out.write(os.linesep)
+ out.write(" %s" % spec[3])
+ out.write(os.linesep)
+ else:
+ out.write(" None")
+ out.write(os.linesep)
- out.write("Failures (%i)\n" % len(self.failures))
+ out.write("Summary:")
+ out.write(os.linesep)
- for failure in self.failures:
- out.write(" %s\n" % failure)
+ passed, failed = len(self.passed), len(self.failed)
+ out.write(" %i passed, %i failed" % (passed, failed))
+ out.write(os.linesep)
-class TestResult(object):
- def __init__(self, test, message, exception):
- self.test = test
- self.message = message
- self.exception = exception
-
- def __repr__(self):
- return "%s: %s" % (self.test, self.message)
-
class Test(object):
def __init__(self, env, parent):
self.env = env
+ self.name = self.__class__.__name__
self.parent = parent
self.children = list()
-
+
if parent:
self.parent.children.append(self)
+ def path(self):
+ if self.parent is None:
+ return self.name
+ else:
+ return self.parent.path() + "/" + self.name
+
def run(self, session):
+ call = TestCall(session, self)
+ call.open()
try:
- self.do_run(session)
- session.add_success(self, "OK", None)
- except Exception, e:
- session.add_failure(self, e.message, e)
+ try:
+ self.do_run(session)
+ session.passed.append(call)
+ except Exception, e:
+ call.exception = e
+ call.traceback = sys.exc_info()[2]
+ session.failed.append(call)
+ finally:
+ call.close()
def do_run(self, session):
self.run_children(session)
@@ -99,59 +129,173 @@
def __repr__(self):
return self.__class__.__name__
+class TestCall(object):
+ def __init__(self, session, test):
+ self.session = session
+ self.test = test
+ self.exception = None
+ self.traceback = None
+
+ self.caller = None
+ self.callees = list()
+
+ self.start = None
+ self.end = None
+
+ def open(self):
+ if self.session.stack:
+ self.caller = self.session.stack[-1]
+ self.caller.callees.append(self)
+
+ self.session.stack.append(self)
+
+ self.start = time.clock()
+
+ def close(self):
+ self.end = time.clock()
+
+ if len(self.session.stack) > 1:
+ self.session.stack.pop()
+
+ def report(self, writer, depth):
+ entry = (" " * depth) + str(self.test)
+ status = self.exception and self.exception.message or "-"
+
+ writer.write("%-40s %s" % (entry, status))
+ writer.write(os.linesep)
+
+ for call in self.callees:
+ call.report(writer, depth + 1)
+
class MainTest(Test):
def __init__(self, env):
super(MainTest, self).__init__(env, None)
BrokerRegistrationTest(env, self)
+ BrokerGroupTest(env, self)
class BrokerRegistrationTest(Test):
def __init__(self, env, parent):
super(BrokerRegistrationTest, self).__init__(env, parent)
BrokerTest(env, self)
+ self.AddToGroup(env, self)
+ self.Remove(env, self)
def do_run(self, session):
- app = self.env.app
- page = app.main_page
+ p, s = self.env.page_and_session()
- s = Session(app)
- s.set_page(page)
+ form = p.show_main(s).show_brokers_add(s)
- # navigate from ui top to broker set add
-
- form = page.show_main(s).show_brokers_add(s)
-
- name = "test-" + datetime.now().strftime("%Y-%m-%d-%H-%M")
-
- form.names.get(s).append(name)
+ form.names.get(s).append(session.id)
addr = "%s:%s" % \
(self.env.broker_client.host, self.env.broker_client.port)
form.addrs.get(s).append(addr)
form.groups.get(s).append(None)
form.submit.set(s, True)
- page.process(s, None)
+ p.process(s, None)
- redirect = page.get_redirect_url(s)
+ redirect = p.get_redirect_url(s)
if redirect:
- s = Session(app)
+ p, s = self.env.page_and_session()
s.unmarshal(redirect)
+ else:
+ raise Exception("Expected redirect")
- page.process(s, None)
+ p.process(s, None)
+ p.render(s, None)
- html = page.render(s, None)
+ self.env.broker_registration = BrokerRegistration.selectBy \
+ (name=session.id)[0]
- #file = open("BrokerTest.%s.html" % name, "w")
- #file.write(html)
- #file.close()
+ self.run_children(session)
- self.env.broker_registration = BrokerRegistration.selectBy \
- (name=name)[0]
+ class AddToGroup(Test):
+ def do_run(self, session):
+ group = BrokerGroup(name="test-group")
+ group.sync()
+ p, s = self.env.page_and_session()
+
+ raise Exception("Not implemented")
+
+ class Remove(Test):
+ def do_run(self, session):
+ raise Exception("Not implemented")
+
+class BrokerGroupTest(Test):
+ def __init__(self, env, parent):
+ super(BrokerGroupTest, self).__init__(env, parent)
+
+ self.Edit(env, self)
+ self.Remove(env, self)
+
+ def do_run(self, session):
+ p, s = self.env.page_and_session()
+
+ form = p.show_main(s).show_broker_group(s, None).show_add(s)
+ form.group_name.set(s, session.id)
+ form.submit.set(s, True)
+
+ p.process(s, None)
+
+ redirect = p.get_redirect_url(s)
+
+ if redirect:
+ p, s = self.env.page_and_session()
+ s.unmarshal(redirect)
+ else:
+ raise Exception("Expected redirect")
+
+ p.process(s, None)
+ p.render(s, None)
+
+ try:
+ self.env.broker_group = BrokerGroup.selectBy(name=session.id)[0]
+ except IndexError:
+ raise Exception("Broker group not found")
+
self.run_children(session)
+ class Edit(Test):
+ def do_run(self, session):
+ p, s = self.env.page_and_session()
+ group = self.env.broker_group
+
+ form = p.show_main(s).show_broker_group(s, group).show_edit(s)
+ form.group_name.set(s, session.id + "%;&#\\")
+ form.submit.set(s, True)
+
+ p.process(s, None)
+
+ redirect = p.get_redirect_url(s)
+
+ if redirect:
+ p, s = self.env.page_and_session()
+ s.unmarshal(redirect)
+ else:
+ raise Exception("Expected redirect")
+
+ class Remove(Test):
+ def do_run(self, session):
+ p, s = self.env.page_and_session()
+ group = self.env.broker_group
+
+ form = p.show_main(s).show_broker_group(s, group).show_remove(s)
+ form.submit.set(s, True)
+
+ p.process(s, None)
+
+ redirect = p.get_redirect_url(s)
+
+ if redirect:
+ p, s = self.env.page_and_session()
+ s.unmarshal(redirect)
+ else:
+ raise Exception("Expected redirect")
+
class BrokerTest(Test):
def __init__(self, env, parent):
super(BrokerTest, self).__init__(env, parent)
@@ -216,6 +360,8 @@
class ClientTest(Test):
def do_run(self, session):
+ raise Exception("Not implemented")
+
vhost = self.env.vhost
address = self.env.broker_client.host + ":" + \
str(self.env.broker_client.port)
18 years, 2 months
rhmessaging commits: r1674 - mgmt/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2008-02-11 09:14:08 -0500 (Mon, 11 Feb 2008)
New Revision: 1674
Modified:
mgmt/cumin/python/cumin/__init__.py
Log:
Add a comment to remind me to fix exception display.
Modified: mgmt/cumin/python/cumin/__init__.py
===================================================================
--- mgmt/cumin/python/cumin/__init__.py 2008-02-11 14:13:02 UTC (rev 1673)
+++ mgmt/cumin/python/cumin/__init__.py 2008-02-11 14:14:08 UTC (rev 1674)
@@ -76,6 +76,7 @@
try:
self.do_run()
except Exception, e:
+ # XXX add print_exc
print e
def do_run(self):
18 years, 2 months
rhmessaging commits: r1673 - mgmt/cumin/python/wooly.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2008-02-11 09:13:02 -0500 (Mon, 11 Feb 2008)
New Revision: 1673
Modified:
mgmt/cumin/python/wooly/__init__.py
Log:
Comment out a print debug.
Modified: mgmt/cumin/python/wooly/__init__.py
===================================================================
--- mgmt/cumin/python/wooly/__init__.py 2008-02-09 19:32:24 UTC (rev 1672)
+++ mgmt/cumin/python/wooly/__init__.py 2008-02-11 14:13:02 UTC (rev 1673)
@@ -392,7 +392,7 @@
def pop_current_frame(self, session):
frame = self.get_current_frame(session)
- print "Popping current frame", frame
+ #print "Popping current frame", frame
return self.set_current_frame(session, frame.frame())
18 years, 2 months
rhmessaging commits: r1672 - mgmt/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2008-02-09 14:32:24 -0500 (Sat, 09 Feb 2008)
New Revision: 1672
Modified:
mgmt/cumin/python/cumin/test.py
Log:
Adds more tests to the suite.
Modified: mgmt/cumin/python/cumin/test.py
===================================================================
--- mgmt/cumin/python/cumin/test.py 2008-02-09 18:12:22 UTC (rev 1671)
+++ mgmt/cumin/python/cumin/test.py 2008-02-09 19:32:24 UTC (rev 1672)
@@ -17,7 +17,9 @@
self.broker_queue = quirk.Queue("cumin.queue")
self.broker_exchange = quirk.Exchange("cumin.exchange")
+ self.broker_registration = None
self.broker = None
+ self.vhost = None
self.queue = None
self.exchange = None
@@ -101,13 +103,13 @@
def __init__(self, env):
super(MainTest, self).__init__(env, None)
- BrokerTest(env, self)
+ BrokerRegistrationTest(env, self)
-class BrokerTest(Test):
+class BrokerRegistrationTest(Test):
def __init__(self, env, parent):
- super(BrokerTest, self).__init__(env, parent)
+ super(BrokerRegistrationTest, self).__init__(env, parent)
- QueueTest(env, self)
+ BrokerTest(env, self)
def do_run(self, session):
app = self.env.app
@@ -145,15 +147,34 @@
#file.write(html)
#file.close()
- reg = BrokerRegistration.selectBy(name=name)[0]
+ self.env.broker_registration = BrokerRegistration.selectBy \
+ (name=name)[0]
+ self.run_children(session)
+
+class BrokerTest(Test):
+ def __init__(self, env, parent):
+ super(BrokerTest, self).__init__(env, parent)
+
+ VhostTest(env, self)
+
+ def do_run(self, session):
+ reg = self.env.broker_registration
+
wait(lambda: reg.broker)
self.env.broker = reg.broker
-
+
self.run_children(session)
-class QueueTest(Test):
+class VhostTest(Test):
+ def __init__(self, env, parent):
+ super(VhostTest, self).__init__(env, parent)
+
+ QueueTest(env, self)
+ ExchangeTest(env, self)
+ ClientTest(env, self)
+
def do_run(self, session):
def predicate():
for item in Vhost.selectBy(broker=self.env.broker, name="/"):
@@ -161,12 +182,50 @@
wait(predicate)
- vhost = Vhost.selectBy(broker=self.env.broker, name="/")[0]
+ self.env.vhost = Vhost.selectBy(broker=self.env.broker, name="/")[0]
+
+ self.run_children(session)
+
+class QueueTest(Test):
+ def do_run(self, session):
+ vhost = self.env.vhost
name = self.env.broker_queue.name
- self.queue = Queue.selectBy(vhost=vhost, name=name)[0]
- print self.queue
+ def predicate():
+ for item in Queue.selectBy(vhost=vhost, name=name):
+ return True
+ wait(predicate)
+
+ self.env.queue = Queue.selectBy(vhost=vhost, name=name)[0]
+
+ print self.env.queue
+
+ self.run_children(session)
+
+class ExchangeTest(Test):
+ def do_run(self, session):
+ vhost = self.env.vhost
+ name = self.env.broker_exchange.name
+
+ self.env.exchange = Exchange.selectBy(vhost=vhost, name=name)[0]
+
+ print self.env.exchange
+
+ self.run_children(session)
+
+class ClientTest(Test):
+ def do_run(self, session):
+ vhost = self.env.vhost
+ address = self.env.broker_client.host + ":" + \
+ str(self.env.broker_client.port)
+
+ self.env.client = Client.selectBy(vhost=vhost, address=address)[0]
+
+ print self.env.client
+
+ self.run_children(session)
+
def wait(predicate, timeout=30):
start = time.time()
18 years, 2 months
rhmessaging commits: r1671 - in mgmt/cumin: python/cumin and 1 other directory.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2008-02-09 13:12:22 -0500 (Sat, 09 Feb 2008)
New Revision: 1671
Added:
mgmt/cumin/bin/cumin-bench
Modified:
mgmt/cumin/bin/cumin-test
mgmt/cumin/python/cumin/test.py
Log:
Moves the benchmarking stuff out of cumin-test and into a dedicated
tool, cumin-bench.
Expands the tests.
Makes cumin-test the test launcher.
Improves the help text of the command line tools.
Added: mgmt/cumin/bin/cumin-bench
===================================================================
--- mgmt/cumin/bin/cumin-bench (rev 0)
+++ mgmt/cumin/bin/cumin-bench 2008-02-09 18:12:22 UTC (rev 1671)
@@ -0,0 +1,100 @@
+#!/usr/bin/env python
+
+import sys, os
+from time import time
+from wooly.devel import BenchmarkHarness
+
+from cumin import *
+from cumin.test import *
+from cumin.util import *
+
+def usage():
+ print """Usage: cumin-bench OPTIONS...
+Options:
+ -h, --help Print this message
+ --data URL Connect to database at URL
+ (default postgesql://cumin@localhost/cumin)
+ --hits HITS Stop at HITS page hits (default 1000)
+ --profile"""
+ sys.exit(1)
+
+def do_main(home, data, hits):
+ app = Cumin(home, data)
+
+ app.enable_debug()
+
+ try:
+ app.check()
+ except Exception, e:
+ if hasattr(e, "message"):
+ print e.message
+
+ sys.exit(1)
+
+ app.init()
+
+ harness = BenchmarkHarness(app)
+
+ try:
+ harness.run(hits)
+ except KeyboardInterrupt:
+ pass
+
+def main():
+ if "-h" in sys.argv or "--help" in sys.argv:
+ usage()
+
+ home = os.environ.get("CUMIN_HOME")
+
+ if not home:
+ home = os.path.normpath("/usr/share/cumin")
+
+ config = Config()
+ config.add_param("data", "s", "postgresql://cumin@localhost/cumin")
+ config.add_param("hits", "i", 1000)
+ config.add_param("profile", "b", False)
+
+ config.load_file(os.path.join(home, "etc", "cumin.conf"))
+ config.load_file(os.path.join(os.path.expanduser("~"), ".cumin.conf"))
+ config.load_args(sys.argv)
+
+ config.prt()
+
+ home = os.environ["CUMIN_HOME"]
+ data = config.get("data")
+ hits = config.get("hits")
+ profile = config.get("profile")
+
+ if profile:
+ from profile import Profile
+ from pstats import Stats
+
+ prof = Profile()
+
+ try:
+ statement = "do_main('%s', '%s', %i)" % (home, data, hits)
+
+ prof.run(statement)
+
+ raise KeyboardInterrupt()
+ except KeyboardInterrupt:
+ file = "/tmp/cumin-test-stats"
+
+ prof.dump_stats(file)
+
+ stats = Stats(file)
+
+ stats.sort_stats("cumulative").print_stats(15)
+ stats.sort_stats("time").print_stats(15)
+
+ stats.print_callees("wooly/__init__.*\\(marshal_url_vars\\)")
+ stats.print_callees("wooly/__init__.*\\(path\\)")
+ stats.print_callees("wooly/__init__.*\\(get\\)")
+ stats.print_callees("wooly/__init__.*\\(render\\)")
+
+ stats.strip_dirs()
+ else:
+ do_main(home, data, hits)
+
+if __name__ == "__main__":
+ main()
Property changes on: mgmt/cumin/bin/cumin-bench
___________________________________________________________________
Name: svn:executable
+ *
Modified: mgmt/cumin/bin/cumin-test
===================================================================
--- mgmt/cumin/bin/cumin-test 2008-02-09 18:09:50 UTC (rev 1670)
+++ mgmt/cumin/bin/cumin-test 2008-02-09 18:12:22 UTC (rev 1671)
@@ -5,22 +5,25 @@
from wooly.devel import BenchmarkHarness
from cumin import *
-from cumin.demo import *
-from cumin.model import *
+from cumin.test import *
+from cumin.util import *
def usage():
print """Usage: cumin-test OPTIONS...
Options:
- --data DATABASE-URL
- --bench [HITS]
+ -h, --help Print this message
+ --data URL Connect to database at URL
+ (default postgesql://cumin@localhost/cumin)
+ --broker ADDRESS Register new test broker at ADDRESS
+ (default localhost:5672)
--profile
--debug"""
sys.exit(1)
-def do_main(home, data, bench_hits, debug):
+def do_main(home, data, broker_host, broker_port, debug):
app = Cumin(home, data)
- if debug or bench_hits:
+ if debug or bench:
app.enable_debug()
try:
@@ -33,13 +36,15 @@
app.init()
- harness = BenchmarkHarness(app)
+ env = TestEnvironment(app, broker_host, broker_port)
+ env.init();
- try:
- harness.run(bench_hits)
- except KeyboardInterrupt:
- pass
+ main = MainTest(env)
+ session = TestSession(env)
+ main.run(session)
+ session.report(sys.stdout)
+
def main():
if "-h" in sys.argv or "--help" in sys.argv:
usage()
@@ -51,9 +56,8 @@
config = Config()
config.add_param("data", "s", "postgresql://cumin@localhost/cumin")
- config.add_param("port", "i", 80)
+ config.add_param("broker", "s", "localhost:5672")
config.add_param("debug", "b", True)
- config.add_param("bench", "i", 1000)
config.add_param("profile", "b", False)
config.load_file(os.path.join(home, "etc", "cumin.conf"))
@@ -64,10 +68,12 @@
home = os.environ["CUMIN_HOME"]
data = config.get("data")
- bench = config.get("bench")
+ broker = config.get("broker")
+ debug = config.get("debug")
profile = config.get("profile")
- debug = config.get("debug")
+ host, port = parse_broker_addr(broker)
+
if profile:
from profile import Profile
from pstats import Stats
@@ -75,8 +81,8 @@
prof = Profile()
try:
- statement = "do_main('%s', '%s', %i, %r)" \
- % (home, data, bench, debug)
+ statement = "do_main('%s', '%s', %s, %i, %r)" \
+ % (home, data, host, port, debug)
prof.run(statement)
@@ -98,7 +104,7 @@
stats.strip_dirs()
else:
- do_main(home, data, bench, debug)
+ do_main(home, data, host, port, debug)
if __name__ == "__main__":
main()
Modified: mgmt/cumin/python/cumin/test.py
===================================================================
--- mgmt/cumin/python/cumin/test.py 2008-02-09 18:09:50 UTC (rev 1670)
+++ mgmt/cumin/python/cumin/test.py 2008-02-09 18:12:22 UTC (rev 1671)
@@ -3,16 +3,36 @@
from traceback import print_exc
from datetime import datetime
from wooly import Session
+import qpid, quirk
from cumin import Cumin
+from util import *
import time
class TestEnvironment(object):
- def __init__(self, app, broker_address):
+ def __init__(self, app, broker_host, broker_port):
self.app = app
- self.broker_address = broker_address
+
+ self.broker_client = quirk.Client(broker_host, broker_port)
+ self.broker_queue = quirk.Queue("cumin.queue")
+ self.broker_exchange = quirk.Exchange("cumin.exchange")
+
self.broker = None
+ self.queue = None
+ self.exchange = None
+ def init(self):
+ self.broker_client.login("guest", "guest")
+
+ session = quirk.Session(self.broker_client)
+ session.open()
+
+ try:
+ self.broker_queue.declare(session)
+ self.broker_exchange.declare(session)
+ finally:
+ session.close()
+
class TestSession(object):
def __init__(self, env):
self.env = env
@@ -34,7 +54,7 @@
def report(self, out):
out.write("Succcesses (%i)\n" % len(self.successes))
- for succcess in self.successes:
+ for success in self.successes:
out.write(" %s\n" % success)
out.write("Failures (%i)\n" % len(self.failures))
@@ -63,6 +83,7 @@
def run(self, session):
try:
self.do_run(session)
+ session.add_success(self, "OK", None)
except Exception, e:
session.add_failure(self, e.message, e)
@@ -102,7 +123,9 @@
name = "test-" + datetime.now().strftime("%Y-%m-%d-%H-%M")
form.names.get(s).append(name)
- form.addrs.get(s).append(self.env.broker_address)
+ addr = "%s:%s" % \
+ (self.env.broker_client.host, self.env.broker_client.port)
+ form.addrs.get(s).append(addr)
form.groups.get(s).append(None)
form.submit.set(s, True)
@@ -118,9 +141,9 @@
html = page.render(s, None)
- file = open("BrokerTest.%s.html" % name, "w")
- file.write(html)
- file.close()
+ #file = open("BrokerTest.%s.html" % name, "w")
+ #file.write(html)
+ #file.close()
reg = BrokerRegistration.selectBy(name=name)[0]
@@ -132,35 +155,26 @@
class QueueTest(Test):
def do_run(self, session):
- print self.env.broker
+ def predicate():
+ for item in Vhost.selectBy(broker=self.env.broker, name="/"):
+ return True
+ wait(predicate)
+
+ vhost = Vhost.selectBy(broker=self.env.broker, name="/")[0]
+ name = self.env.broker_queue.name
+ self.queue = Queue.selectBy(vhost=vhost, name=name)[0]
+
+ print self.queue
+
def wait(predicate, timeout=30):
start = time.time()
while True:
- time.sleep(1)
-
if predicate():
return
if time.time() - start > timeout:
- print "Operation timed out"
- return
+ raise Exception("Operation timed out")
-def main():
- home = os.environ["CUMIN_HOME"]
- data = "postgresql://cumin@localhost/cumin"
- app = Cumin(home, data)
-
- app.init()
-
- env = TestEnvironment(app, "qpid-test3.lab.boston.redhat.com")
- session = TestSession(env)
- main = MainTest(env)
-
- main.run(session)
-
- session.report(sys.stdout)
-
-if __name__ == "__main__":
- main()
+ time.sleep(1)
18 years, 2 months
rhmessaging commits: r1670 - mgmt/cumin/bin.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2008-02-09 13:09:50 -0500 (Sat, 09 Feb 2008)
New Revision: 1670
Modified:
mgmt/cumin/bin/cumin
Log:
Some edits to the help text.
Modified: mgmt/cumin/bin/cumin
===================================================================
--- mgmt/cumin/bin/cumin 2008-02-09 18:09:06 UTC (rev 1669)
+++ mgmt/cumin/bin/cumin 2008-02-09 18:09:50 UTC (rev 1670)
@@ -10,8 +10,9 @@
print """Usage: cumin OPTIONS...
Options:
-h, --help Print this message
- --data URL Use database url URL
- --port PORT Run web server on port PORT
+ --data URL Connect to database at URL
+ (default postgesql://cumin@localhost/cumin)
+ --port PORT Run web server on port PORT (default 80)
--debug Enable debugging"""
sys.exit(1)
18 years, 2 months