summaryrefslogtreecommitdiff
path: root/qpid/cpp/src/tests/run_paged_queue_tests
blob: c5f6aec927aa311882a78c37f82468d6d3df368d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/usr/bin/env python

#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements.  See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership.  The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License.  You may obtain a copy of the License at
#
#   http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied.  See the License for the
# specific language governing permissions and limitations
# under the License.
#

from common import *

port = start_broker("broker", "--paging-dir={}".format(join(WORK_DIR, "pqtest_data")))

messages = 1000
address = "onepage; {create: always, node:{x-declare:{arguments:{'qpid.paging':True,'qpid.max_pages_loaded':1}}}}"

call_with_valgrind("qpid-send --messages {} --content-size 1024 --broker localhost:{} --address \"{}\"",
                   messages, port, address)

output = call_for_output_with_valgrind("qpid-receive --address onepage --messages {} --broker localhost:{}",
                                       messages, port)

received = len(output.splitlines())

if received != messages:
    fail("Single page test failed: received {} messages, expected {}", received, messages)

option = "node:{x-declare:{arguments:{'qpid.paging':True,'qpid.max_size':0,'qpid.max_count':0,'qpid.flow_stop_size':0,'qpid.flow_resume_size':0,'qpid.flow_stop_count':0,'qpid.flow_resume_count':0}}}"
    
call("qpid-cpp-benchmark --broker localhost:{} --create-option \"{}\"", port, option)
call("qpid-cpp-benchmark --broker localhost:{} --create-option \"{}\" --fill-drain", port, option)

check_results()