qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From acon...@apache.org
Subject svn commit: r1081634 [4/9] - in /qpid/branches/qpid-2920/qpid: ./ bin/ cpp/ cpp/bindings/qpid/ cpp/bindings/qpid/perl/ cpp/bindings/qpid/python/ cpp/bindings/qpid/ruby/ cpp/examples/ cpp/examples/direct/ cpp/examples/failover/ cpp/examples/fanout/ cpp/...
Date Tue, 15 Mar 2011 01:54:18 GMT
Modified: qpid/branches/qpid-2920/qpid/cpp/src/tests/acl.py
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-2920/qpid/cpp/src/tests/acl.py?rev=1081634&r1=1081633&r2=1081634&view=diff
==============================================================================
--- qpid/branches/qpid-2920/qpid/cpp/src/tests/acl.py (original)
+++ qpid/branches/qpid-2920/qpid/cpp/src/tests/acl.py Tue Mar 15 01:54:07 2011
@@ -26,10 +26,11 @@ from qpid.datatypes import uuid4
 from qpid.testlib import TestBase010
 from qmf.console import Session
 from qpid.datatypes import Message
+import qpid.messaging
 
 class ACLFile:
-    def __init__(self):
-        self.f = open('data_dir/policy.acl','w');
+    def __init__(self, policy='data_dir/policy.acl'):
+        self.f = open(policy,'w')
    
     def write(self,line):
         self.f.write(line)
@@ -50,14 +51,24 @@ class ACLTests(TestBase010):
         acl = self.qmf.getObjects(_class="acl")[0]    
         return acl.reloadACLFile()
 
+    def get_acl_file(self):
+        return ACLFile(self.config.defines.get("policy-file", "data_dir/policy.acl"))
+
     def setUp(self):
-        aclf = ACLFile()
+        aclf = self.get_acl_file()
         aclf.write('acl allow all all\n')
         aclf.close()
         TestBase010.setUp(self)
         self.startQmf()
         self.reload_acl()
-        
+
+    def tearDown(self):
+        aclf = self.get_acl_file()
+        aclf.write('acl allow all all\n')
+        aclf.close()
+        self.reload_acl()
+        TestBase010.tearDown(self)
+
    #=====================================
    # ACL general tests
    #=====================================     
@@ -66,7 +77,7 @@ class ACLTests(TestBase010):
         """
         Test the deny all mode
         """
-        aclf = ACLFile()
+        aclf = self.get_acl_file()
         aclf.write('acl allow anonymous all all\n')
         aclf.write('acl allow bob@QPID create queue\n')
         aclf.write('acl deny all all')
@@ -94,7 +105,7 @@ class ACLTests(TestBase010):
         """
         Test the allow all mode
         """
-        aclf = ACLFile()
+        aclf = self.get_acl_file()
         aclf.write('acl deny bob@QPID bind exchange\n')
         aclf.write('acl allow all all')
         aclf.close()        
@@ -126,7 +137,7 @@ class ACLTests(TestBase010):
         """
         Test empty groups
         """
-        aclf = ACLFile()
+        aclf = self.get_acl_file()
         aclf.write('acl group\n')
         aclf.write('acl group admins bob@QPID joe@QPID\n')
         aclf.write('acl allow all all')
@@ -140,7 +151,7 @@ class ACLTests(TestBase010):
         """
         Test illegal acl formats
         """
-        aclf = ACLFile()
+        aclf = self.get_acl_file()
         aclf.write('acl group admins bob@QPID joe@QPID\n')
         aclf.write('acl allow all all')
         aclf.close()
@@ -154,7 +165,7 @@ class ACLTests(TestBase010):
         Test illegal extension lines
         """
          
-        aclf = ACLFile()
+        aclf = self.get_acl_file()
         aclf.write('group admins bob@QPID \n')
         aclf.write('          \ \n')
         aclf.write('joe@QPID \n')
@@ -172,7 +183,7 @@ class ACLTests(TestBase010):
         """
         Test proper extention lines
         """
-        aclf = ACLFile()        
+        aclf = self.get_acl_file()
         aclf.write('group test1 joe@EXAMPLE.com \\ \n') # should be allowed
         aclf.write('            jack@EXAMPLE.com \\ \n') # should be allowed
         aclf.write('jill@TEST.COM \\ \n') # should be allowed
@@ -189,7 +200,7 @@ class ACLTests(TestBase010):
         Test a user defined without a realm
         Ex. group admin rajith
         """
-        aclf = ACLFile()        
+        aclf = self.get_acl_file()
         aclf.write('group admin bob\n') # shouldn't be allowed
         aclf.write('acl deny admin bind exchange\n')
         aclf.write('acl allow all all')
@@ -204,7 +215,7 @@ class ACLTests(TestBase010):
         Test a user defined without a realm
         Ex. group admin rajith
         """
-        aclf = ACLFile()        
+        aclf = self.get_acl_file()
         aclf.write('group test1 joe@EXAMPLE.com\n') # should be allowed
         aclf.write('group test2 jack_123-jill@EXAMPLE.com\n') # should be allowed
         aclf.write('group test4 host/somemachine.example.com@EXAMPLE.COM\n') # should be allowed
@@ -215,7 +226,7 @@ class ACLTests(TestBase010):
         if (result.text.find("ACL format error",0,len(result.text)) != -1):
             self.fail(result)
 
-        aclf = ACLFile()        
+        aclf = self.get_acl_file()
         aclf.write('group test1 joe$H@EXAMPLE.com\n') # shouldn't be allowed
         aclf.write('acl allow all all')
         aclf.close() 
@@ -233,7 +244,7 @@ class ACLTests(TestBase010):
         Test illegal queue policy
         """
          
-        aclf = ACLFile()
+        aclf = self.get_acl_file()
         aclf.write('acl deny bob@QPID create queue name=q2 exclusive=true policytype=ding\n')
         aclf.write('acl allow all all')
         aclf.close()        
@@ -249,7 +260,7 @@ class ACLTests(TestBase010):
         Test illegal queue policy
         """
          
-        aclf = ACLFile()
+        aclf = self.get_acl_file()
         aclf.write('acl deny bob@QPID create queue name=q2 maxqueuesize=-1\n')
         aclf.write('acl allow all all')
         aclf.close()        
@@ -260,7 +271,7 @@ class ACLTests(TestBase010):
         if (result.text != expected): 
             self.fail(result) 
 
-        aclf = ACLFile()
+        aclf = self.get_acl_file()
         aclf.write('acl deny bob@QPID create queue name=q2 maxqueuesize=9223372036854775808\n')
         aclf.write('acl allow all all')                                 
         aclf.close()        
@@ -277,7 +288,7 @@ class ACLTests(TestBase010):
         Test illegal queue policy
         """
          
-        aclf = ACLFile()
+        aclf = self.get_acl_file()
         aclf.write('acl deny bob@QPID create queue name=q2 maxqueuecount=-1\n')
         aclf.write('acl allow all all')
         aclf.close()        
@@ -288,7 +299,7 @@ class ACLTests(TestBase010):
         if (result.text != expected): 
             self.fail(result) 
 
-        aclf = ACLFile()
+        aclf = self.get_acl_file()
         aclf.write('acl deny bob@QPID create queue name=q2 maxqueuecount=9223372036854775808\n')
         aclf.write('acl allow all all')                                 
         aclf.close()        
@@ -308,7 +319,7 @@ class ACLTests(TestBase010):
         """
         Test cases for queue acl in allow mode
         """
-        aclf = ACLFile()
+        aclf = self.get_acl_file()
         aclf.write('acl deny bob@QPID create queue name=q1 durable=true passive=true\n')
         aclf.write('acl deny bob@QPID create queue name=q2 exclusive=true policytype=ring\n')
         aclf.write('acl deny bob@QPID access queue name=q3\n')
@@ -411,7 +422,7 @@ class ACLTests(TestBase010):
         """
         Test cases for queue acl in deny mode
         """
-        aclf = ACLFile()
+        aclf = self.get_acl_file()
         aclf.write('acl allow bob@QPID create queue name=q1 durable=true passive=true\n')
         aclf.write('acl allow bob@QPID create queue name=q2 exclusive=true policytype=ring\n')
         aclf.write('acl allow bob@QPID access queue name=q3\n')
@@ -534,7 +545,7 @@ class ACLTests(TestBase010):
         """
         Test cases for exchange acl in allow mode
         """
-        aclf = ACLFile()
+        aclf = self.get_acl_file()
         aclf.write('acl deny bob@QPID create exchange name=testEx durable=true passive=true\n')
         aclf.write('acl deny bob@QPID create exchange name=ex1 type=direct\n')
         aclf.write('acl deny bob@QPID access exchange name=myEx queuename=q1 routingkey=rk1.*\n')
@@ -665,7 +676,7 @@ class ACLTests(TestBase010):
         """
         Test cases for exchange acl in deny mode
         """
-        aclf = ACLFile()
+        aclf = self.get_acl_file()
         aclf.write('acl allow bob@QPID create exchange name=myEx durable=true passive=false\n')
         aclf.write('acl allow bob@QPID bind exchange name=amq.topic queuename=bar routingkey=foo.*\n') 
         aclf.write('acl allow bob@QPID unbind exchange name=amq.topic queuename=bar routingkey=foo.*\n')
@@ -772,6 +783,52 @@ class ACLTests(TestBase010):
             if (403 == e.args[0].error_code):
                 self.fail("ACL should allow exchange delete request for myEx");
 
+    def test_create_and_delete_exchange_via_qmf(self):
+        """
+        Test acl is enforced when creating/deleting via QMF
+        methods. Note that in order to be able to send the QMF methods
+        and receive the responses a significant amount of permissions
+        need to be enabled (TODO: can the set below be narrowed down
+        at all?)
+        """
+        aclf = self.get_acl_file()
+        aclf.write('acl allow bob@QPID create exchange\n')
+        aclf.write('acl allow admin@QPID delete exchange\n')
+        aclf.write('acl allow all access exchange\n')
+        aclf.write('acl allow all bind exchange\n')
+        aclf.write('acl allow all create queue\n')
+        aclf.write('acl allow all access queue\n')
+        aclf.write('acl allow all delete queue\n')
+        aclf.write('acl allow all consume queue\n')
+        aclf.write('acl allow all access method\n')
+        aclf.write('acl deny all all')
+        aclf.close()
+
+        result = self.reload_acl()
+        if (result.text.find("format error",0,len(result.text)) != -1):
+            self.fail(result)
+
+        bob = BrokerAdmin(self.config.broker, "bob", "bob")
+        bob.create_exchange("my-exchange") #should pass
+        #cleanup by deleting exchange
+        try:
+            bob.delete_exchange("my-exchange") #should fail
+            self.fail("ACL should deny exchange delete request for my-exchange");
+        except Exception, e:
+            self.assertEqual(7,e.args[0]["error_code"])
+            assert e.args[0]["error_text"].find("unauthorized-access") == 0
+        admin = BrokerAdmin(self.config.broker, "admin", "admin")
+        admin.delete_exchange("my-exchange") #should pass
+
+        anonymous = BrokerAdmin(self.config.broker)
+        try:
+            anonymous.create_exchange("another-exchange") #should fail
+            self.fail("ACL should deny exchange create request for another-exchange");
+        except Exception, e:
+            self.assertEqual(7,e.args[0]["error_code"])
+            assert e.args[0]["error_text"].find("unauthorized-access") == 0
+
+
    #=====================================
    # ACL consume tests
    #=====================================
@@ -780,7 +837,7 @@ class ACLTests(TestBase010):
         """
         Test cases for consume in allow mode
         """
