qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r..@apache.org
Subject svn commit: r803270 - in /qpid/trunk/qpid/cpp: bindings/qmf/tests/ src/tests/
Date Tue, 11 Aug 2009 19:58:13 GMT
Author: rhs
Date: Tue Aug 11 19:58:12 2009
New Revision: 803270

URL: http://svn.apache.org/viewvc?rev=803270&view=rev
Log:
fixed the cpp/python test integration

Modified:
    qpid/trunk/qpid/cpp/bindings/qmf/tests/python_console.py
    qpid/trunk/qpid/cpp/bindings/qmf/tests/run_interop_tests
    qpid/trunk/qpid/cpp/src/tests/acl.py
    qpid/trunk/qpid/cpp/src/tests/cli_tests.py
    qpid/trunk/qpid/cpp/src/tests/federation.py
    qpid/trunk/qpid/cpp/src/tests/python_tests
    qpid/trunk/qpid/cpp/src/tests/run_acl_tests
    qpid/trunk/qpid/cpp/src/tests/run_cli_tests
    qpid/trunk/qpid/cpp/src/tests/run_federation_tests

Modified: qpid/trunk/qpid/cpp/bindings/qmf/tests/python_console.py
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/bindings/qmf/tests/python_console.py?rev=803270&r1=803269&r2=803270&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/bindings/qmf/tests/python_console.py (original)
+++ qpid/trunk/qpid/cpp/bindings/qmf/tests/python_console.py Tue Aug 11 19:58:12 2009
@@ -19,28 +19,11 @@
 #
 
 import sys
-from qpid.testlib import TestBase010, testrunner
+from qpid.testlib import TestBase010
 from qpid.datatypes import Message
 from qpid.queue import Empty
 from time import sleep
 
-def scan_args(name, default=None, args=sys.argv[1:]):
-    if (name in args):
-        pos = args.index(name)
-        return args[pos + 1]
-    elif default:
-        return default
-    else:
-        print "Please specify extra argument: %s" % name
-        sys.exit(2)
-
-def extract_args(name, args):
-    if (name in args):
-        pos = args.index(name)
-        del args[pos:pos+2]
-    else:
-        return None
-
 class QmfInteropTests(TestBase010):
 
     def test_A_agent_presence(self):
@@ -74,10 +57,3 @@
         if headers:
             return headers[name]
         return None
-
-
-if __name__ == '__main__':
-    args = sys.argv[1:]
-    args.append("python_console")
-
-    if not testrunner.run(args): sys.exit(1)

Modified: qpid/trunk/qpid/cpp/bindings/qmf/tests/run_interop_tests
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/bindings/qmf/tests/run_interop_tests?rev=803270&r1=803269&r2=803270&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/bindings/qmf/tests/run_interop_tests (original)
+++ qpid/trunk/qpid/cpp/bindings/qmf/tests/run_interop_tests Tue Aug 11 19:58:12 2009
@@ -52,12 +52,12 @@
 if test -d ${PYTHON_DIR} ;  then
     start_broker
     echo "Running qmf interop tests using broker on port $BROKER_PORT"
-    PYTHONPATH=${PYTHON_DIR}
+    PYTHONPATH=${PYTHON_DIR}:${MY_DIR}
     export PYTHONPATH
     echo "    Ruby Agent vs. Pure-Python Console"
     start_ruby_agent
     echo "    Ruby agent started at pid $AGENT_PID"
-    ${MY_DIR}/python_console.py -v -s ${SPEC_DIR}/amqp.0-10-qpid-errata.xml -b localhost:$BROKER_PORT
$@
+    ${PYTHON_DIR}/qpid-python-test -m python_console -b localhost:$BROKER_PORT $@
     RETCODE=$?
     stop_ruby_agent
     stop_broker

Modified: qpid/trunk/qpid/cpp/src/tests/acl.py
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/tests/acl.py?rev=803270&r1=803269&r2=803270&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/tests/acl.py (original)
+++ qpid/trunk/qpid/cpp/src/tests/acl.py Tue Aug 11 19:58:12 2009
@@ -23,36 +23,10 @@
 from qpid.util import connect
 from qpid.connection import Connection
 from qpid.datatypes import uuid4
