summaryrefslogtreecommitdiff
path: root/qpid/cpp/src/tests
Commit message (Collapse)AuthorAgeFilesLines
* QPID-5985: fixed regression introduced by previous commit (r1617256), ↵Gordon Sim2014-08-141-0/+15
| | | | | | ensuring that call does not block indefinitely git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1617924 13f79535-47bb-0310-9956-ffa450edef68
* QPID-5985: check for incoming messages - without waiting - even when timout is 0Gordon Sim2014-08-111-0/+25
| | | | git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1617256 13f79535-47bb-0310-9956-ffa450edef68
* QPID-5966: HA mixing tx enqueue and non-tx dequeue leaves extra messages on ↵Alan Conway2014-08-083-10/+76
| | | | | | | | | | | | | | | | | | | | | backup. There were several problems: 1. Positions of transactionally enqueued messages not known to QueueReplicator, so not dequeued on backup if dequeued outside a TX on primary. 2. Race condition if tx created immediately after queue could cause duplication of TX message. 3. Replication IDs were not being set during recovery from store (regression, store change?) Fix: 1. Update positions QueueReplicator positions via QueueObserver::enqueued to see all enqueues. 2. Check for duplicate replication-ids on backup in QueueReplicator::route. 3. Set replication-id in publish() if not already set in record(). git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1616704 13f79535-47bb-0310-9956-ffa450edef68
* QPID-5973: HA cluster state may get stuck in recoveringAlan Conway2014-08-081-2/+3
| | | | | | | | | | | | | | | | | | | | | | A backup queue is considered "ready" when all messages up to the first guarded position have either been replicated and acknowledged or dequeued. Previously this was implemented by waiting for the replicationg subscription to advance to the first guarded position and wating for all expected acks. However if messages are dequeued out-of-order (which happens with transactions) there can be a gap at the tail of the queue. The replicating subscription will not advance past this gap because it only advances when there are messages to consume. This resulted in backups stuck in catch-up. The recovering primary has a time-out for backups that never re-connect, but if they connect sucessfully and don't disconnect, the primary assumes they will become ready and waits - causing the primary to be stuck in "recovering". The fixes is to notify a replicating subscription if it becomes "stopped" because there are no more messages available on the queue. This implies that either it is at the tail OR there are no more messags until the tail. Either way we should consider this "ready" from the point of view of HA catch-up. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1616702 13f79535-47bb-0310-9956-ffa450edef68
* QPID-5888: Fix test to ignore occasional TransactionAborted failures on ↵Alan Conway2014-07-291-1/+2
| | | | | | connection.close. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1614331 13f79535-47bb-0310-9956-ffa450edef68
* QPID-5921, QPID-5923: adjustments and exclusions for new tests using swigged ↵Gordon Sim2014-07-242-0/+9
| | | | | | client git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1613131 13f79535-47bb-0310-9956-ffa450edef68
* QPID-4123: C++ Broker ACL creates too many rulesCharles E. Rolke2014-07-232-3/+191
| | | | | | | | | | | | | | | | | | | | | | | Recent changes have added new tables to define what are ACL lookups and their properties. This commit finishes that work by not propagating rules that will never match. Also, it completes the scaffolding for allowed and denied host lists to be fully integrated. This commit: * Adds startup logging of ACL validation tables with cross references to possible rule matches. * Hooks the ACL host allow/deny connection lists into self test. * Fixes self tests that get broken by proper rule table handling. * Introduces a 'create connection' decision mode similar to ACL rule decision mode. * Describes it all in doc book. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1612874 13f79535-47bb-0310-9956-ffa450edef68
* QPID-5888: transaction should always be aborted on failoverAlan Conway2014-07-182-20/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | C++ and python clients were attempting to continue the transation transparently after failover which is in correct. They were re-sending messages in the transaction but there is no way to re-do transactional receives. The transaction must be aborted. The C++ and python clients have been modified to kill a transactional session with a TransactionAborted exception if there is a failover. Note the Java client already behaves correctly but not identically. It defers raising an exception until commit rather than failing immediately on failover, and the session can still be used. The following commits are involved: r1611349 QPID-5887: revised approach to implict abort r1610959 QPID-5887: allow qpid-txtest2 to be run by make test r1610958 QPID-5887: fix to new txtest2, acknowledge messages in the check phase to ensure queues remain drained for any subsequent runs r1609748 QPID-5887: abort transactional session on failover; added equivalent of txtest using messaging API This commit does the following: - Update ha_tests.py tx_simpler_failover test to expect transaction aborted. - Minor improvements to qpid-txtest2 - Fix native (non-swig) python client. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1611748 13f79535-47bb-0310-9956-ffa450edef68
* QPID-5887: revised approach to implict abortGordon Sim2014-07-171-10/+19
| | | | git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1611349 13f79535-47bb-0310-9956-ffa450edef68
* QPID-5898: AclHost unit test fails on systems with no IPv6Charles E. Rolke2014-07-161-58/+105
| | | | | | | | | | | | | * In SocketAddress::isComparable catch exceptions thrown by getAddrInfo when address family is not supported. * Delete self test that expects hosts to have 127.0.0.1 and ::1 as valid addresses for localhost. * In self tests sense whether IPv4 and IPv6 are supported and skip running tests that use those families accordingly. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1611059 13f79535-47bb-0310-9956-ffa450edef68
* QPID-5898: Self tests fail on systems with IPv6 disabled.Charles E. Rolke2014-07-161-30/+30
| | | | | | | Temporarily disable tests that assume IPv6 to restore automated testing. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1610992 13f79535-47bb-0310-9956-ffa450edef68
* QPID-5887: allow qpid-txtest2 to be run by make testGordon Sim2014-07-163-2/+16
| | | | git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1610959 13f79535-47bb-0310-9956-ffa450edef68
* QPID-5887: fix to new txtest2, acknowledge messages in the check phase to ↵Gordon Sim2014-07-161-0/+1
| | | | | | ensure queues remain drained for any subsequent runs git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1610958 13f79535-47bb-0310-9956-ffa450edef68
* QPID-4947: C++ Broker ACL restricts hosts from which users may connect.Charles E. Rolke2014-07-153-9/+132
| | | | | | | | | | | | | | | | | This commit adds: * Acl rule file "create connection host=hostname" support for allowing and denying connections. * AclHost class to represent a host specified in the rule file. * Global and user-specific lists of AclHost rules. Created by AclReader and consumed by AclConnectionCounter. * Address range checks and other giblets in SocketAddress: ** asString support to hide IPv6 decoration and service (port) details. ** binary comparison of network addresses. ** new firstAddress function to complement existing nextAddress. Socket addrinfo for AclHost objects is computed once only for lifetime of Acl file load. ** Posix and Windows implementations are identical. * New unit test for address comparisons. Testing a live broker is great but forcing connections to be from some arbitrary IPv4 or IPv6 address is hard. So there's a unit test for that. Further discussion about this feature is in https://reviews.apache.org/r/23322 git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1610874 13f79535-47bb-0310-9956-ffa450edef68
* QPID-5890: Improve Acl enum verificationCharles E. Rolke2014-07-121-13/+5
| | | | git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1609900 13f79535-47bb-0310-9956-ffa450edef68
* QPID-5890: Refactoring AclModule.hCharles E. Rolke2014-07-112-0/+158
| | | | | | | | | | | | | * make single instances of strings associated with enums * make more compact search functions * make string definitions const * return 'const string&' instead of copies of temporaries * add self test as string defs sanity check * export AclHelper to satisfy tests (!!) git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1609828 13f79535-47bb-0310-9956-ffa450edef68
* QPID-5887: abort transactional session on failover; added equivalent of ↵Gordon Sim2014-07-113-1/+320
| | | | | | txtest using messaging API git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1609748 13f79535-47bb-0310-9956-ffa450edef68
* QPID-5858: Remove unneeded line that generates a warning on Windows VS2010.Charles E. Rolke2014-07-111-1/+0
| | | | | | | | | 2> MessagingSessionTests.cpp 2>..\..\..\cpp\src\tests\MessagingSessionTests.cpp(1438): warning C4930: 'std::string queue(void)': prototyped function not called (was a variable definition intended?) git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1609726 13f79535-47bb-0310-9956-ffa450edef68
* NO-JIRA: qpid-send help: copy&paste typo fixedPavel Moravec2014-07-091-1/+1
| | | | git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1609098 13f79535-47bb-0310-9956-ffa450edef68
* NO-JIRA: Fix defects found by coverity.Alan Conway2014-07-073-3/+3
| | | | | | | | | | | | | | | | | | To view the defects in Coverity Scan visit, http://scan.coverity.com/projects/6?tab=overview ** CID 1224524: Big parameter passed by value (PASS_BY_VALUE) /qpidbuilds/trunk/qpid/cpp/src/tests/BrokerFixture.h: 155 in qpid::tests::SessionFixtureT<qpid::tests::LocalConnection, qpid::client::Session_0_10>::SessionFixtureT(qpid::broker::BrokerOptions)() ** CID 1224525: Big parameter passed by value (PASS_BY_VALUE) /qpidbuilds/trunk/qpid/cpp/src/tests/ClientSessionTest.cpp: 108 in qpid::tests::ClientSessionFixture::ClientSessionFixture(qpid::broker::BrokerOptions)() ** CID 1224526: Big parameter passed by value (PASS_BY_VALUE) /qpidbuilds/trunk/qpid/cpp/src/tests/MessagingFixture.h: 106 in qpid::tests::MessagingFixture::MessagingFixture(qpid::broker::BrokerOptions, bool)() ** CID 1224527: Wrapper object use after free (WRAPPER_ESCAPE) /qpidbuilds/trunk/qpid/cpp/src/qpid/broker/SaslAuthenticator.cpp: 276 in qpid::broker::CyrusAuthenticator::init()() git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1608487 13f79535-47bb-0310-9956-ffa450edef68
* QPID-5874: Treat all empty selectors sensiblyAndrew Stitcher2014-07-031-0/+3
| | | | git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1607739 13f79535-47bb-0310-9956-ffa450edef68
* QPID-5806: Allow quoted syntax for non standard selector identifiersAndrew Stitcher2014-07-031-1/+2
| | | | | | - This matches the Java broker syntax for selectors git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1607738 13f79535-47bb-0310-9956-ffa450edef68
* QPID-3921: Refactored Broker::Options into its own independent classAndrew Stitcher2014-07-014-15/+19
| | | | | | | | | | - Now called BrokerOptions - Added extra getters to Broker so that nothing else needs to know about BrokerOptions - Significantly reduces header coupling as lots of files include Broker.h, but now don't need Options.h git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1607166 13f79535-47bb-0310-9956-ffa450edef68
* QPID-5865: Be more robust in face of system clock being changed:Andrew Stitcher2014-07-014-7/+5
| | | | | | | | | | - Separate Wall clock time uses from other time * (assumed that any time with respect to the epoch is wallclock) - For Posix use CLOCK_MONOTONIC for all non wall clock purposes so that changing system time doesn't affect internal timekeeping - For Windows kept the same time keeping scheme. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1607140 13f79535-47bb-0310-9956-ffa450edef68
* QPID-5858: prevent leakage of old exception typesGordon Sim2014-06-271-0/+19
| | | | git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1606258 13f79535-47bb-0310-9956-ffa450edef68
* [no JIRA]: brokertest to set connection option 'protocol' only for SWIG ↵Pavel Moravec2014-06-261-2/+4
| | | | | | client on AMQP1.0 git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1605703 13f79535-47bb-0310-9956-ffa450edef68
* QPID-5817: [C++ broker] Improve ACL authorisation of QMF methods and queriesPavel Moravec2014-06-182-5/+159
| | | | git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1603364 13f79535-47bb-0310-9956-ffa450edef68
* QPID-5807: Remove boost::program_options as a header file dependency of ↵Andrew Stitcher2014-06-113-26/+30
| | | | | | | | | qpid/Options.h - The intent here is to remove the necessity for things using qpid::Options to need to link boost::program_options directly. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1602021 13f79535-47bb-0310-9956-ffa450edef68
* QPID-5805: Disallow % and _ characters as escapes in selector LIKE expressionAndrew Stitcher2014-06-091-0/+1
| | | | git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1601373 13f79535-47bb-0310-9956-ffa450edef68
* QPID-5804: Fix broken selector parsing of unary '+'Andrew Stitcher2014-06-091-0/+2
| | | | git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1601372 13f79535-47bb-0310-9956-ffa450edef68
* QPID-5748: [C++ broker] Make Queue::purgeExpired more efficient; remove ↵Pavel Moravec2014-05-282-2/+1
| | | | | | ExpiryPolicy git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1597931 13f79535-47bb-0310-9956-ffa450edef68
* QPID-5783: Share immutable state between copies of a message. Avoid using ↵Gordon Sim2014-05-232-1/+1
| | | | | | memory for annotations unless actually required. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1597121 13f79535-47bb-0310-9956-ffa450edef68
* QPID-5765: don't invoke on dangling pointerGordon Sim2014-05-141-0/+1
| | | | | | | | | Strictly speaking comparing anything against the old pointer isn't correct either, but this is harder to change and the only negative effect is that in the event that a new connection has the same pointer value, it would be incorrectly interpreted as 'local'. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1594633 13f79535-47bb-0310-9956-ffa450edef68
* QPID-5758: Move purging of expired messages from timer thread to worker threadGordon Sim2014-05-131-1/+6
| | | | git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1594220 13f79535-47bb-0310-9956-ffa450edef68
* NO-JIRA: HA fix hanging ha_tests.test_failover_send_receive on RHEL5Alan Conway2014-05-012-30/+28
| | | | | | | | | | | | | The test was hanging because of a python construct not available in 2.4. It was causing an exception in a strange place because this bit of code was imported at runtime, and that was hanging the test. Fixed and did some cleanup to avoid such mysterious hangs in future: - Fixed qpidtoollibs/config.py to work with python 2.4. - Import qpid-ha script at import time rather than runtime. - Fix Popen.teardown logic to avoid hanging if a process can't be killed. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1591794 13f79535-47bb-0310-9956-ffa450edef68
* QPID-5489: More cleaning up of the Uuid codeAndrew Stitcher2014-04-291-3/+15
| | | | | | | | - Rewrite the Uuid iosteam extractor and insertor operators to not require any underlying uuid library. - Create a specific uuid implementation for FreeBSD git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1590978 13f79535-47bb-0310-9956-ffa450edef68
* QPID-5725: Use correct comparison function to match property keysAndrew Michael Stitcher2014-04-271-0/+12
| | | | git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1590505 13f79535-47bb-0310-9956-ffa450edef68
* NO-JIRA: HA minor cleanup of qpid-ha toolAlan Conway2014-04-242-57/+0
| | | | | | | | | | - Remove some dead code. - Removed "set" command - not ready for production. All settings in qpidd.conf. - Removed related tests in ha_tests - Improved help on promote command. - Made option group for common broker connection options. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1589834 13f79535-47bb-0310-9956-ffa450edef68
* QPID-5719: HA becomes unresponsive once any of the brokers are SIGSTOPedAlan Conway2014-04-242-1/+11
| | | | | | | | | | | | | | | | | | | | | | | | - Added timeout to qpid-ha. - qpidd init script pings broker to verify it is not hung. - updated documentation in qpid/doc/book/src/cpp-broker/Active-Passive-Cluster.xml. The new results for the cases mentioned in the bug: a] stopped ALL brokers: rgmanager restarts the entire cluster but data is lost. Equivalent to killing all the brokers at once. This does not affect quorum because only qpidd services are affected, not other services managed by cman. b] stopped the primary: rgmanager restarts the primary after a timeout and promotes one of the backups. c] stopped a backup: rgmanager restarts the backups after a timeout. Clients that are actively sending messages may see a delay while backup is restarted. Note you need to set link-heartbeat-interval in qpidd.conf. The default is very high (120 seconds), it should be set lower to see recovery from sigstop in a reasonable time. See the updated documentation in qpid/doc/book/src/cpp-broker/Active-Passive-Cluster.xml. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1589807 13f79535-47bb-0310-9956-ffa450edef68
* QPID-5714: In ha_tests, skip if the target test code is missingJustin Ross2014-04-241-0/+5
| | | | git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1589760 13f79535-47bb-0310-9956-ffa450edef68
* QPID-5720: HA exception raised by the store for durable transactionsAlan Conway2014-04-233-8/+10
| | | | | | | | | | | | | | | Running qpid-txtest against a HA cluster was raising this exception: async_dequeue() failed: jexception 0x0b02 wmgr::dequeue_check() threw JERR_MAP_LOCKED: Record ID locked by a pending transaction. This is actually a test bug. In a cluster a transaction commit takes longer to complete because of co-ordinating with backups, the test was not waiting for the completion of commit command before proceeding. Adding a sync() in the test solves the problem. Note this test uses the old obsolete C++ API. Applications written using the supported messaging API are not affected by this. This can be verified using the qpid-send and qpid-receive clients with the --tx option (there is already an automated test for this in ha_tests.py.) git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1589520 13f79535-47bb-0310-9956-ffa450edef68
* QPID-5714: Skip python tests if test code is missingJustin Ross2014-04-212-0/+6
| | | | git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1588883 13f79535-47bb-0310-9956-ffa450edef68
* NO-JIRA: older versions of boost get confused when one option is a substring ↵Gordon Sim2014-04-171-1/+1
| | | | | | of another see r1587304 and r1587976 git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1588212 13f79535-47bb-0310-9956-ffa450edef68
* NO-JIRA: make new output introduced in r1587304 optional, as it breaks ↵Gordon Sim2014-04-161-5/+9
| | | | | | several tests git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1587976 13f79535-47bb-0310-9956-ffa450edef68
* NO-JIRA: Make qpid-receive print a bit more info for message headers/contentAndrew Michael Stitcher2014-04-141-2/+8
| | | | git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1587304 13f79535-47bb-0310-9956-ffa450edef68
* QPID-5681: Fix core dump in interlink_tests.Alan Conway2014-04-112-1/+9
| | | | | | Use native python client for older (<=0.6) versions of proton. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1586646 13f79535-47bb-0310-9956-ffa450edef68
* QPID-5560: Fix ReplicationTests.test_reject to work with SWIG and native ↵Alan Conway2014-04-091-1/+1
| | | | | | | | clients. Catch more general LinkError rather than TargetCapacityExceeded which is only raised by native client. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1585985 13f79535-47bb-0310-9956-ffa450edef68
* Author: Alan Conway <aconway@redhat.com>Alan Conway2014-04-081-2/+3
| | | | | | | --- log message follows this QPID-5560: Remove use of python if expression, not available in older python (2.4) git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1585755 13f79535-47bb-0310-9956-ffa450edef68
* QPID-5560: HA tests do not use AMQP 1.0Alan Conway2014-04-079-377/+444
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The HA tests were using only AMQP 0-10. Modified the tests to use AMQP 1.0 if available (still use 0-10 if 1.0 is not available) Fixed bugs uncovered both in the tests and in the AMQP 1.0 implementation. Summary of changes: - brokertest.py: configurable support for of swig vs. native and amqp0-10 vs. 1.0 - default to swig+amqp1.0 if swig is available, native+amqp0-10 otherwise - qpidtoollibs/broker.py: enable use of swig client with BrokerAgent - Swig python client: - support for passing client_properties/properties. - expose AddressHelper pn_data read/write as PnData helper class - set sender/receiver capacity on creation - limited disposition support - rejected messages. - support for additional timeout parameters - expose messaging::Logger, allow log configuration to be set from python. - ha_tests.py: - bind, delete policies not supported by AMQP 1.0, switched to using BrokerAgent QMF. - pass protocol:amqp1.0 connection-option to c++ test clients (qpid-send, qpid-receive) - TX tests forsce use of 0-10 protocol (but still with Swig client if enabled.) - Broker fixes: - Queue::Settings::isTemporary was set in the 0-10 SessionAdapter, moved to Broker::createQueue. - broker::amqp::Session was always setting an exclusive owner in createQueue git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1585588 13f79535-47bb-0310-9956-ffa450edef68
* QPID-5667: C++ broker: QMF subscribe events are not raised with AMQP 1.0Alan Conway2014-04-071-1/+1
| | | | | | | The raise event logic for subscribe/unsubscribe events was in 0-10 specific code. Moved it into Queue.cpp so events are generated regardless of protocol. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1585587 13f79535-47bb-0310-9956-ffa450edef68