-        aclf = ACLFile()
+        aclf = self.get_acl_file()
         aclf.write('acl deny bob@QPID consume queue name=q1\n')
         aclf.write('acl deny bob@QPID consume queue name=q2\n')                
         aclf.write('acl allow all all')
@@ -826,7 +883,7 @@ class ACLTests(TestBase010):
         """
         Test cases for consume in allow mode
         """
-        aclf = ACLFile()
+        aclf = self.get_acl_file()
         aclf.write('acl allow bob@QPID consume queue name=q1\n')
         aclf.write('acl allow bob@QPID consume queue name=q2\n')
         aclf.write('acl allow bob@QPID create queue\n')                                
@@ -872,7 +929,7 @@ class ACLTests(TestBase010):
         """
         Test various publish acl
         """
-        aclf = ACLFile()
+        aclf = self.get_acl_file()
         aclf.write('acl deny bob@QPID publish exchange name=amq.direct routingkey=rk1\n')
         aclf.write('acl deny bob@QPID publish exchange name=amq.topic\n')
         aclf.write('acl deny bob@QPID publish exchange name=myEx routingkey=rk2\n')                
@@ -921,7 +978,7 @@ class ACLTests(TestBase010):
         """
         Test various publish acl
         """
-        aclf = ACLFile()
+        aclf = self.get_acl_file()
         aclf.write('acl allow bob@QPID publish exchange name=amq.direct routingkey=rk1\n')
         aclf.write('acl allow bob@QPID publish exchange name=amq.topic\n')
         aclf.write('acl allow bob@QPID publish exchange name=myEx routingkey=rk2\n')
@@ -972,3 +1029,49 @@ class ACLTests(TestBase010):
         except qpid.session.SessionException, e:
             if (403 == e.args[0].error_code):
                 self.fail("ACL should allow message transfer to exchange amq.direct with routing key rk1");
+
+class BrokerAdmin:
+    def __init__(self, broker, username=None, password=None):
+        self.connection = qpid.messaging.Connection(broker)
+        if username:
+            self.connection.username = username
+            self.connection.password = password
+            self.connection.sasl_mechanisms = "PLAIN"
+        self.connection.open()
+        self.session = self.connection.session()
+        self.sender = self.session.sender("qmf.default.direct/broker")
+        self.reply_to = "responses-#; {create:always}"
+        self.receiver = self.session.receiver(self.reply_to)
+
+    def invoke(self, method, arguments):
+        content = {
+            "_object_id": {"_object_name": "org.apache.qpid.broker:broker:amqp-broker"},
+            "_method_name": method,
+            "_arguments": arguments
+            }
+        request = qpid.messaging.Message(reply_to=self.reply_to, content=content)
+        request.properties["x-amqp-0-10.app-id"] = "qmf2"
+        request.properties["qmf.opcode"] = "_method_request"
+        self.sender.send(request)
+        response = self.receiver.fetch()
+        self.session.acknowledge()
+        if response.properties['x-amqp-0-10.app-id'] == 'qmf2':
+            if response.properties['qmf.opcode'] == '_method_response':
+                return response.content['_arguments']
+            elif response.properties['qmf.opcode'] == '_exception':
+                raise Exception(response.content['_values'])
+            else: raise Exception("Invalid response received, unexpected opcode: %s" % response.properties['qmf.opcode'])
+        else: raise Exception("Invalid response received, not a qmfv2 method: %s" % response.properties['x-amqp-0-10.app-id'])
+    def create_exchange(self, name, exchange_type=None, options={}):
+        properties = options
+        if exchange_type: properties["exchange_type"] = exchange_type
+        self.invoke("create", {"type": "exchange", "name":name, "properties":properties})
+
+    def create_queue(self, name, properties={}):
+        self.invoke("create", {"type": "queue", "name":name, "properties":properties})
+
+    def delete_exchange(self, name):
+        self.invoke("delete", {"type": "exchange", "name":name})
+
+    def delete_queue(self, name):
+        self.invoke("delete", {"type": "queue", "name":name})

Modified: qpid/branches/qpid-2920/qpid/cpp/src/tests/brokertest.py
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-2920/qpid/cpp/src/tests/brokertest.py?rev=1081634&r1=1081633&r2=1081634&view=diff
==============================================================================
--- qpid/branches/qpid-2920/qpid/cpp/src/tests/brokertest.py (original)
+++ qpid/branches/qpid-2920/qpid/cpp/src/tests/brokertest.py Tue Mar 15 01:54:07 2011
@@ -62,24 +62,6 @@ def is_running(pid):
 class BadProcessStatus(Exception):
     pass
 
-class ExceptionWrapper:
-    """Proxy object that adds a message to exceptions raised"""
-    def __init__(self, obj, msg):
-        self.obj = obj
-        self.msg = msg
-        
-    def __getattr__(self, name):
-        func = getattr(self.obj, name)
-        if type(func) != callable:
-            return func
-        return lambda *args, **kwargs: self._wrap(func, args, kwargs)
-
-    def _wrap(self, func, args, kwargs):
-        try:
-            return func(*args, **kwargs)
-        except Exception, e:
-            raise Exception("%s: %s" %(self.msg, str(e)))
-
 def error_line(filename, n=1):
     """Get the last n line(s) of filename for error messages"""
     result = []
@@ -89,7 +71,8 @@ def error_line(filename, n=1):
             for l in f:
                 if len(result) == n:  result.pop(0)
                 result.append("    "+l)
-        finally: f.close()
+        finally:
+            f.close()
     except: return ""
     return ":\n" + "".join(result)
 