-from qpid.testlib import TestBase010, testrunner
+from qpid.testlib import TestBase010
 from qmf.console import Session
 from qpid.datatypes import Message
 
-def scan_args(name, default=None, args=sys.argv[1:]):
-    if (name in args):
-        pos = args.index(name)
-        return args[pos + 1]
-    elif default:
-        return default
-    else:
-        print "Please specify extra argument: %s" % name
-        sys.exit(2)
-
-def extract_args(name, args):
-    if (name in args):
-        pos = args.index(name)
-        del args[pos:pos+2]
-    else:
-        return None
-
-def get_broker_port():
-    return scan_args("--port", "5672")
-
-def get_session(user, passwd):
-    socket = connect('127.0.0.1', int(get_broker_port()))
-    connection = Connection (sock=socket, username=user, password=passwd)
-    connection.start()
-    return connection.session(str(uuid4()))
-
 class ACLFile:
     def __init__(self):
         self.f = open('data_dir/policy.acl','w');
@@ -65,6 +39,12 @@
         
 class ACLTests(TestBase010):
 
+    def get_session(self, user, passwd):
+        socket = connect(self.broker.host, self.broker.port)
+        connection = Connection (sock=socket, username=user, password=passwd)
+        connection.start()
+        return connection.session(str(uuid4()))
+
     def reload_acl(self):
         acl = self.qmf.getObjects(_class="acl")[0]    
         return acl.reloadACLFile()
@@ -93,7 +73,7 @@
         
         self.reload_acl()       
         
-        session = get_session('bob','bob')
+        session = self.get_session('bob','bob')
         try:
             session.queue_declare(queue="deny_queue")
         except qpid.session.SessionException, e:
@@ -118,7 +98,7 @@
         
         self.reload_acl()       
         
-        session = get_session('bob','bob')
+        session = self.get_session('bob','bob')
         try:
             session.queue_declare(queue="allow_queue")
         except qpid.session.SessionException, e:
@@ -146,7 +126,7 @@
 
         self.reload_acl()
 
-        session = get_session('bob','bob')
+        session = self.get_session('bob','bob')
         try:
             session.queue_declare(queue="allow_queue")
         except qpid.session.SessionException, e:
@@ -243,21 +223,21 @@
         
         self.reload_acl()       
         
-        session = get_session('bob','bob')
+        session = self.get_session('bob','bob')
         
         try:
             session.queue_declare(queue="q1", durable='true', passive='true')
             self.fail("ACL should deny queue create request with name=q1 durable=true passive=true");
         except qpid.session.SessionException, e:
             self.assertEqual(530,e.args[0].error_code)
-            session = get_session('bob','bob')
+            session = self.get_session('bob','bob')
         
         try:
             session.queue_declare(queue="q2", exclusive='true')
             self.fail("ACL should deny queue create request with name=q2 exclusive=true");
         except qpid.session.SessionException, e:
             self.assertEqual(530,e.args[0].error_code) 
-            session = get_session('bob','bob')
+            session = self.get_session('bob','bob')
         
         try:
             session.queue_declare(queue="q3", exclusive='true')
@@ -271,14 +251,14 @@
             self.fail("ACL should deny queue query request for q3");
         except qpid.session.SessionException, e:
             self.assertEqual(530,e.args[0].error_code)
-            session = get_session('bob','bob')
+            session = self.get_session('bob','bob')
         
         try:
             session.queue_purge(queue="q3")
             self.fail("ACL should deny queue purge request for q3");
         except qpid.session.SessionException, e:
             self.assertEqual(530,e.args[0].error_code)
-            session = get_session('bob','bob')
+            session = self.get_session('bob','bob')
             
         try:
             session.queue_purge(queue="q4")
@@ -291,7 +271,7 @@
             self.fail("ACL should deny queue delete request for q4");
         except qpid.session.SessionException, e:
             self.assertEqual(530,e.args[0].error_code)