@@ -97,111 +80,85 @@ def retry(function, timeout=10, delay=.0
     """Call function until it returns True or timeout expires.
     Double the delay for each retry. Return True if function
     returns true, False if timeout expires."""
+    deadline = time.time() + timeout
     while not function():
-        if delay > timeout: delay = timeout
+        remaining = deadline - time.time()
+        if remaining <= 0: return False
+        delay = min(delay, remaining)
         time.sleep(delay)
-        timeout -= delay
-        if timeout <= 0: return False
         delay *= 2
     return True
 
+class AtomicCounter:
+    def __init__(self):
+        self.count = 0
+        self.lock = Lock()
+
+    def next(self):
+        self.lock.acquire();
+        ret = self.count
+        self.count += 1
+        self.lock.release();
+        return ret
+
+_popen_id = AtomicCounter() # Popen identifier for use in output file names.
+
+# Constants for file descriptor arguments to Popen
+FILE = "FILE"                       # Write to file named after process
+PIPE = subprocess.PIPE
+
 class Popen(subprocess.Popen):
     """
     Can set and verify expectation of process status at end of test.
     Dumps command line, stdout, stderr to data dir for debugging.
     """
 
-    class DrainThread(Thread):
-        """Thread to drain a file object and write the data to a file."""
-        def __init__(self, infile, outname):
-            Thread.__init__(self)
-            self.infile, self.outname = infile, outname
-            self.outfile = None
-
-        def run(self):
-            try:
-                for line in self.infile:
-                    if self.outfile is None:
-                        self.outfile = open(self.outname, "w")
-                    self.outfile.write(line)
-            finally:
-                self.infile.close()
-                if self.outfile is not None: self.outfile.close()
-
-    class OutStream(ExceptionWrapper):
-        """Wrapper for output streams, handles exceptions & draining output"""
-        def __init__(self, infile, outfile, msg):
-            ExceptionWrapper.__init__(self, infile, msg)
-            self.infile, self.outfile = infile, outfile
-            self.thread = None
-
-        def drain(self):
-            if self.thread is None:
-                self.thread = Popen.DrainThread(self.infile, self.outfile)
-                self.thread.start()
-
-    def outfile(self, ext): return "%s.%s" % (self.pname, ext)
-
-    def __init__(self, cmd, expect=EXPECT_EXIT_OK, drain=True):
-        """Run cmd (should be a list of arguments)
+    def __init__(self, cmd, expect=EXPECT_EXIT_OK, stdin=None, stdout=FILE, stderr=FILE):
+        """Run cmd (should be a list of program and arguments)
         expect - if set verify expectation at end of test.
-        drain  - if true (default) drain stdout/stderr to files.
+        stdout, stderr - can have the same values as for subprocess.Popen as well as
+          FILE (the default) which means write to a file named after the process.
+        stdin - like subprocess.Popen but defauts to PIPE
         """
         self._clean = False
         self._clean_lock = Lock()
         assert find_exe(cmd[0]), "executable not found: "+cmd[0]
         if type(cmd) is type(""): cmd = [cmd] # Make it a list.
         self.cmd  = [ str(x) for x in cmd ]
-        self.returncode = None
         self.expect = expect
-        try:
-            subprocess.Popen.__init__(self, self.cmd, 0, None, subprocess.PIPE, subprocess.PIPE, subprocess.PIPE, close_fds=True)
-        except ValueError:     # Windows can't do close_fds
-            subprocess.Popen.__init__(self, self.cmd, 0, None, subprocess.PIPE, subprocess.PIPE, subprocess.PIPE)
-        self.pname = "%s-%d" % (os.path.split(self.cmd[0])[1], self.pid)
-        msg = "Process %s" % self.pname
-        self.stdin = ExceptionWrapper(self.stdin, msg)
-        self.stdout = Popen.OutStream(self.stdout, self.outfile("out"), msg)
-        self.stderr = Popen.OutStream(self.stderr, self.outfile("err"), msg)
+        self.id = _popen_id.next()
+        self.pname = "%s-%d" % (os.path.split(self.cmd[0])[1], self.id)
+        if stdout == FILE: stdout = open(self.outfile("out"), "w")
+        if stderr == FILE: stderr = open(self.outfile("err"), "w")
+        try:
+            subprocess.Popen.__init__(self, self.cmd, bufsize=0, executable=None,
+                                      stdin=stdin, stdout=stdout, stderr=stderr,
+                                      close_fds=True)
+        except ValueError: # Windows can't do close_fds
+            subprocess.Popen.__init__(self, self.cmd, bufsize=0, executable=None,
+                                      stdin=stdin, stdout=stdout, stderr=stderr)
+
         f = open(self.outfile("cmd"), "w")
-        try: f.write(self.cmd_str())
+        try: f.write("%s\n%d"%(self.cmd_str(), self.pid))
         finally: f.close()
         log.debug("Started process %s: %s" % (self.pname, " ".join(self.cmd)))
-        if drain: self.drain()
 
-        def __str__(self): return "Popen<%s>"%(self.pname)
+    def __str__(self): return "Popen<%s>"%(self.pname)
 
-    def drain(self):
-        """Start threads to drain stdout/err"""
-        self.stdout.drain()
-        self.stderr.drain()
-
-    def _cleanup(self):
-        """Close pipes to sub-process"""
-        self._clean_lock.acquire()
-        try:
-            if self._clean: return
-            self._clean = True
-            self.stdin.close()
-            self.drain()                    # Drain output pipes.
-            self.stdout.thread.join()       # Drain thread closes pipe.
-            self.stderr.thread.join()
-        finally: self._clean_lock.release()
+    def outfile(self, ext): return "%s.%s" % (self.pname, ext)
 
     def unexpected(self,msg):
         err = error_line(self.outfile("err")) or error_line(self.outfile("out"))
         raise BadProcessStatus("%s %s%s" % (self.pname, msg, err))
-    
+
     def stop(self):                  # Clean up at end of test.
         try:
             if self.expect == EXPECT_UNKNOWN:
                 try: self.kill()            # Just make sure its dead
                 except: pass
             elif self.expect == EXPECT_RUNNING:
-                try:
-                    self.kill()
-                except:
-                    self.unexpected("expected running, exit code %d" % self.wait())
+                try: self.kill()
+                except: self.unexpected("expected running, exit code %d" % self.wait())
             else:
                 retry(lambda: self.poll() is not None)
                 if self.returncode is None: # Still haven't stopped
@@ -213,40 +170,21 @@ class Popen(subprocess.Popen):
                     self.unexpected("expected error")
         finally:
             self.wait()                 # Clean up the process.
-               
+
     def communicate(self, input=None):
-        if input:
-            self.stdin.write(input)
-            self.stdin.close()
-        outerr = (self.stdout.read(), self.stderr.read())
-        self.wait()
-        return outerr
+        ret = subprocess.Popen.communicate(self, input)
+        self.cleanup()
+        return ret
 
-    def is_running(self):
-        return self.poll() is None
+    def is_running(self): return self.poll() is None
 
     def assert_running(self):
         if not self.is_running(): self.unexpected("Exit code %d" % self.returncode)
 
-    def poll(self, _deadstate=None): # _deadstate required by base class in python 2.4
-        if self.returncode is None:
-            # Pass _deadstate only if it has been set, there is no _deadstate
-            # parameter in Python 2.6 
-            if _deadstate is None: ret = subprocess.Popen.poll(self)
-            else: ret = subprocess.Popen.poll(self, _deadstate)
-
-            if (ret != -1):
-                self.returncode = ret
-                self._cleanup()
-        return self.returncode
-
     def wait(self):
-        if self.returncode is None:
-            self.drain()
-            try: self.returncode = subprocess.Popen.wait(self)
-            except OSError,e: raise OSError("Wait failed %s: %s"%(self.pname, e))
-            self._cleanup()
-        return self.returncode
+        ret = subprocess.Popen.wait(self)
+        self._cleanup()
+        return ret
 
     def terminate(self):
         try: subprocess.Popen.terminate(self)
@@ -255,7 +193,8 @@ class Popen(subprocess.Popen):
                 os.kill( self.pid , signal.SIGTERM)
             except AttributeError: # no os.kill, using taskkill.. (Windows only)
                 os.popen('TASKKILL /PID ' +str(self.pid) + ' /F')
-            
+        self._cleanup()
+
     def kill(self):
         try: subprocess.Popen.kill(self)
         except AttributeError:          # No terminate method
@@ -263,6 +202,20 @@ class Popen(subprocess.Popen):
                 os.kill( self.pid , signal.SIGKILL)
             except AttributeError: # no os.kill, using taskkill.. (Windows only)
                 os.popen('TASKKILL /PID ' +str(self.pid) + ' /F')
+        self._cleanup()
+
+    def _cleanup(self):
+        """Clean up after a dead process"""
+        self._clean_lock.acquire()
+        if not self._clean:
+            self._clean = True
+            try: self.stdin.close()
+            except: pass
+            try: self.stdout.close()
+            except: pass
+            try: self.stderr.close()
+            except: pass
+        self._clean_lock.release()
 
     def cmd_str(self): return " ".join([str(s) for s in self.cmd])
 
@@ -289,7 +242,7 @@ class Broker(Popen):
         while (os.path.exists(self.log)):
             self.log = "%s-%d.log" % (self.name, i)
             i += 1
-    
+
     def get_log(self):
         return os.path.abspath(self.log)
 
@@ -319,10 +272,10 @@ class Broker(Popen):
         cmd += ["--log-to-file", self.log]
         cmd += ["--log-to-stderr=no"]
         if log_level != None:
-            cmd += ["--log-enable=%s" % log_level] 
+            cmd += ["--log-enable=%s" % log_level]
         self.datadir = self.name
         cmd += ["--data-dir", self.datadir]
-        Popen.__init__(self, cmd, expect, drain=False)
+        Popen.__init__(self, cmd, expect, stdout=PIPE)
         test.cleanup_stop(self)
         self._host = "127.0.0.1"
         log.debug("Started broker %s (%s, %s)" % (self.name, self.pname, self.log))
@@ -362,7 +315,7 @@ class Broker(Popen):
         s = c.session(str(qpid.datatypes.uuid4()))
         s.queue_declare(queue=queue)
         c.close()
-    
+
     def _prep_sender(self, queue, durable, xprops):
         s = queue + "; {create:always, node:{durable:" + str(durable)
         if xprops != None: s += ", x-declare:{" + xprops + "}"
@@ -406,13 +359,14 @@ class Broker(Popen):
 
     def log_ready(self):
         """Return true if the log file exists and contains a broker ready message"""
-        if self._log_ready: return True
-        self._log_ready = find_in_file("notice Broker running", self.log)
+        if not self._log_ready:
+            self._log_ready = find_in_file("notice Broker running", self.log)
+        return self._log_ready
 
     def ready(self, **kwargs):
         """Wait till broker is ready to serve clients"""
         # First make sure the broker is listening by checking the log.
-        if not retry(self.log_ready, timeout=30):
+        if not retry(self.log_ready, timeout=60):
             raise Exception(
                 "Timed out waiting for broker %s%s"%(self.name, error_line(self.log,5)))
         # Create a connection and a session. For a cluster broker this will
@@ -421,17 +375,19 @@ class Broker(Popen):
             c = self.connect(**kwargs)
             try: c.session()
             finally: c.close()
-        except: raise RethrownException(
-            "Broker %s failed ready test%s"%(self.name,error_line(self.log, 5)))
+        except Exception,e: raise RethrownException(
+            "Broker %s not responding: (%s)%s"%(self.name,e,error_line(self.log, 5)))
 
     def store_state(self):
-        uuids = open(os.path.join(self.datadir, "cluster", "store.status")).readlines()
+        f = open(os.path.join(self.datadir, "cluster", "store.status"))
+        try: uuids = f.readlines()
+        finally: f.close()
         null_uuid="00000000-0000-0000-0000-000000000000\n"
         if len(uuids) < 2: return "unknown" # we looked while the file was being updated.
         if uuids[0] == null_uuid: return "empty"
         if uuids[1] == null_uuid: return "dirty"
         return "clean"
-        
+
 class Cluster:
     """A cluster of brokers in a test."""
 
@@ -495,7 +451,7 @@ class BrokerTest(TestCase):
     rootdir = os.getcwd()
 
     def configure(self, config): self.config=config
-    
+
     def setUp(self):
         outdir = self.config.defines.get("OUTDIR") or "brokertest.tmp"
         self.dir = os.path.join(self.rootdir, outdir, self.id())
@@ -516,10 +472,10 @@ class BrokerTest(TestCase):
         """Call thing.stop at end of test"""
         self.stopem.append(stopable)
 
-    def popen(self, cmd, expect=EXPECT_EXIT_OK, drain=True):
+    def popen(self, cmd, expect=EXPECT_EXIT_OK, stdin=None, stdout=FILE, stderr=FILE):
         """Start a process that will be killed at end of test, in the test dir."""
         os.chdir(self.dir)
-        p = Popen(cmd, expect, drain)
+        p = Popen(cmd, expect, stdin=stdin, stdout=stdout, stderr=stderr)
         self.cleanup_stop(p)
         return p
 
@@ -570,7 +526,7 @@ class StoppableThread(Thread):
         self.stopped = True
         self.join()
         if self.error: raise self.error
-    
+
 class NumberedSender(Thread):
     """
     Thread to run a sender client and send numbered messages until stopped.
@@ -589,7 +545,8 @@ class NumberedSender(Thread):
              "--failover-updates",
              "--content-stdin"
              ],
-            expect=EXPECT_RUNNING)
+            expect=EXPECT_RUNNING,
+            stdin=PIPE)
         self.condition = Condition()
         self.max = max_depth
         self.received = 0
@@ -629,7 +586,7 @@ class NumberedSender(Thread):
         self.join()
         self.write_message(-1)          # end-of-messages marker.
         if self.error: raise self.error
-        
+
 class NumberedReceiver(Thread):
     """
     Thread to run a receiver client and verify it receives
@@ -649,14 +606,14 @@ class NumberedReceiver(Thread):
              "--forever"
              ],
             expect=EXPECT_RUNNING,
-            drain=False)
+            stdout=PIPE)
         self.lock = Lock()
         self.error = None
         self.sender = sender
 
     def read_message(self):
         return int(self.receiver.stdout.readline())
-    
+
     def run(self):
         try:
             self.received = 0
@@ -688,7 +645,7 @@ class ErrorGenerator(StoppableThread):
         self.broker=broker
         broker.test.cleanup_stop(self)
         self.start()
-        
+
     def run(self):
         c = self.broker.connect_old()
         try:

Modified: qpid/branches/qpid-2920/qpid/cpp/src/tests/cli_tests.py
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-2920/qpid/cpp/src/tests/cli_tests.py?rev=1081634&r1=1081633&r2=1081634&view=diff
==============================================================================
--- qpid/branches/qpid-2920/qpid/cpp/src/tests/cli_tests.py (original)
+++ qpid/branches/qpid-2920/qpid/cpp/src/tests/cli_tests.py Tue Mar 15 01:54:07 2011
@@ -365,6 +365,26 @@ class CliTests(TestBase010):
                 self.assertEqual(queue._altExchange_.name, altName)
         self.assertEqual(found, True)
 
+    def test_qpid_config_list_queues_arguments(self):
+        """
+        Test to verify that when the type of a policy limit is
+        actually a string (though still a valid value), it does not
+        upset qpid-config
+        """
+        self.startQmf();
+        qmf = self.qmf
+
+        names = ["queue_capacity%s" % (i) for i in range(1, 6)]
+        for name in names:
+            self.session.queue_declare(queue=name, exclusive=True,
+                                       arguments={'qpid.max_count' : str(i), 'qpid.max_size': '100'})
+
+        output = os.popen(self.qpid_config_command(" queues")).readlines()
+        queues = [line.split()[0] for line in output[2:len(output)]] #ignore first two lines (header)
+
+        for name in names:
+            assert name in queues, "%s not in %s" % (name, queues)
+
     def test_qpid_route(self):
         self.startQmf();
         qmf = self.qmf
@@ -405,7 +425,7 @@ class CliTests(TestBase010):
         qmf = self.qmf
 
         ret = self.qpid_route_api("dynamic add "
-                                  + " --sasl-mechanism PLAIN "
+                                  + " --client-sasl-mechanism PLAIN "
                                   + "guest/guest@localhost:"+str(self.broker.port) + " "
                                   + str(self.remote_host())+":"+str(self.remote_port()) + " "
                                   +"amq.direct")
@@ -424,7 +444,7 @@ class CliTests(TestBase010):
         qmf = self.qmf
 
         ret = self.qpid_route_api("dynamic add "
-                                  + " --sasl-mechanism PLAIN "
+                                  + " --client-sasl-mechanism PLAIN "
                                   + "localhost:"+str(self.broker.port) + " "
                                   + str(self.remote_host())+":"+str(self.remote_port()) + " "
                                   +"amq.direct")

Modified: qpid/branches/qpid-2920/qpid/cpp/src/tests/cluster_test_logs.py
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-2920/qpid/cpp/src/tests/cluster_test_logs.py?rev=1081634&r1=1081633&r2=1081634&view=diff
==============================================================================
--- qpid/branches/qpid-2920/qpid/cpp/src/tests/cluster_test_logs.py (original)
+++ qpid/branches/qpid-2920/qpid/cpp/src/tests/cluster_test_logs.py Tue Mar 15 01:54:07 2011
@@ -60,9 +60,11 @@ def filter_log(log):
         'task overran',
         'warning CLOSING .* unsent data',
         'Inter-broker link ',
-        'Running in a cluster, marking store'
+        'Running in a cluster, marking store',
+        'debug Sending keepalive signal to watchdog', # Watchdog timer thread
+        'last broker standing joined by 1 replicas, updating queue policies.',
+        'Connection .* timed out: closing' # heartbeat connection close
         ])
-    skip_re = re.compile(skip)
     # Regex to match a UUID
     uuid='\w\w\w\w\w\w\w\w-\w\w\w\w-\w\w\w\w-\w\w\w\w-\w\w\w\w\w\w\w\w\w\w\w\w'
     # Substitutions to remove expected differences
@@ -80,6 +82,13 @@ def filter_log(log):
         (r' map={.*_object_name:([^,}]*)[,}].*', r' \1'), # V2 map - just keep name
         (r'\d+-\d+-\d+--\d+', 'X-X-X--X'), # V1 Object IDs
         ]
+    # Substitutions to mask known issue: durable test shows inconsistent "changed stats for com.redhat.rhm.store:journal" messages.
+    skip += '|Changed V[12] statistics com.redhat.rhm.store:journal'
+    subs += [(r'to=console.obj.1.0.com.redhat.rhm.store.journal props=\d+ stats=\d+',
+              'to=console.obj.1.0.com.redhat.rhm.store.journal props=NN stats=NN')]
+
+    skip_re = re.compile(skip)
+    subs = [(re.compile(pattern), subst) for pattern, subst in subs]
     for l in open(log):
         if skip_re.search(l): continue
         for pattern,subst in subs: l = re.sub(pattern,subst,l)

Modified: qpid/branches/qpid-2920/qpid/cpp/src/tests/cluster_tests.py
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-2920/qpid/cpp/src/tests/cluster_tests.py?rev=1081634&r1=1081633&r2=1081634&view=diff
==============================================================================
--- qpid/branches/qpid-2920/qpid/cpp/src/tests/cluster_tests.py (original)
+++ qpid/branches/qpid-2920/qpid/cpp/src/tests/cluster_tests.py Tue Mar 15 01:54:07 2011
@@ -22,7 +22,7 @@ import os, signal, sys, time, imp, re, s
 from qpid import datatypes, messaging
 from brokertest import *
 from qpid.harness import Skipped
-from qpid.messaging import Message, Empty
+from qpid.messaging import Message, Empty, Disposition, REJECTED
 from threading import Thread, Lock, Condition
 from logging import getLogger
 from itertools import chain
@@ -246,25 +246,6 @@ acl allow all all
         session1 = cluster[1].connect().session()
         for q in queues: self.assert_browse(session1, "q1", ["foo"])
 
-    def test_dr_no_message(self):
-        """Regression test for https://bugzilla.redhat.com/show_bug.cgi?id=655141
-        Joining broker crashes with 'error deliveryRecord no update message'
-        """
-
-        cluster = self.cluster(1)
-        session0 = cluster[0].connect().session()
-        s = session0.sender("q1;{create:always}")
-        s.send(Message("a", ttl=0.05), sync=False)
-        s.send(Message("b", ttl=0.05), sync=False)
-        r1 = session0.receiver("q1")
-        self.assertEqual("a", r1.fetch(timeout=0).content)
-        r2 = session0.receiver("q1;{mode:browse}")
-        self.assertEqual("b", r2.fetch(timeout=0).content)
-        # Leave messages un-acknowledged, let the expire, then start new broker.
-        time.sleep(.1)
-        cluster.start()
-        self.assertRaises(Empty, cluster[1].connect().session().receiver("q1").fetch,0)
-
     def test_route_update(self):
         """Regression test for https://issues.apache.org/jira/browse/QPID-2982
         Links and bridges associated with routes were not replicated on update.
@@ -304,6 +285,36 @@ acl allow all all
         # Verify logs are consistent
         cluster_test_logs.verify_logs()
 
+    def test_redelivered(self):
+        """Verify that redelivered flag is set correctly on replayed messages"""
+        cluster = self.cluster(2, expect=EXPECT_EXIT_FAIL)
+        url = "amqp:tcp:%s,tcp:%s" % (cluster[0].host_port(), cluster[1].host_port())
+        queue = "my-queue"
+        cluster[0].declare_queue(queue)
+        self.sender = self.popen(
+            ["qpid-send",
+             "--broker", url,
+             "--address", queue,
+             "--sequence=true",
+             "--send-eos=1",
+             "--messages=100000",
+             "--connection-options={reconnect:true}"
+             ])
+        self.receiver = self.popen(
+            ["qpid-receive",
+             "--broker", url,
+             "--address", queue,
+             "--ignore-duplicates",
+             "--check-redelivered",
+             "--connection-options={reconnect:true}",
+             "--forever"
+             ])
+        time.sleep(1)#give sender enough time to have some messages to replay
+        cluster[0].kill()
+        self.sender.wait()
+        self.receiver.wait()
+        cluster[1].kill()
+
     class BlockedSend(Thread):
         """Send a message, send is expected to block.
         Verify that it does block (for a given timeout), then allow
@@ -411,6 +422,33 @@ acl allow all all
                 return cluster[1]
         self.queue_flowlimit_test(Brokers())
 
+    def test_alternate_exchange_update(self):
+        """Verify that alternate-exchange on exchanges and queues is propagated to new members of a cluster. """
+        cluster = self.cluster(1)
+        s0 = cluster[0].connect().session()
+        # create alt queue bound to amq.fanout exchange, will be destination for alternate exchanges
+        self.evaluate_address(s0, "alt;{create:always,node:{x-bindings:[{exchange:'amq.fanout',queue:alt}]}}")
+        # create direct exchange ex with alternate-exchange amq.fanout and no queues bound
+        self.evaluate_address(s0, "ex;{create:always,node:{type:topic, x-declare:{type:'direct', alternate-exchange:'amq.fanout'}}}")
+        # create queue q with alternate-exchange amq.fanout
+        self.evaluate_address(s0, "q;{create:always,node:{type:queue, x-declare:{alternate-exchange:'amq.fanout'}}}")
+
+        def verify(broker):
+            s = broker.connect().session()
+            # Verify unmatched message goes to ex's alternate.
+            s.sender("ex").send("foo")
+            self.assertEqual("foo", s.receiver("alt").fetch(timeout=0).content)
+            # Verify rejected message goes to q's alternate.
+            s.sender("q").send("bar")
+            msg = s.receiver("q").fetch(timeout=0)
+            self.assertEqual("bar", msg.content)
+            s.acknowledge(msg, Disposition(REJECTED)) # Reject the message
+            self.assertEqual("bar", s.receiver("alt").fetch(timeout=0).content)
+
+        verify(cluster[0])
+        cluster.start()
+        verify(cluster[1])
+
 class LongTests(BrokerTest):
     """Tests that can run for a long time if -DDURATION=<minutes> is set"""
     def duration(self):
@@ -469,24 +507,24 @@ class LongTests(BrokerTest):
                             if self.stopped: break
                             self.process = self.broker.test.popen(
                                 self.cmd, expect=EXPECT_UNKNOWN)
-                        finally: self.lock.release()
-                        try: exit = self.process.wait()
+                        finally:
+                            self.lock.release()
+                        try:
+                            exit = self.process.wait()
                         except OSError, e:
-                            # Seems to be a race in wait(), it throws
-                            # "no such process" during test shutdown.
-                            # Doesn't indicate a test error, ignore.
-                            return
+                            # Process may already have been killed by self.stop()
+                            break
                         except Exception, e:
                             self.process.unexpected(
                                 "client of %s: %s"%(self.broker.name, e))
                         self.lock.acquire()
                         try:
-                            # Quit and ignore errors if stopped or expecting failure.
                             if self.stopped: break
                             if exit != 0:
                                 self.process.unexpected(
                                     "client of %s exit code %s"%(self.broker.name, exit))
-                        finally: self.lock.release()
+                        finally:
+                            self.lock.release()
                 except Exception, e:
                     self.error = RethrownException("Error in ClientLoop.run")
 
@@ -517,8 +555,10 @@ class LongTests(BrokerTest):
             """Start ordinary clients for a broker."""
             cmds=[
                 ["qpid-tool", "localhost:%s"%(broker.port())],
-                ["qpid-perftest", "--count", 50000,
+                ["qpid-perftest", "--count=5000", "--durable=yes",
                  "--base-name", str(qpid.datatypes.uuid4()), "--port", broker.port()],
+                ["qpid-txtest", "--queue-base-name", "tx-%s"%str(qpid.datatypes.uuid4()),
+                 "--port", broker.port()],
                 ["qpid-queue-stats", "-a", "localhost:%s" %(broker.port())],
                 ["testagent", "localhost", str(broker.port())] ]
             clients.append([ClientLoop(broker, cmd) for cmd in cmds])
@@ -529,7 +569,8 @@ class LongTests(BrokerTest):
             mclients.append(ClientLoop(broker, cmd))
 
         endtime = time.time() + self.duration()
-        runtime = self.duration() / 4   # First run is longer, use quarter of duration.
+        # For long duration, first run is a quarter of the duration.
+        runtime = max(5, self.duration() / 4.0)
         alive = 0                       # First live cluster member
         for i in range(len(cluster)): start_clients(cluster[i])
         start_mclients(cluster[alive])
@@ -555,14 +596,13 @@ class LongTests(BrokerTest):
             start_mclients(cluster[alive])
         for c in chain(mclients, *clients):
             c.stop()
-
         # Verify that logs are consistent
         cluster_test_logs.verify_logs()
 
     def test_management_qmf2(self):
         self.test_management(args=["--mgmt-qmf2=yes"])
 
-    def test_connect_consistent(self):   # FIXME aconway 2011-01-18:
+    def test_connect_consistent(self):
         args=["--mgmt-pub-interval=1","--log-enable=trace+:management"]
         cluster = self.cluster(2, args=args)
         end = time.time() + self.duration()

Modified: qpid/branches/qpid-2920/qpid/cpp/src/tests/python_tests
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-2920/qpid/cpp/src/tests/python_tests?rev=1081634&r1=1081633&r2=1081634&view=diff
==============================================================================
--- qpid/branches/qpid-2920/qpid/cpp/src/tests/python_tests (original)
+++ qpid/branches/qpid-2920/qpid/cpp/src/tests/python_tests Tue Mar 15 01:54:07 2011
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 
 #
 # Licensed to the Apache Software Foundation (ASF) under one

Modified: qpid/branches/qpid-2920/qpid/cpp/src/tests/qpid-perftest.cpp
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-2920/qpid/cpp/src/tests/qpid-perftest.cpp?rev=1081634&r1=1081633&r2=1081634&view=diff
==============================================================================
--- qpid/branches/qpid-2920/qpid/cpp/src/tests/qpid-perftest.cpp (original)
+++ qpid/branches/qpid-2920/qpid/cpp/src/tests/qpid-perftest.cpp Tue Mar 15 01:54:07 2011
@@ -423,8 +423,10 @@ struct Controller : public Client {
                 process(opts.totalSubs, subDone, fqn("sub_done"), boost::ref(subRates));
 
                 AbsTime end=now();
-
                 double time=secs(start, end);
+		if (time <= 0.0) {
+		  throw Exception("ERROR: Test completed in zero seconds. Try again with a larger message count.");
+		}
                 double txrate=opts.transfers/time;
                 double mbytes=(txrate*opts.size)/(1024*1024);
 
@@ -543,6 +545,9 @@ struct PublishThread : public Client {
                 if (opts.confirm) session.sync();
                 AbsTime end=now();
                 double time=secs(start,end);
+		if (time <= 0.0) {
+		  throw Exception("ERROR: Test completed in zero seconds. Try again with a larger message count.");
+		}
 
                 // Send result to controller.
                 Message report(lexical_cast<string>(opts.count/time), fqn("pub_done"));

Modified: qpid/branches/qpid-2920/qpid/cpp/src/tests/qpid-receive.cpp
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-2920/qpid/cpp/src/tests/qpid-receive.cpp?rev=1081634&r1=1081633&r2=1081634&view=diff
==============================================================================
--- qpid/branches/qpid-2920/qpid/cpp/src/tests/qpid-receive.cpp (original)
+++ qpid/branches/qpid-2920/qpid/cpp/src/tests/qpid-receive.cpp Tue Mar 15 01:54:07 2011
@@ -53,6 +53,7 @@ struct Options : public qpid::Options
     bool forever;
     uint messages;
     bool ignoreDuplicates;
+    bool checkRedelivered;
     uint capacity;
     uint ackFrequency;
     uint tx;
@@ -75,6 +76,7 @@ struct Options : public qpid::Options
           forever(false),
           messages(0),
           ignoreDuplicates(false),
+          checkRedelivered(false),
           capacity(1000),
           ackFrequency(100),
           tx(0),
@@ -96,6 +98,7 @@ struct Options : public qpid::Options
             ("forever,f", qpid::optValue(forever), "ignore timeout and wait forever")
             ("messages,m", qpid::optValue(messages, "N"), "Number of messages to receive; 0 means receive indefinitely")
             ("ignore-duplicates", qpid::optValue(ignoreDuplicates), "Detect and ignore duplicates (by checking 'sn' header)")
+            ("check-redelivered", qpid::optValue(checkRedelivered), "Fails with exception if a duplicate is not marked as redelivered (only relevant when ignore-duplicates is selected)")
             ("capacity", qpid::optValue(capacity, "N"), "Pre-fetch window (0 implies no pre-fetch)")
             ("ack-frequency", qpid::optValue(ackFrequency, "N"), "Ack frequency (0 implies none of the messages will get accepted)")
             ("tx", qpid::optValue(tx, "N"), "batch size for transactions (0 implies transaction are not used)")
@@ -216,6 +219,8 @@ int main(int argc, char ** argv)
                             std::cout << msg.getContent() << std::endl;//TODO: handle map or list messages
                         if (opts.messages && count >= opts.messages) done = true;
                     }
+                } else if (opts.checkRedelivered && !msg.getRedelivered()) {
+                    throw qpid::Exception("duplicate sequence number received, message not marked as redelivered!");
                 }
                 if (opts.tx && (count % opts.tx == 0)) {
                     if (opts.rollbackFrequency && (++txCount % opts.rollbackFrequency == 0)) {

Modified: qpid/branches/qpid-2920/qpid/cpp/src/tests/queue_flow_limit_tests.py
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-2920/qpid/cpp/src/tests/queue_flow_limit_tests.py?rev=1081634&r1=1081633&r2=1081634&view=diff
==============================================================================
--- qpid/branches/qpid-2920/qpid/cpp/src/tests/queue_flow_limit_tests.py (original)
+++ qpid/branches/qpid-2920/qpid/cpp/src/tests/queue_flow_limit_tests.py Tue Mar 15 01:54:07 2011
@@ -137,12 +137,12 @@ class QueueFlowLimitTests(TestBase010):
         """
         self.startQmf();
         oid = self._create_queue("test-q", stop_count=373, resume_count=229)