-            session = get_session('bob','bob')
+            session = self.get_session('bob','bob')
             
         try:
             session.queue_delete(queue="q3")
@@ -319,21 +299,21 @@
         
         self.reload_acl()       
         
-        session = get_session('bob','bob')
+        session = self.get_session('bob','bob')
         
         try:
             session.exchange_declare(exchange='testEx', durable='true', passive='true')
             self.fail("ACL should deny exchange create request with name=testEx durable=true
passive=true");
         except qpid.session.SessionException, e:
             self.assertEqual(530,e.args[0].error_code)
-            session = get_session('bob','bob')
+            session = self.get_session('bob','bob')
        
         try:
             session.exchange_declare(exchange='ex1', type='direct')
             self.fail("ACL should deny exchange create request with name=ex1 type=direct");
         except qpid.session.SessionException, e:
             self.assertEqual(530,e.args[0].error_code) 
-            session = get_session('bob','bob')
+            session = self.get_session('bob','bob')
         
         try:
             session.exchange_declare(exchange='myXml', type='direct')
@@ -347,14 +327,14 @@
             self.fail("ACL should deny queue query request for q3");
         except qpid.session.SessionException, e:
             self.assertEqual(530,e.args[0].error_code)
-            session = get_session('bob','bob')
+            session = self.get_session('bob','bob')
                 
         try:
             session.exchange_bind(exchange='myEx', queue='q1', binding_key='rk1')
             self.fail("ACL should deny exchange bind request with exchange='myEx' queuename='q1'
bindingkey='rk1'");
         except qpid.session.SessionException, e:
             self.assertEqual(530,e.args[0].error_code) 
-            session = get_session('bob','bob')
+            session = self.get_session('bob','bob')
 
         try:
             session.exchange_bind(exchange='myXml', queue='q1', binding_key='x')
@@ -366,7 +346,7 @@
             self.fail("ACL should deny exchange unbind request with exchange='myEx' queuename='q1'
bindingkey='rk1'");
         except qpid.session.SessionException, e:
             self.assertEqual(530,e.args[0].error_code) 
-            session = get_session('bob','bob')
+            session = self.get_session('bob','bob')
 
         try:
             session.exchange_unbind(exchange='myXml', queue='q1', binding_key='x')
@@ -379,7 +359,7 @@
             self.fail("ACL should deny exchange delete request for myEx");
         except qpid.session.SessionException, e:
             self.assertEqual(530,e.args[0].error_code)
-            session = get_session('bob','bob')
+            session = self.get_session('bob','bob')
             
         try:
             session.exchange_delete(exchange='myXml')
@@ -404,7 +384,7 @@
         
         self.reload_acl()       
         
-        session = get_session('bob','bob')
+        session = self.get_session('bob','bob')
         
         
         try:
@@ -420,14 +400,14 @@
             self.fail("ACL should deny message subscriber request for queue='q1'");
         except qpid.session.SessionException, e:
             self.assertEqual(530,e.args[0].error_code)
-            session = get_session('bob','bob')
+            session = self.get_session('bob','bob')
             
         try:
             session.message_subscribe(queue='q2', destination='myq1')
             self.fail("ACL should deny message subscriber request for queue='q2'");
         except qpid.session.SessionException, e:
             self.assertEqual(530,e.args[0].error_code)
-            session = get_session('bob','bob')
+            session = self.get_session('bob','bob')
               
         try:
             session.message_subscribe(queue='q3', destination='myq1')
@@ -453,7 +433,7 @@
         
         self.reload_acl()       
         
-        session = get_session('bob','bob')
+        session = self.get_session('bob','bob')
         
         try:
             session.exchange_declare(exchange='myEx', type='topic')
@@ -468,14 +448,14 @@
             self.fail("ACL should deny message transfer to name=amq.direct routingkey=rk1");
         except qpid.session.SessionException, e:
             self.assertEqual(530,e.args[0].error_code)
-            session = get_session('bob','bob')                        
+            session = self.get_session('bob','bob')                        
             
         try:
             session.message_transfer(destination="amq.topic", message=Message(props,"Test"))
             self.fail("ACL should deny message transfer to name=amq.topic");
         except qpid.session.SessionException, e:
             self.assertEqual(530,e.args[0].error_code)
-            session = get_session('bob','bob')
+            session = self.get_session('bob','bob')
                         
         try:
             session.message_transfer(destination="myEx", message=Message(props,"Test"))
@@ -489,13 +469,4 @@
             session.message_transfer(destination="amq.direct", message=Message(props,"Test"))
         except qpid.session.SessionException, e:
             if (530 == e.args[0].error_code):
-                self.fail("ACL should allow message transfer to exchange amq.direct"); 
-                        
-                        
-if __name__ == '__main__':
-    args = sys.argv[1:]
-    #need to remove the extra options from args as test runner doesn't recognize them
-    extract_args("--port", args)
-    args.append("acl") 
-    
-    if not testrunner.run(args): sys.exit(1)                
+                self.fail("ACL should allow message transfer to exchange amq.direct");

Modified: qpid/trunk/qpid/cpp/src/tests/cli_tests.py
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/tests/cli_tests.py?rev=803270&r1=803269&r2=803270&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/tests/cli_tests.py (original)
+++ qpid/trunk/qpid/cpp/src/tests/cli_tests.py Tue Aug 11 19:58:12 2009
@@ -20,44 +20,21 @@
 
 import sys
 import os
-from qpid.testlib import TestBase010, testrunner
+from qpid.testlib import TestBase010
 from qpid.datatypes import Message
 from qpid.queue import Empty
 from time import sleep
 
-def add_module(args=sys.argv[1:]):
-    for a in args:
-        if a.startswith("cli"):
-            return False
-    return True
-
-def scan_args(name, default=None, args=sys.argv[1:]):
-    if (name in args):
-        pos = args.index(name)
-        return args[pos + 1]
-    elif default:
-        return default
-    else:
-        print "Please specify extra argument: %s" % name
-        sys.exit(2)
-
-def extract_args(name, args):
-    if (name in args):
-        pos = args.index(name)
-        del args[pos:pos+2]
-    else:
-        return None
-
-def remote_host():
-    return scan_args("--remote-host", "localhost")
+class CliTests(TestBase010):
 
-def remote_port():
-    return int(scan_args("--remote-port"))
+    def remote_host(self):
+        return self.defines.get("remote-host", "localhost")
 
-def cli_dir():
-    return scan_args("--cli-dir")
+    def remote_port(self):
+        return int(self.defines["remote-port"])
 
-class CliTests(TestBase010):
+    def cli_dir(self):
+        return self.defines["cli-dir"]
 
     def makeQueue(self, qname, arguments):
         ret = os.system(self.command(" add queue " + qname + " " + arguments))
@@ -150,15 +127,15 @@
         self.startQmf();
         qmf = self.qmf
 
-        command = cli_dir() + "/qpid-route dynamic add guest/guest@localhost:%d %s:%d amq.topic"
%\
-            (testrunner.port, remote_host(), remote_port())
+        command = self.cli_dir() + "/qpid-route dynamic add guest/guest@localhost:%d %s:%d
amq.topic" %\
+            (self.broker.port, self.remote_host(), self.remote_port())
         ret = os.system(command)
         self.assertEqual(ret, 0)
 
         links = qmf.getObjects(_class="link")
         found = False
         for link in links:
-            if link.port == remote_port():
+            if link.port == self.remote_port():
                 found = True
         self.assertEqual(found, True)
 
@@ -174,18 +151,4 @@
         return None
 
     def command(self, arg = ""):
-        return cli_dir() + "/qpid-config -a localhost:%d" % testrunner.port + " " + arg
-
-
-if __name__ == '__main__':
-    args = sys.argv[1:]
-    #need to remove the extra options from args as test runner doesn't recognise them
-    extract_args("--remote-port", args)
-    extract_args("--remote-host", args)
-    extract_args("--cli-dir", args)
-
-    if add_module():
-        #add module(s) to run to testrunners args
-        args.append("cli_tests") 
-    
-    if not testrunner.run(args): sys.exit(1)
+        return self.cli_dir() + "/qpid-config -a localhost:%d" % self.broker.port + " " +
arg

Modified: qpid/trunk/qpid/cpp/src/tests/federation.py
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/tests/federation.py?rev=803270&r1=803269&r2=803270&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/tests/federation.py (original)
+++ qpid/trunk/qpid/cpp/src/tests/federation.py Tue Aug 11 19:58:12 2009
@@ -19,48 +19,25 @@
 #
 
 import sys
-from qpid.testlib import TestBase010, testrunner
+from qpid.testlib import TestBase010
 from qpid.datatypes import Message
 from qpid.queue import Empty
 from time import sleep
 
-def add_module(args=sys.argv[1:]):
-    for a in args:
-        if a.startswith("federation"):
-            return False
-    return True
-
-def scan_args(name, default=None, args=sys.argv[1:]):
-    if (name in args):
-        pos = args.index(name)
-        return args[pos + 1]
-    elif default:
-        return default
-    else:
-        print "Please specify extra argument: %s" % name
-        sys.exit(2)
-
-def extract_args(name, args):
-    if (name in args):
-        pos = args.index(name)
-        del args[pos:pos+2]
-    else:
-        return None
-
-def remote_host():
-    return scan_args("--remote-host", "localhost")
+class FederationTests(TestBase010):
 
-def remote_port():
-    return int(scan_args("--remote-port"))
+    def remote_host(self):
+        return self.defines.get("remote-host", "localhost")
 
-class FederationTests(TestBase010):
+    def remote_port(self):
+        return int(self.defines["remote-port"])
 
     def test_bridge_create_and_close(self):
         self.startQmf();
         qmf = self.qmf
 
         broker = qmf.getObjects(_class="broker")[0]
-        result = broker.connect(remote_host(), remote_port(), False, "PLAIN", "guest", "guest",
"tcp")
+        result = broker.connect(self.remote_host(), self.remote_port(), False, "PLAIN", "guest",
"guest", "tcp")
         self.assertEqual(result.status, 0)
 
         link = qmf.getObjects(_class="link")[0]
@@ -84,7 +61,7 @@
         self.startQmf()
         qmf = self.qmf
         broker = qmf.getObjects(_class="broker")[0]
-        result = broker.connect(remote_host(), remote_port(), False, "PLAIN", "guest", "guest",
"tcp")
+        result = broker.connect(self.remote_host(), self.remote_port(), False, "PLAIN", "guest",
"guest", "tcp")
         self.assertEqual(result.status, 0)
 
         link = qmf.getObjects(_class="link")[0]
@@ -101,7 +78,7 @@
         sleep(6)
 
         #send messages to remote broker and confirm it is routed to local broker
-        r_conn = self.connect(host=remote_host(), port=remote_port())
+        r_conn = self.connect(host=self.remote_host(), port=self.remote_port())
         r_session = r_conn.session("test_pull_from_exchange")
 
         for i in range(1, 11):
@@ -131,7 +108,7 @@
         self.startQmf()
         qmf = self.qmf
         broker = qmf.getObjects(_class="broker")[0]
-        result = broker.connect(remote_host(), remote_port(), False, "PLAIN", "guest", "guest",
"tcp")
+        result = broker.connect(self.remote_host(), self.remote_port(), False, "PLAIN", "guest",
"guest", "tcp")
         self.assertEqual(result.status, 0)
 
         link = qmf.getObjects(_class="link")[0]
@@ -141,7 +118,7 @@
         bridge = qmf.getObjects(_class="bridge")[0]
 
         #setup queue to receive messages from remote broker
-        r_conn = self.connect(host=remote_host(), port=remote_port())
+        r_conn = self.connect(host=self.remote_host(), port=self.remote_port())
         r_session = r_conn.session("test_push_to_exchange")
         r_session.queue_declare(queue="fed1", exclusive=True, auto_delete=True)
         r_session.exchange_bind(queue="fed1", exchange="amq.fanout")
@@ -175,7 +152,7 @@
         session = self.session
 
         #setup queue on remote broker and add some messages
-        r_conn = self.connect(host=remote_host(), port=remote_port())
+        r_conn = self.connect(host=self.remote_host(), port=self.remote_port())
         r_session = r_conn.session("test_pull_from_queue")
         r_session.queue_declare(queue="my-bridge-queue", auto_delete=True)
         for i in range(1, 6):
@@ -191,7 +168,7 @@
         self.startQmf()
         qmf = self.qmf
         broker = qmf.getObjects(_class="broker")[0]
-        result = broker.connect(remote_host(), remote_port(), False, "PLAIN", "guest", "guest",
"tcp")
+        result = broker.connect(self.remote_host(), self.remote_port(), False, "PLAIN", "guest",
"guest", "tcp")
         self.assertEqual(result.status, 0)
 
         link = qmf.getObjects(_class="link")[0]
@@ -227,7 +204,7 @@
         self.assertEqual(len(qmf.getObjects(_class="link")), 0)
 
     def test_tracing_automatic(self):
-        remoteUrl = "%s:%d" % (remote_host(), remote_port())
+        remoteUrl = "%s:%d" % (self.remote_host(), self.remote_port())
         self.startQmf()
         l_broker = self.qmf_broker
         r_broker = self.qmf.addBroker(remoteUrl)
@@ -235,8 +212,8 @@
         l_brokerObj = self.qmf.getObjects(_class="broker", _broker=l_broker)[0]
         r_brokerObj = self.qmf.getObjects(_class="broker", _broker=r_broker)[0]
 
-        l_res = l_brokerObj.connect(remote_host(), remote_port(),     False, "PLAIN", "guest",
"guest", "tcp")
-        r_res = r_brokerObj.connect(testrunner.host, testrunner.port, False, "PLAIN", "guest",
"guest", "tcp")
+        l_res = l_brokerObj.connect(self.remote_host(), self.remote_port(),     False, "PLAIN",
"guest", "guest", "tcp")
+        r_res = r_brokerObj.connect(self.broker.host, self.broker.port, False, "PLAIN", "guest",
"guest", "tcp")
 
         self.assertEqual(l_res.status, 0)
         self.assertEqual(r_res.status, 0)
@@ -268,7 +245,7 @@
         queue = session.incoming("f1")
 
         #setup queue on remote broker and add some messages
-        r_conn = self.connect(host=remote_host(), port=remote_port())
+        r_conn = self.connect(host=self.remote_host(), port=self.remote_port())
         r_session = r_conn.session("test_trace")
         for i in range(1, 11):
             dp = r_session.delivery_properties(routing_key="key")
@@ -291,7 +268,7 @@
         self.startQmf()
         qmf = self.qmf
         broker = qmf.getObjects(_class="broker")[0]
-        result = broker.connect(remote_host(), remote_port(), False, "PLAIN", "guest", "guest",
"tcp")
+        result = broker.connect(self.remote_host(), self.remote_port(), False, "PLAIN", "guest",
"guest", "tcp")
         self.assertEqual(result.status, 0)
 
         link = qmf.getObjects(_class="link")[0]
@@ -308,7 +285,7 @@
         sleep(6)
 
         #send messages to remote broker and confirm it is routed to local broker
-        r_conn = self.connect(host=remote_host(), port=remote_port())
+        r_conn = self.connect(host=self.remote_host(), port=self.remote_port())
         r_session = r_conn.session("test_tracing")
 
         trace = [None, "exclude-me", "a,exclude-me,b", "also-exclude-me,c", "dont-exclude-me"]
@@ -341,7 +318,7 @@
 
     def test_dynamic_fanout(self):
         session = self.session
-        r_conn = self.connect(host=remote_host(), port=remote_port())
+        r_conn = self.connect(host=self.remote_host(), port=self.remote_port())
         r_session = r_conn.session("test_dynamic_fanout")
 
         session.exchange_declare(exchange="fed.fanout", type="fanout")
@@ -350,7 +327,7 @@
         self.startQmf()
         qmf = self.qmf
         broker = qmf.getObjects(_class="broker")[0]
-        result = broker.connect(remote_host(), remote_port(), False, "PLAIN", "guest", "guest",
"tcp")
+        result = broker.connect(self.remote_host(), self.remote_port(), False, "PLAIN", "guest",
"guest", "tcp")
         self.assertEqual(result.status, 0)
 
         link = qmf.getObjects(_class="link")[0]
@@ -388,7 +365,7 @@
 
     def test_dynamic_direct(self):
         session = self.session
-        r_conn = self.connect(host=remote_host(), port=remote_port())
+        r_conn = self.connect(host=self.remote_host(), port=self.remote_port())
         r_session = r_conn.session("test_dynamic_direct")
 
         session.exchange_declare(exchange="fed.direct", type="direct")
@@ -397,7 +374,7 @@
         self.startQmf()
         qmf = self.qmf
         broker = qmf.getObjects(_class="broker")[0]
-        result = broker.connect(remote_host(), remote_port(), False, "PLAIN", "guest", "guest",
"tcp")
+        result = broker.connect(self.remote_host(), self.remote_port(), False, "PLAIN", "guest",
"guest", "tcp")
         self.assertEqual(result.status, 0)
 
         link = qmf.getObjects(_class="link")[0]
@@ -435,7 +412,7 @@
 
     def test_dynamic_topic(self):
         session = self.session
-        r_conn = self.connect(host=remote_host(), port=remote_port())
+        r_conn = self.connect(host=self.remote_host(), port=self.remote_port())
         r_session = r_conn.session("test_dynamic_topic")
 
         session.exchange_declare(exchange="fed.topic", type="topic")
@@ -444,7 +421,7 @@
         self.startQmf()
         qmf = self.qmf
         broker = qmf.getObjects(_class="broker")[0]
-        result = broker.connect(remote_host(), remote_port(), False, "PLAIN", "guest", "guest",
"tcp")
+        result = broker.connect(self.remote_host(), self.remote_port(), False, "PLAIN", "guest",
"guest", "tcp")
         self.assertEqual(result.status, 0)
 
         link = qmf.getObjects(_class="link")[0]
@@ -489,16 +466,3 @@
         if headers:
             return headers[name]
         return None
-
-
-if __name__ == '__main__':
-    args = sys.argv[1:]
-    #need to remove the extra options from args as test runner doesn't recognise them
-    extract_args("--remote-port", args)
-    extract_args("--remote-host", args)
-
-    if add_module():
-        #add module(s) to run to testrunners args
-        args.append("federation") 
-    
-    if not testrunner.run(args): sys.exit(1)

Modified: qpid/trunk/qpid/cpp/src/tests/python_tests
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/tests/python_tests?rev=803270&r1=803269&r2=803270&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/tests/python_tests (original)
+++ qpid/trunk/qpid/cpp/src/tests/python_tests Tue Aug 11 19:58:12 2009
@@ -23,12 +23,11 @@
 QPID_PORT=${QPID_PORT:-5672}
 PYTHON_TESTS=${PYTHON_TESTS:-$*}
 QPID_PYTHON_DIR=${QPID_PYTHON_DIR:-`dirname $0`/../../../python}
-SPEC=${SPEC:-0-10-errata}
-FAILING=${FAILING:-cpp_failing_0-10.txt}
+FAILING=${FAILING:-/dev/null}
 
-if test -d $QPID_PYTHON_DIR; then 
+if test -d $QPID_PYTHON_DIR; then
     cd $QPID_PYTHON_DIR
-    ./run-tests --skip-self-test -v -s $SPEC -I $FAILING -b localhost:$QPID_PORT $PYTHON_TESTS
|| { echo "FAIL python tests for $SPEC"; exit 1; }
+    ./qpid-python-test -b localhost:$QPID_PORT -I $FAILING $PYTHON_TESTS || { echo "FAIL
python tests"; exit 1; }
 else
     echo "WARNING: No python tests. $QPID_PYTHON_DIR not found."
 fi

Modified: qpid/trunk/qpid/cpp/src/tests/run_acl_tests
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/tests/run_acl_tests?rev=803270&r1=803269&r2=803270&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/tests/run_acl_tests (original)
+++ qpid/trunk/qpid/cpp/src/tests/run_acl_tests Tue Aug 11 19:58:12 2009
@@ -53,9 +53,9 @@
     cp $srcdir/policy.acl $DATA_DIR
     start_brokers
     echo "Running acl tests using brokers on ports $LOCAL_PORT"
-    PYTHONPATH=$PYTHON_DIR
+    PYTHONPATH=$PYTHON_DIR:$srcdir
     export PYTHONPATH
-    $srcdir/acl.py -v -s $srcdir/../../../specs/amqp.0-10-qpid-errata.xml -b localhost:$LOCAL_PORT
--port $LOCAL_PORT || EXITCODE=1
+    $PYTHON_DIR/qpid-python-test -b localhost:$LOCAL_PORT -m acl || EXITCODE=1
     stop_brokers || EXITCODE=1
     test_loading_acl_from_absolute_path || EXITCODE=1
     rm -rf $DATA_DIR

Modified: qpid/trunk/qpid/cpp/src/tests/run_cli_tests
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/tests/run_cli_tests?rev=803270&r1=803269&r2=803270&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/tests/run_cli_tests (original)
+++ qpid/trunk/qpid/cpp/src/tests/run_cli_tests Tue Aug 11 19:58:12 2009
@@ -41,9 +41,9 @@
 if test -d ${PYTHON_DIR} ;  then
     start_brokers
     echo "Running CLI tests using brokers on ports $LOCAL_PORT $REMOTE_PORT"
-    PYTHONPATH=${PYTHON_DIR}
+    PYTHONPATH=${PYTHON_DIR}:${MY_DIR}
     export PYTHONPATH
-    ${MY_DIR}/cli_tests.py -v -s ${MY_DIR}/../../../specs/amqp.0-10-qpid-errata.xml -b localhost:$LOCAL_PORT
--remote-port $REMOTE_PORT --cli-dir $CLI_DIR $@
+    ${PYTHON_DIR}/qpid-python-test -m cli_tests -b localhost:$LOCAL_PORT -Dremote-port=$REMOTE_PORT
-Dcli-dir=$CLI_DIR $@
     RETCODE=$?
     stop_brokers
     if test x$RETCODE != x0; then 

Modified: qpid/trunk/qpid/cpp/src/tests/run_federation_tests
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/tests/run_federation_tests?rev=803270&r1=803269&r2=803270&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/tests/run_federation_tests (original)
+++ qpid/trunk/qpid/cpp/src/tests/run_federation_tests Tue Aug 11 19:58:12 2009
@@ -40,13 +40,12 @@
 if test -d ${PYTHON_DIR} ;  then
     start_brokers
     echo "Running federation tests using brokers on ports $LOCAL_PORT $REMOTE_PORT"
-    PYTHONPATH=${PYTHON_DIR}
+    PYTHONPATH=${PYTHON_DIR}:${MY_DIR}
     export PYTHONPATH
-    ${MY_DIR}/federation.py -v -s ${MY_DIR}/../../../specs/amqp.0-10-qpid-errata.xml -b localhost:$LOCAL_PORT
--remote-port $REMOTE_PORT $@
+    ${PYTHON_DIR}/qpid-python-test -m federation -b localhost:$LOCAL_PORT -Dremote-port=$REMOTE_PORT
$@
     RETCODE=$?
     stop_brokers
     if test x$RETCODE != x0; then 
         echo "FAIL federation tests"; exit 1;
     fi
 fi
-



---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:commits-subscribe@qpid.apache.org


Mime
View raw message