+        self.assertEqual(self.qmf.getObjects(_objectId=oid)[0].flowStoppedCount, 0)
 
         sndr1 = self._start_qpid_send("test-q", count=1213, content="XXX", capacity=50);
         sndr2 = self._start_qpid_send("test-q", count=797, content="Y", capacity=13);
         sndr3 = self._start_qpid_send("test-q", count=331, content="ZZZZZ", capacity=149);
         totalMsgs = 1213 + 797 + 331
-        
 
         # wait until flow control is active
         count = 0
@@ -180,6 +180,7 @@ class QueueFlowLimitTests(TestBase010):
 
         self.assertEqual(count, totalMsgs)
         self.failIf(self.qmf.getObjects(_objectId=oid)[0].flowStopped)
+        self.failUnless(self.qmf.getObjects(_objectId=oid)[0].flowStoppedCount)
 
         self._delete_queue("test-q")
 

Modified: qpid/branches/qpid-2920/qpid/cpp/src/tests/replication_test
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-2920/qpid/cpp/src/tests/replication_test?rev=1081634&r1=1081633&r2=1081634&view=diff
==============================================================================
--- qpid/branches/qpid-2920/qpid/cpp/src/tests/replication_test (original)
+++ qpid/branches/qpid-2920/qpid/cpp/src/tests/replication_test Tue Mar 15 01:54:07 2011
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 
 #
 # Licensed to the Apache Software Foundation (ASF) under one

Modified: qpid/branches/qpid-2920/qpid/cpp/src/tests/run_acl_tests
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-2920/qpid/cpp/src/tests/run_acl_tests?rev=1081634&r1=1081633&r2=1081634&view=diff
==============================================================================
--- qpid/branches/qpid-2920/qpid/cpp/src/tests/run_acl_tests (original)
+++ qpid/branches/qpid-2920/qpid/cpp/src/tests/run_acl_tests Tue Mar 15 01:54:07 2011
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 
 #
 # Licensed to the Apache Software Foundation (ASF) under one

Modified: qpid/branches/qpid-2920/qpid/cpp/src/tests/run_cli_tests
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-2920/qpid/cpp/src/tests/run_cli_tests?rev=1081634&r1=1081633&r2=1081634&view=diff
==============================================================================
--- qpid/branches/qpid-2920/qpid/cpp/src/tests/run_cli_tests (original)
+++ qpid/branches/qpid-2920/qpid/cpp/src/tests/run_cli_tests Tue Mar 15 01:54:07 2011
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 
 #
 # Licensed to the Apache Software Foundation (ASF) under one
@@ -70,7 +70,8 @@ stop_brokers() {
 if test -d ${PYTHON_DIR} ;  then
     start_brokers
     echo "Running CLI tests using brokers on ports $LOCAL_PORT $REMOTE_PORT"
-    $QPID_PYTHON_TEST -m cli_tests -b localhost:$LOCAL_PORT -Dremote-port=$REMOTE_PORT -Dcli-dir=$CLI_DIR $targs $@
+    PYTHON_TESTS=${PYTHON_TESTS:-$*}
+    $QPID_PYTHON_TEST -m cli_tests -b localhost:$LOCAL_PORT -Dremote-port=$REMOTE_PORT -Dcli-dir=$CLI_DIR $targs $PYTHON_TESTS $@
     RETCODE=$?
     stop_brokers
     if test x$RETCODE != x0; then 

Modified: qpid/branches/qpid-2920/qpid/cpp/src/tests/run_federation_tests
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-2920/qpid/cpp/src/tests/run_federation_tests?rev=1081634&r1=1081633&r2=1081634&view=diff
==============================================================================
--- qpid/branches/qpid-2920/qpid/cpp/src/tests/run_federation_tests (original)
+++ qpid/branches/qpid-2920/qpid/cpp/src/tests/run_federation_tests Tue Mar 15 01:54:07 2011
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 
 #
 # Licensed to the Apache Software Foundation (ASF) under one

Modified: qpid/branches/qpid-2920/qpid/cpp/src/tests/run_header_test
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-2920/qpid/cpp/src/tests/run_header_test?rev=1081634&r1=1081633&r2=1081634&view=diff
==============================================================================
--- qpid/branches/qpid-2920/qpid/cpp/src/tests/run_header_test (original)
+++ qpid/branches/qpid-2920/qpid/cpp/src/tests/run_header_test Tue Mar 15 01:54:07 2011
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 
 #
 # Licensed to the Apache Software Foundation (ASF) under one

Modified: qpid/branches/qpid-2920/qpid/cpp/src/tests/run_test
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-2920/qpid/cpp/src/tests/run_test?rev=1081634&r1=1081633&r2=1081634&view=diff
==============================================================================
--- qpid/branches/qpid-2920/qpid/cpp/src/tests/run_test (original)
+++ qpid/branches/qpid-2920/qpid/cpp/src/tests/run_test Tue Mar 15 01:54:07 2011
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 
 # Licensed to the Apache Software Foundation (ASF) under one
 # or more contributor license agreements.  See the NOTICE file

Modified: qpid/branches/qpid-2920/qpid/cpp/src/tests/sasl.mk
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-2920/qpid/cpp/src/tests/sasl.mk?rev=1081634&r1=1081633&r2=1081634&view=diff
==============================================================================
--- qpid/branches/qpid-2920/qpid/cpp/src/tests/sasl.mk (original)
+++ qpid/branches/qpid-2920/qpid/cpp/src/tests/sasl.mk Tue Mar 15 01:54:07 2011
@@ -30,9 +30,20 @@ check_PROGRAMS+=sasl_version
 sasl_version_SOURCES=sasl_version.cpp
 sasl_version_LDADD=$(lib_client)
 
-TESTS += run_cluster_authentication_test sasl_fed sasl_fed_ex
+TESTS += run_cluster_authentication_test sasl_fed sasl_fed_ex_dynamic sasl_fed_ex_link sasl_fed_ex_queue sasl_fed_ex_route sasl_fed_ex_route_cluster sasl_fed_ex_link_cluster sasl_fed_ex_queue_cluster sasl_fed_ex_dynamic_cluster
 LONG_TESTS += run_cluster_authentication_soak
-EXTRA_DIST += run_cluster_authentication_test sasl_fed sasl_fed_ex run_cluster_authentication_soak
+EXTRA_DIST += run_cluster_authentication_test \
+              sasl_fed                        \
+              sasl_fed_ex                     \
+              run_cluster_authentication_soak \
+              sasl_fed_ex_dynamic             \
+              sasl_fed_ex_link                \
+              sasl_fed_ex_queue               \
+              sasl_fed_ex_route               \
+              sasl_fed_ex_dynamic_cluster     \
+              sasl_fed_ex_link_cluster        \
+              sasl_fed_ex_queue_cluster       \
+              sasl_fed_ex_route_cluster
 
 
 endif # HAVE_SASL

Modified: qpid/branches/qpid-2920/qpid/cpp/src/tests/sasl_fed_ex
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-2920/qpid/cpp/src/tests/sasl_fed_ex?rev=1081634&r1=1081633&r2=1081634&view=diff
==============================================================================
--- qpid/branches/qpid-2920/qpid/cpp/src/tests/sasl_fed_ex (original)
+++ qpid/branches/qpid-2920/qpid/cpp/src/tests/sasl_fed_ex Tue Mar 15 01:54:07 2011
@@ -21,20 +21,49 @@
 
 
 #===============================================================================
-# This test creates a federated link between two brokers using SASL security.
+# These tests create federated links between two brokers using SASL security.
 # The SASL mechanism used is EXTERNAL, which is satisfied by SSL
 # transport-layer security.
 #===============================================================================
 
 source ./test_env.sh
 
+script_name=`basename $0`
+
+if [ $# -lt 1 ] || [ $# -gt 2 ]
+then
+  echo
+  # These are the four different ways of creating links ( or routes+links ) 
+  # that the qpid-route command provides.
+  echo "Usage: ${script_name} dynamic|link|queue|route [cluster]"
+  echo
+  exit 1
+fi
+
+# Has the user told us to do clustering ? -----------
+clustering_flag=
+if [ $# -eq "2" ] && [ "$2" == "cluster" ]; then
+  clustering_flag=true
+fi
+
+qpid_route_method=$1
+
+# Debugging print. --------------------------
+debug=
+function print {
+  if [ "$debug" ]; then
+    echo "${script_name}: $1"
+  fi
+}
+
+
 
 # This minimum value corresponds to sasl version 2.1.22
 minimum_sasl_version=131350
 
 sasl_version=`$QPID_TEST_EXEC_DIR/sasl_version`
 
-# This test is necessary becasue this sasl version is the first one that permits 
+# This test is necessary because this sasl version is the first one that permits 
 # redirection of the sasl config file path.
 if [ "$sasl_version" -lt  "$minimum_sasl_version" ]; then
   echo "sasl_fed: must have sasl version 2.1.22 or greater.  ( Integer value: $minimum_sasl_version )  Version is: $sasl_version"
@@ -60,6 +89,7 @@ create_certs() {
 
 delete_certs() {
     if [[ -e ${CERT_DIR} ]] ;  then
+        print "removing cert dir ${CERT_DIR}"
         rm -rf ${CERT_DIR}
     fi
 }
@@ -75,19 +105,31 @@ delete_certs
 create_certs || error "Could not create test certificate"
 
 
-sasl_config_file=$builddir/sasl_config
+sasl_config_dir=$builddir/sasl_config
 
-my_random_number=$RANDOM
-tmp_root=/tmp/sasl_fed_$my_random_number
+tmp_root=${builddir}/sasl_fed_ex_temp
+print "results dir is ${tmp_root}"
+rm -rf ${tmp_root}
 mkdir -p $tmp_root
 
 SRC_SSL_PORT=6667
 DST_SSL_PORT=6666
 
+SRC_SSL_PORT_2=6668
+DST_SSL_PORT_2=6669
+
 SRC_TCP_PORT=5801
 DST_TCP_PORT=5807
 
-SSL_LIB=../.libs/ssl.so
+SRC_TCP_PORT_2=5802
+DST_TCP_PORT_2=5803
+
+CLUSTER_1_NAME=sasl_fed_ex_cluster_1
+CLUSTER_2_NAME=sasl_fed_ex_cluster_2
+
+
+SSL_LIB=${moduledir}/ssl.so
+CLUSTER_LIB=${moduledir}/cluster.so
 
 export QPID_SSL_CERT_NAME=${TEST_HOSTNAME}
 
@@ -116,52 +158,109 @@ export QPID_SSL_CERT_NAME=${TEST_HOSTNAM
 #  5. DST pulls messages off the temp queue on SRC to itself.
 #
 
+COMMON_BROKER_OPTIONS="                          \
+      --ssl-sasl-no-dict                         \
+      --sasl-config=$sasl_config_dir            \
+      --ssl-require-client-authentication        \
+      --auth yes                                 \
+      --ssl-cert-db $CERT_DIR                    \
+      --ssl-cert-password-file $CERT_PW_FILE     \
+      --ssl-cert-name $TEST_HOSTNAME             \
+      --no-data-dir                              \
+      --no-module-dir                            \
+      --load-module ${SSL_LIB}                   \
+      --load-module ${CLUSTER_LIB}               \
+      --mgmt-enable=yes                          \
+      --log-enable info+                         \
+      --log-source yes                           \
+      --daemon "                                 
+                      
+
+function start_brokers {
+  if [ $1 ]; then
+    # clustered ----------------------------------------
+    print "Starting SRC cluster"
+
+    print "  src broker 1"
+    $QPIDD_EXEC                                  \
+      --port=${SRC_TCP_PORT}                     \
+      --ssl-port ${SRC_SSL_PORT}                 \
+      ${COMMON_BROKER_OPTIONS}                   \
+      --cluster-name ${CLUSTER_1_NAME}           \
+      --log-to-file $tmp_root/qpidd_src.log 2> /dev/null
+
+    broker_ports[0]=${SRC_TCP_PORT}
+
+    print "  src broker 2"
+    $QPIDD_EXEC                                  \
+      --port=${SRC_TCP_PORT_2}                   \
+      --ssl-port ${SRC_SSL_PORT_2}               \
+      ${COMMON_BROKER_OPTIONS}                   \
+      --cluster-name ${CLUSTER_1_NAME}           \
+      --log-to-file $tmp_root/qpidd_src_2.log 2> /dev/null
+
+    broker_ports[1]=${SRC_TCP_PORT_2}
+
+
+    print "Starting DST cluster"
+
+    print "  dst broker 1"
+    $QPIDD_EXEC                                  \
+      --port=${DST_TCP_PORT}                     \
+      --ssl-port ${DST_SSL_PORT}                 \
+      ${COMMON_BROKER_OPTIONS}                   \
+      --cluster-name ${CLUSTER_2_NAME}           \
+      --log-to-file $tmp_root/qpidd_dst.log 2> /dev/null
+
+    broker_ports[2]=${DST_TCP_PORT}
+
+    print "  dst broker 2"
+    $QPIDD_EXEC                                  \
+      --port=${DST_TCP_PORT_2}                   \
+      --ssl-port ${DST_SSL_PORT_2}               \
+      ${COMMON_BROKER_OPTIONS}                   \
+      --cluster-name ${CLUSTER_2_NAME}           \
+      --log-to-file $tmp_root/qpidd_dst_2.log 2> /dev/null
+
+    broker_ports[3]=${DST_TCP_PORT_2}
+
+  else
+    # vanilla brokers --------------------------------
+    print "Starting SRC broker"
+    $QPIDD_EXEC                                  \
+      --port=${SRC_TCP_PORT}                     \
+      --ssl-port ${SRC_SSL_PORT}                 \
+      ${COMMON_BROKER_OPTIONS}                   \
+      --log-to-file $tmp_root/qpidd_src.log 2> /dev/null
+
+    broker_ports[0]=${SRC_TCP_PORT}
+
+    print "Starting DST broker"
+    $QPIDD_EXEC                                  \
+      --port=${DST_TCP_PORT}                     \
+      --ssl-port ${DST_SSL_PORT}                 \
+      ${COMMON_BROKER_OPTIONS}                   \
+      --log-to-file $tmp_root/qpidd_dst.log 2> /dev/null
+
+    broker_ports[1]=${DST_TCP_PORT}
+  fi
+}
+
+
+function halt_brokers {
+  n_brokers=${#broker_ports[@]}
+  print "Halting ${n_brokers} brokers."
+  for i in $(seq 0 $((${n_brokers} - 1)))
+  do
+    halt_port=${broker_ports[$i]}
+    print "Halting broker $i on port ${halt_port}"
+    $QPIDD_EXEC --port ${halt_port} --quit
+  done
+
+}
 
 
-#echo "-----------------------"
-#echo "Starting SRC broker"
-#echo "-----------------------"
-$QPIDD_EXEC                                  \
-  --port=${SRC_TCP_PORT}                     \
-  --ssl-port ${SRC_SSL_PORT}                 \
-  --ssl-sasl-no-dict                         \
-  --sasl-config=$sasl_config_file            \
-  --ssl-require-client-authentication        \
-  --auth yes                                 \
-  --ssl-cert-db $CERT_DIR                    \
-  --ssl-cert-password-file $CERT_PW_FILE     \
-  --ssl-cert-name $TEST_HOSTNAME             \
-  --no-data-dir                              \
-  --no-module-dir                            \
-  --load-module ${SSL_LIB}                   \
-  --mgmt-enable=yes                          \
-  --log-enable info+                         \
-  --log-source yes                           \
-  --daemon                                   \
-  --log-to-file $tmp_root/qpidd_src.log 2> /dev/null
-
-
-#echo "-----------------------"
-#echo "Starting DST broker"
-#echo "-----------------------"
-$QPIDD_EXEC                                  \
-  --port=${DST_TCP_PORT}                     \
-  --ssl-port ${DST_SSL_PORT}                 \
-  --ssl-cert-db $CERT_DIR                    \
-  --ssl-cert-password-file $CERT_PW_FILE     \
-  --ssl-cert-name $TEST_HOSTNAME             \
-  --ssl-sasl-no-dict                         \
-  --ssl-require-client-authentication        \
-  --sasl-config=$sasl_config_file            \
-  --no-data-dir                              \
-  --no-module-dir                            \
-  --load-module ${SSL_LIB}                   \
-  --mgmt-enable=yes                          \
-  --log-enable info+                         \
-  --log-source yes                           \
-  --daemon                                   \
-  $COMMON_BROKER_OPTIONS                     \
-  --log-to-file $tmp_root/qpidd_dst.log 2> /dev/null
+start_brokers $clustering_flag
 
 
 # I am not randomizing these names, because this test creates its own brokers.
@@ -170,76 +269,77 @@ ROUTING_KEY=sasl_fed_queue
 EXCHANGE_NAME=sasl_fedex
 
 
-#echo "-----------------------"
-#echo "add exchanges"
-#echo "-----------------------"
+print "add exchanges"
 $QPID_CONFIG_EXEC -a localhost:${SRC_TCP_PORT} add exchange direct $EXCHANGE_NAME
 $QPID_CONFIG_EXEC -a localhost:${DST_TCP_PORT} add exchange direct $EXCHANGE_NAME
 
 
-#echo "-----------------------"
-#echo "add queues"
-#echo "-----------------------"
+print "add queues"
 $QPID_CONFIG_EXEC -a localhost:${SRC_TCP_PORT} add queue $QUEUE_NAME
 $QPID_CONFIG_EXEC -a localhost:${DST_TCP_PORT} add queue $QUEUE_NAME
 
 
-#echo "-----------------------"
-#echo "create bindings"
-#echo "-----------------------"
+print "create bindings"
 $QPID_CONFIG_EXEC -a localhost:${SRC_TCP_PORT} bind $EXCHANGE_NAME $QUEUE_NAME $ROUTING_KEY
 $QPID_CONFIG_EXEC -a localhost:${DST_TCP_PORT} bind $EXCHANGE_NAME $QUEUE_NAME $ROUTING_KEY
 
 
-#echo "-----------------------"
-#echo "qpid-route route add"
-#echo "-----------------------"
+#
 # NOTE: The SRC broker *must* be referred to as $TEST_HOSTNAME, and not as "localhost".
 #       It must be referred to by the exact string given as the Common Name (CN) in the cert,
 #       which was created in the function create_certs, above.
-$QPID_ROUTE_EXEC route add localhost:${DST_TCP_PORT}   $TEST_HOSTNAME:${SRC_SSL_PORT} -t ssl $EXCHANGE_NAME $ROUTING_KEY "" "" EXTERNAL
-
-#echo "-----------------------"
-#echo "view the route :"
-#echo "-----------------------"
-#$PYTHON_COMMANDS/qpid-route route list localhost:${DST_TCP_PORT} 
-
-# I don't know how to avoid this sleep yet.  It has to come after route-creation.
-sleep 5
 
-n_messages=100
 
-./datagen --count ${n_messages} | ./sender --broker localhost --port ${SRC_TCP_PORT} --exchange ${EXCHANGE_NAME} --routing-key ${ROUTING_KEY} --mechanism ANONYMOUS
 
+#----------------------------------------------------------------
+# Use qpid-route to create the link, or the link+route, depending
+# on which of its several methods was requested.
+#----------------------------------------------------------------
+if   [ ${qpid_route_method} == "dynamic" ]; then
+  print "dynamic add"
+  $QPID_ROUTE_EXEC -t ssl dynamic add localhost:${DST_TCP_PORT} $TEST_HOSTNAME:${SRC_SSL_PORT} $EXCHANGE_NAME "" "" EXTERNAL
+elif [ ${qpid_route_method} == "link"   ];  then
+  print "link add"
+  $QPID_ROUTE_EXEC -t ssl link add localhost:${DST_TCP_PORT} $TEST_HOSTNAME:${SRC_SSL_PORT}  EXTERNAL
+elif [ ${qpid_route_method} == "queue" ];   then
+  print "queue add"
+  $QPID_ROUTE_EXEC -t ssl queue add localhost:${DST_TCP_PORT}   $TEST_HOSTNAME:${SRC_SSL_PORT} $EXCHANGE_NAME $ROUTING_KEY EXTERNAL
+elif [ ${qpid_route_method} == "route" ];   then
+  print "route add"
+  $QPID_ROUTE_EXEC -t ssl route add localhost:${DST_TCP_PORT}   $TEST_HOSTNAME:${SRC_SSL_PORT} $EXCHANGE_NAME $ROUTING_KEY "" "" EXTERNAL
+else
+  echo "unknown method: |${qpid_route_method}|"
+  echo " choices are: dynamic|link|queue|route "
+  print "Asking brokers to quit."
+  $QPIDD_EXEC --port ${SRC_TCP_PORT} --quit
+  $QPIDD_EXEC --port ${DST_TCP_PORT} --quit
+  exit 2
+fi
 
-#echo "-----------------------"
-#echo "Examine DST Broker"
-#echo "-----------------------"
-dst_message_count=`qpid-stat -q localhost:${DST_TCP_PORT} | grep sasl_fed_queue | awk '{print $2}'`
+# I don't know how to avoid this sleep yet.  It has to come after route-creation 
+# to avoid false negatives.
+sleep 5
 
+# This should work the same whether or not we are running a clustered test.
+print "check the link"
+link_status=$($QPID_ROUTE_EXEC link list localhost:${DST_TCP_PORT} | tail -1 | awk '{print $5}')
+print "link_status == ${link_status}"
 
-#echo "-----------------------"
-#echo "Asking brokers to quit."
-#echo "-----------------------"
-$QPIDD_EXEC --port ${SRC_TCP_PORT} --quit
-$QPIDD_EXEC --port ${DST_TCP_PORT} --quit
+halt_brokers
 
+sleep 1
 
-#echo "-----------------------"
-#echo   "Removing temporary directory $tmp_root"
-#echo "-----------------------"
+print "Removing temporary directory $tmp_root"
 rm -rf $tmp_root
 
-if [ "$dst_message_count" -eq  "$n_messages" ]; then
-  #echo "good: |$dst_message_count| == |$n_messages|"
+
+if [ ${link_status} == "Operational" ]; then
+  print "result: good"
   exit 0
-else
-   #echo "not ideal: |$dst_message_count| != |$n_messages|"
-  exit 1
 fi
 
-
-
+print "result: fail"
+exit 3
 
 
 

Copied: qpid/branches/qpid-2920/qpid/cpp/src/tests/sasl_fed_ex_dynamic (from r1073448, qpid/branches/qpid-2920/qpid/extras/qmf/src/py/qmf2/__init__.py)
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-2920/qpid/cpp/src/tests/sasl_fed_ex_dynamic?p2=qpid/branches/qpid-2920/qpid/cpp/src/tests/sasl_fed_ex_dynamic&p1=qpid/branches/qpid-2920/qpid/extras/qmf/src/py/qmf2/__init__.py&r1=1073448&r2=1081634&rev=1081634&view=diff
==============================================================================
--- qpid/branches/qpid-2920/qpid/extras/qmf/src/py/qmf2/__init__.py (original)
+++ qpid/branches/qpid-2920/qpid/cpp/src/tests/sasl_fed_ex_dynamic Tue Mar 15 01:54:07 2011
@@ -1,3 +1,5 @@
+#! /bin/bash
+
 #
 # Licensed to the Apache Software Foundation (ASF) under one
 # or more contributor license agreements.  See the NOTICE file
@@ -16,3 +18,10 @@
 # specific language governing permissions and limitations
 # under the License.
 #
+
+
+source ./test_env.sh
+
+${srcdir}/sasl_fed_ex dynamic
+
+

Propchange: qpid/branches/qpid-2920/qpid/cpp/src/tests/sasl_fed_ex_dynamic
------------------------------------------------------------------------------
    svn:executable = *

Copied: qpid/branches/qpid-2920/qpid/cpp/src/tests/sasl_fed_ex_dynamic_cluster (from r1073448, qpid/branches/qpid-2920/qpid/extras/qmf/src/py/qmf2/__init__.py)
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-2920/qpid/cpp/src/tests/sasl_fed_ex_dynamic_cluster?p2=qpid/branches/qpid-2920/qpid/cpp/src/tests/sasl_fed_ex_dynamic_cluster&p1=qpid/branches/qpid-2920/qpid/extras/qmf/src/py/qmf2/__init__.py&r1=1073448&r2=1081634&rev=1081634&view=diff
==============================================================================
--- qpid/branches/qpid-2920/qpid/extras/qmf/src/py/qmf2/__init__.py (original)
+++ qpid/branches/qpid-2920/qpid/cpp/src/tests/sasl_fed_ex_dynamic_cluster Tue Mar 15 01:54:07 2011
@@ -1,3 +1,5 @@
+#! /bin/bash
+
 #
 # Licensed to the Apache Software Foundation (ASF) under one
 # or more contributor license agreements.  See the NOTICE file
@@ -16,3 +18,10 @@
 # specific language governing permissions and limitations
 # under the License.
 #
+
+
+source ./test_env.sh
+
+${srcdir}/sasl_fed_ex dynamic cluster
+
+

Propchange: qpid/branches/qpid-2920/qpid/cpp/src/tests/sasl_fed_ex_dynamic_cluster
------------------------------------------------------------------------------
    svn:executable = *

Copied: qpid/branches/qpid-2920/qpid/cpp/src/tests/sasl_fed_ex_link (from r1073448, qpid/branches/qpid-2920/qpid/extras/qmf/src/py/qmf2/__init__.py)
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-2920/qpid/cpp/src/tests/sasl_fed_ex_link?p2=qpid/branches/qpid-2920/qpid/cpp/src/tests/sasl_fed_ex_link&p1=qpid/branches/qpid-2920/qpid/extras/qmf/src/py/qmf2/__init__.py&r1=1073448&r2=1081634&rev=1081634&view=diff
==============================================================================
--- qpid/branches/qpid-2920/qpid/extras/qmf/src/py/qmf2/__init__.py (original)
+++ qpid/branches/qpid-2920/qpid/cpp/src/tests/sasl_fed_ex_link Tue Mar 15 01:54:07 2011
@@ -1,3 +1,5 @@
+#! /bin/bash
+
 #
 # Licensed to the Apache Software Foundation (ASF) under one
 # or more contributor license agreements.  See the NOTICE file
@@ -16,3 +18,10 @@
 # specific language governing permissions and limitations
 # under the License.
 #
+
+
+source ./test_env.sh
+
+${srcdir}/sasl_fed_ex link
+
+

Propchange: qpid/branches/qpid-2920/qpid/cpp/src/tests/sasl_fed_ex_link
------------------------------------------------------------------------------
    svn:executable = *

Copied: qpid/branches/qpid-2920/qpid/cpp/src/tests/sasl_fed_ex_link_cluster (from r1073448, qpid/branches/qpid-2920/qpid/extras/qmf/src/py/qmf2/__init__.py)
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-2920/qpid/cpp/src/tests/sasl_fed_ex_link_cluster?p2=qpid/branches/qpid-2920/qpid/cpp/src/tests/sasl_fed_ex_link_cluster&p1=qpid/branches/qpid-2920/qpid/extras/qmf/src/py/qmf2/__init__.py&r1=1073448&r2=1081634&rev=1081634&view=diff
==============================================================================
--- qpid/branches/qpid-2920/qpid/extras/qmf/src/py/qmf2/__init__.py (original)
+++ qpid/branches/qpid-2920/qpid/cpp/src/tests/sasl_fed_ex_link_cluster Tue Mar 15 01:54:07 2011
@@ -1,3 +1,5 @@
+#! /bin/bash
+
 #
 # Licensed to the Apache Software Foundation (ASF) under one
 # or more contributor license agreements.  See the NOTICE file
@@ -16,3 +18,10 @@
 # specific language governing permissions and limitations
 # under the License.
 #
+
+
+source ./test_env.sh
+
+${srcdir}/sasl_fed_ex link cluster
+
+

Propchange: qpid/branches/qpid-2920/qpid/cpp/src/tests/sasl_fed_ex_link_cluster
------------------------------------------------------------------------------
    svn:executable = *

Copied: qpid/branches/qpid-2920/qpid/cpp/src/tests/sasl_fed_ex_queue (from r1073448, qpid/branches/qpid-2920/qpid/extras/qmf/src/py/qmf2/__init__.py)
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-2920/qpid/cpp/src/tests/sasl_fed_ex_queue?p2=qpid/branches/qpid-2920/qpid/cpp/src/tests/sasl_fed_ex_queue&p1=qpid/branches/qpid-2920/qpid/extras/qmf/src/py/qmf2/__init__.py&r1=1073448&r2=1081634&rev=1081634&view=diff
==============================================================================
--- qpid/branches/qpid-2920/qpid/extras/qmf/src/py/qmf2/__init__.py (original)
+++ qpid/branches/qpid-2920/qpid/cpp/src/tests/sasl_fed_ex_queue Tue Mar 15 01:54:07 2011
@@ -1,3 +1,5 @@
+#! /bin/bash
+
 #
 # Licensed to the Apache Software Foundation (ASF) under one
 # or more contributor license agreements.  See the NOTICE file
@@ -16,3 +18,10 @@
 # specific language governing permissions and limitations
 # under the License.
 #
+
+
+source ./test_env.sh
+
+${srcdir}/sasl_fed_ex queue
+
+

Propchange: qpid/branches/qpid-2920/qpid/cpp/src/tests/sasl_fed_ex_queue
------------------------------------------------------------------------------
    svn:executable = *

Copied: qpid/branches/qpid-2920/qpid/cpp/src/tests/sasl_fed_ex_queue_cluster (from r1073448, qpid/branches/qpid-2920/qpid/extras/qmf/src/py/qmf2/__init__.py)
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-2920/qpid/cpp/src/tests/sasl_fed_ex_queue_cluster?p2=qpid/branches/qpid-2920/qpid/cpp/src/tests/sasl_fed_ex_queue_cluster&p1=qpid/branches/qpid-2920/qpid/extras/qmf/src/py/qmf2/__init__.py&r1=1073448&r2=1081634&rev=1081634&view=diff
==============================================================================
--- qpid/branches/qpid-2920/qpid/extras/qmf/src/py/qmf2/__init__.py (original)
+++ qpid/branches/qpid-2920/qpid/cpp/src/tests/sasl_fed_ex_queue_cluster Tue Mar 15 01:54:07 2011
@@ -1,3 +1,5 @@
+#! /bin/bash
+
 #
 # Licensed to the Apache Software Foundation (ASF) under one
 # or more contributor license agreements.  See the NOTICE file
@@ -16,3 +18,10 @@
 # specific language governing permissions and limitations
 # under the License.
 #
+
+
+source ./test_env.sh
+
+${srcdir}/sasl_fed_ex queue cluster
+
+

Propchange: qpid/branches/qpid-2920/qpid/cpp/src/tests/sasl_fed_ex_queue_cluster
------------------------------------------------------------------------------
    svn:executable = *

Copied: qpid/branches/qpid-2920/qpid/cpp/src/tests/sasl_fed_ex_route (from r1073448, qpid/branches/qpid-2920/qpid/extras/qmf/src/py/qmf2/__init__.py)
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-2920/qpid/cpp/src/tests/sasl_fed_ex_route?p2=qpid/branches/qpid-2920/qpid/cpp/src/tests/sasl_fed_ex_route&p1=qpid/branches/qpid-2920/qpid/extras/qmf/src/py/qmf2/__init__.py&r1=1073448&r2=1081634&rev=1081634&view=diff
==============================================================================
--- qpid/branches/qpid-2920/qpid/extras/qmf/src/py/qmf2/__init__.py (original)
+++ qpid/branches/qpid-2920/qpid/cpp/src/tests/sasl_fed_ex_route Tue Mar 15 01:54:07 2011
@@ -1,3 +1,5 @@
+#! /bin/bash
+
 #
 # Licensed to the Apache Software Foundation (ASF) under one
 # or more contributor license agreements.  See the NOTICE file
@@ -16,3 +18,10 @@
 # specific language governing permissions and limitations
 # under the License.
 #
+
+
+source ./test_env.sh
+
+${srcdir}/sasl_fed_ex route
+
+

Propchange: qpid/branches/qpid-2920/qpid/cpp/src/tests/sasl_fed_ex_route
------------------------------------------------------------------------------
    svn:executable = *

Copied: qpid/branches/qpid-2920/qpid/cpp/src/tests/sasl_fed_ex_route_cluster (from r1073448, qpid/branches/qpid-2920/qpid/extras/qmf/src/py/qmf2/__init__.py)
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-2920/qpid/cpp/src/tests/sasl_fed_ex_route_cluster?p2=qpid/branches/qpid-2920/qpid/cpp/src/tests/sasl_fed_ex_route_cluster&p1=qpid/branches/qpid-2920/qpid/extras/qmf/src/py/qmf2/__init__.py&r1=1073448&r2=1081634&rev=1081634&view=diff
==============================================================================
--- qpid/branches/qpid-2920/qpid/extras/qmf/src/py/qmf2/__init__.py (original)
+++ qpid/branches/qpid-2920/qpid/cpp/src/tests/sasl_fed_ex_route_cluster Tue Mar 15 01:54:07 2011
@@ -1,3 +1,5 @@
+#! /bin/bash
+
 #
 # Licensed to the Apache Software Foundation (ASF) under one
 # or more contributor license agreements.  See the NOTICE file
@@ -16,3 +18,10 @@
 # specific language governing permissions and limitations
 # under the License.
 #
+
+
+source ./test_env.sh
+
+${srcdir}/sasl_fed_ex route cluster
+
+

Propchange: qpid/branches/qpid-2920/qpid/cpp/src/tests/sasl_fed_ex_route_cluster
------------------------------------------------------------------------------
    svn:executable = *

Modified: qpid/branches/qpid-2920/qpid/cpp/src/tests/ssl_test
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-2920/qpid/cpp/src/tests/ssl_test?rev=1081634&r1=1081633&r2=1081634&view=diff
==============================================================================
--- qpid/branches/qpid-2920/qpid/cpp/src/tests/ssl_test (original)
+++ qpid/branches/qpid-2920/qpid/cpp/src/tests/ssl_test Tue Mar 15 01:54:07 2011
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 
 #
 # Licensed to the Apache Software Foundation (ASF) under one

Modified: qpid/branches/qpid-2920/qpid/cpp/xml/cluster.xml
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-2920/qpid/cpp/xml/cluster.xml?rev=1081634&r1=1081633&r2=1081634&view=diff
==============================================================================
--- qpid/branches/qpid-2920/qpid/cpp/xml/cluster.xml (original)
+++ qpid/branches/qpid-2920/qpid/cpp/xml/cluster.xml Tue Mar 15 01:54:07 2011
@@ -252,7 +252,6 @@
 
     <!-- Replicate encoded exchanges/queues. -->
     <control name="exchange" code="0x31"><field name="encoded" type="str32"/></control>
-    <control name="queue" code="0x32"><field name="encoded" type="str32"/></control>
 
     <!-- Set expiry-id for subsequent messages. -->
     <control name="expiry-id" code="0x33"><field name="expiry-id" type="uint64"/></control>

Modified: qpid/branches/qpid-2920/qpid/doc/book/src/AMQP-Messaging-Broker-CPP-Book.xml
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-2920/qpid/doc/book/src/AMQP-Messaging-Broker-CPP-Book.xml?rev=1081634&r1=1081633&r2=1081634&view=diff
==============================================================================
--- qpid/branches/qpid-2920/qpid/doc/book/src/AMQP-Messaging-Broker-CPP-Book.xml (original)
+++ qpid/branches/qpid-2920/qpid/doc/book/src/AMQP-Messaging-Broker-CPP-Book.xml Tue Mar 15 01:54:07 2011
@@ -56,6 +56,7 @@
     <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="LVQ.xml"/>
     <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="queue-state-replication.xml"/>
     <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="Starting-a-cluster.xml"/>
+    <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="producer-flow-control.xml"/>
     <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="AMQP-Compatibility.xml"/>
     <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="Qpid-Interoperability-Documentation.xml"/>
 

Modified: qpid/branches/qpid-2920/qpid/doc/book/src/AMQP-Messaging-Broker-CPP.xml
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-2920/qpid/doc/book/src/AMQP-Messaging-Broker-CPP.xml?rev=1081634&r1=1081633&r2=1081634&view=diff
==============================================================================
--- qpid/branches/qpid-2920/qpid/doc/book/src/AMQP-Messaging-Broker-CPP.xml (original)
+++ qpid/branches/qpid-2920/qpid/doc/book/src/AMQP-Messaging-Broker-CPP.xml Tue Mar 15 01:54:07 2011
@@ -50,7 +50,8 @@
     <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="LVQ.xml"/>
     <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="queue-state-replication.xml"/>
     <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="Starting-a-cluster.xml"/>
-    <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="ACL.xml"/> 
+    <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="ACL.xml"/>
+    <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="producer-flow-control.xml"/>
 </chapter>
  
 

Modified: qpid/branches/qpid-2920/qpid/doc/book/src/Cheat-Sheet-for-configuring-Queue-Options.xml
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-2920/qpid/doc/book/src/Cheat-Sheet-for-configuring-Queue-Options.xml?rev=1081634&r1=1081633&r2=1081634&view=diff
==============================================================================
--- qpid/branches/qpid-2920/qpid/doc/book/src/Cheat-Sheet-for-configuring-Queue-Options.xml (original)
+++ qpid/branches/qpid-2920/qpid/doc/book/src/Cheat-Sheet-for-configuring-Queue-Options.xml Tue Mar 15 01:54:07 2011
@@ -65,6 +65,16 @@
                 </itemizedlist>
               </para></listitem>
             </itemizedlist>
+
+	  <para>
+            The 0.10 C++ Broker supports the following additional Queue configuration options:
+          </para>
+          <itemizedlist>
+            <listitem><para>
+              <xref linkend="producer-flow-control"/>
+            </para></listitem>
+          </itemizedlist>
+
           <section role="h3" id="CheatSheetforconfiguringQueueOptions-ApplyingQueueSizingConstraints"><title>
             Applying Queue Sizing Constraints
           </title>

Modified: qpid/branches/qpid-2920/qpid/doc/book/src/Programming-In-Apache-Qpid.xml
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-2920/qpid/doc/book/src/Programming-In-Apache-Qpid.xml?rev=1081634&r1=1081633&r2=1081634&view=diff
==============================================================================
--- qpid/branches/qpid-2920/qpid/doc/book/src/Programming-In-Apache-Qpid.xml (original)
+++ qpid/branches/qpid-2920/qpid/doc/book/src/Programming-In-Apache-Qpid.xml Tue Mar 15 01:54:07 2011
@@ -1722,7 +1722,7 @@ try {
 
 	      <row>
 		<entry>
-		  username
+		  <literal>username</literal>
 		</entry>
 		<entry>
 		  string
@@ -1733,7 +1733,7 @@ try {
 	      </row>
 	      <row>
 		<entry>
-		  password
+		  <literal>password</literal>
 		</entry>
 		<entry>
 		  string
@@ -1744,35 +1744,22 @@ try {
 	      </row>
 	      <row>
 		<entry>
-		  sasl-mechanism
+		  <literal>sasl_mechanisms</literal>
 		</entry>
 		<entry>
 		  string
 		</entry>
 		<entry>
-		  The specific SASL mechanism to use with the c++
-		  client when authenticating to the broker. Only a
-		  single value can be specified at present. [C++ only].
-		</entry>
-	      </row>
-	      <row>
-		<entry>
-		  sasl_mechanisms
-		</entry>
-		<entry>
-		  string
-		</entry>
-		<entry>
-		  The specific SASL mechanism to use with the python
+		  The specific SASL mechanisms to use with the python
 		  client when authenticating to the broker. The value
-		  is a space separated list in order of preference. [Python only].
+		  is a space separated list.
 		</entry>
 	      </row>
 
 
 	      <row>
 		<entry>
-		  reconnect
+		  <literal>reconnect</literal>
 		</entry>
 		<entry>
 		  boolean
@@ -1783,7 +1770,7 @@ try {
 	      </row>
 	      <row>
 		<entry>
-		  <literal>reconnect_timeout&nbsp;[Python]</literal> <literal>reconnect-timeout&nbsp;[C++]</literal>
+		  <literal>reconnect_timeout</literal>
 		</entry>
 		<entry>
 		  integer
@@ -1794,7 +1781,7 @@ try {
 	      </row>
 	      <row>
 		<entry>
-		  <literal>reconnect_limit&nbsp;[Python]</literal> <literal>reconnect-limit&nbsp;[C++]</literal>
+		  <literal>reconnect_limit</literal>
 		</entry>
 		<entry>
 		  integer
@@ -1805,7 +1792,7 @@ try {
 	      </row>
 	      <row>
 		<entry>
-		  <literal>reconnect_interval_min&nbsp;[Python]</literal> <literal>reconnect-interval-min&nbsp;[C++]</literal>
+		  <literal>reconnect_interval_min</literal>
 		</entry>
 		<entry>
 		  integer representing time in seconds
@@ -1816,7 +1803,7 @@ try {
 	      </row>
 	      <row>
 		<entry>
-		  <literal>reconnect_interval_max&nbsp;[Python]</literal> <literal>reconnect-interval-max&nbsp;[C++]</literal>
+		  <literal>reconnect_interval_max</literal>
 		</entry>
 		<entry>
 		  integer representing time in seconds
@@ -1827,7 +1814,7 @@ try {
 	      </row>
 	      <row>
 		<entry>
-		  <literal>reconnect_interval&nbsp;[Python]</literal> <literal>reconnect-interval&nbsp;[C++]</literal>
+		  <literal>reconnect_interval</literal>
 		</entry>
 		<entry>
 		  integer representing time in seconds
@@ -1839,7 +1826,7 @@ try {
 
 	      <row>
 	        <entry>
-	          heartbeat
+	          <literal>heartbeat</literal>
 	        </entry>
 	        <entry>
 	          integer representing time in seconds
@@ -1852,7 +1839,7 @@ try {
 	      </row>
 	      <row>
 	        <entry>
-	          protocol
+	          <literal>protocol</literal>
 	        </entry>
 	        <entry>
 	          string
@@ -1863,7 +1850,7 @@ try {
 	      </row>
 	      <row>
 	        <entry>
-	          tcp-nodelay
+	          <literal>tcp-nodelay</literal>
 	        </entry>
 	        <entry>
 	          boolean



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


Mime
View raw message