You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by jd...@apache.org on 2021/06/30 12:05:37 UTC
[qpid-dispatch] branch main updated: DISPATCH-1539: Remove the
remainder of py2 code from Dispatch (#1279)
This is an automated email from the ASF dual-hosted git repository.
jdanek pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/qpid-dispatch.git
The following commit(s) were added to refs/heads/main by this push:
new 44c14b7 DISPATCH-1539: Remove the remainder of py2 code from Dispatch (#1279)
44c14b7 is described below
commit 44c14b799811a0898a47eee94ac7babc7fbb30dd
Author: Jiri Daněk <jd...@redhat.com>
AuthorDate: Wed Jun 30 14:05:27 2021 +0200
DISPATCH-1539: Remove the remainder of py2 code from Dispatch (#1279)
---
.travis.yml | 5 +-
python/qpid_dispatch/management/entity.py | 2 +-
tests/management_test/schema.py | 10 ----
tests/system_test.py | 78 ------------------------------
tests/system_tests_auth_service_plugin.py | 6 +--
tests/system_tests_authz_service_plugin.py | 12 ++---
tests/system_tests_console.py | 4 +-
tests/system_tests_distribution.py | 69 +++++++++++++-------------
tests/system_tests_grpc.py | 11 +++--
tests/system_tests_http1_adaptor.py | 2 +-
tests/system_tests_http2.py | 46 +++++++++---------
tests/system_tests_qdstat.py | 4 +-
tests/system_tests_sasl_plain.py | 22 ++++-----
tests/system_tests_ssl.py | 32 ++++++------
tests/system_tests_tcp_adaptor.py | 19 ++++----
15 files changed, 118 insertions(+), 204 deletions(-)
diff --git a/.travis.yml b/.travis.yml
index f6b7840..91d9440 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -19,6 +19,8 @@
language: c
cache: ccache
+os: linux
+dist: xenial
jobs:
fast_finish: true
allow_failures:
@@ -65,7 +67,6 @@ jobs:
- name: "qdrouterd:RelWithDebInfo+MemoryDebug (clang on focal)"
os: linux
dist: focal
- compiler: clang
before_install:
# https://travis-ci.community/t/clang-10-was-recently-broken-on-linux-unmet-dependencies-for-clang-10-clang-tidy-10-valgrind/11527
- sudo apt-get install -yq --allow-downgrades libc6=2.31-0ubuntu9.2 libc6-dev=2.31-0ubuntu9.2
@@ -118,8 +119,6 @@ jobs:
os: linux
dist: focal
compiler: clang
- python:
- - "3.9"
before_install:
- sudo apt-get install clang-11 llvm-11-dev
# Install and use the latest Node.js LTS version
diff --git a/python/qpid_dispatch/management/entity.py b/python/qpid_dispatch/management/entity.py
index 320f5be..c16be93 100644
--- a/python/qpid_dispatch/management/entity.py
+++ b/python/qpid_dispatch/management/entity.py
@@ -18,7 +18,7 @@
#
"""
-AMQP Managment Entity
+AMQP Management Entity
"""
import itertools
diff --git a/tests/management_test/schema.py b/tests/management_test/schema.py
index 84d9669..172b48c 100644
--- a/tests/management_test/schema.py
+++ b/tests/management_test/schema.py
@@ -22,19 +22,9 @@
import unittest
import json
-from collections import OrderedDict
from qpid_dispatch_internal.management.schema import Schema, BooleanType, EnumType, AttributeType, ValidationError, EnumValue, EntityType
-def replace_od(thing):
- """Replace OrderedDict with dict"""
- if isinstance(thing, OrderedDict):
- return dict((k, replace_od(v)) for k, v in thing.items())
- if isinstance(thing, list):
- return [replace_od(t) for t in thing]
- return thing
-
-
SCHEMA_1 = {
"prefix": "org.example",
"entityTypes": {
diff --git a/tests/system_test.py b/tests/system_test.py
index f294eca..526552c 100755
--- a/tests/system_test.py
+++ b/tests/system_test.py
@@ -33,7 +33,6 @@ import sys
import time
import __main__
-import functools
import os
import random
import re
@@ -76,9 +75,6 @@ except ImportError as err:
MISSING_MODULES.append(str(err))
-is_python2 = sys.version_info[0] == 2
-
-
def find_exe(program):
"""Find an executable in the system PATH"""
def is_exe(fpath):
@@ -301,39 +297,6 @@ class Process(subprocess.Popen):
if self.expect is not None and self.expect != status:
error("exit code %s, expected %s" % (status, self.expect))
- def wait(self, timeout=None):
- """
- Add support for a timeout when using Python 2
- """
- if timeout is None:
- return super(Process, self).wait()
-
- if is_python2:
- start = time.time()
- while True:
- rc = super(Process, self).poll()
- if rc is not None:
- return rc
- if time.time() - start >= timeout:
- raise Exception("Process did not terminate")
- time.sleep(0.1)
- else:
- return super(Process, self).wait(timeout=timeout)
-
- def communicate(self, input=None, timeout=None):
- """
- Add support for a timeout when using Python 2
- """
- if timeout is None:
- return super(Process, self).communicate(input=input)
-
- if is_python2:
- self.wait(timeout=timeout)
- return super(Process, self).communicate(input=input)
-
- return super(Process, self).communicate(input=input,
- timeout=timeout)
-
class Config(object):
"""Base class for configuration objects that provide a convenient
@@ -875,47 +838,6 @@ class TestCase(unittest.TestCase, Tester): # pylint: disable=too-many-public-me
assert not re.search(regexp, text), msg or "Found %r in '%s'" % (regexp, text)
-class SkipIfNeeded(object):
- """
- Decorator class that can be used along with test methods
- to provide skip test behavior when using both python2.6 or
- a greater version.
- This decorator can be used in test methods and a boolean
- condition must be provided (skip parameter) to define whether
- or not the test will be skipped.
- """
-
- def __init__(self, skip, reason):
- """
- :param skip: if True the method wont be called
- :param reason: reason why test was skipped
- """
- self.skip = skip
- self.reason = reason
-
- def __call__(self, f):
-
- @functools.wraps(f)
- def wrap(*args, **kwargs):
- """
- Wraps original test method's invocation and dictates whether or
- not the test will be executed based on value (boolean) of the
- skip parameter.
- When running test with python < 2.7, if the "skip" parameter is
- true, the original method won't be called. If running python >= 2.7, then
- skipTest will be called with given "reason" and original method
- will be invoked.
- :param args:
- :return:
- """
- instance = args[0]
- if self.skip:
- instance.skipTest(self.reason)
- return f(*args, **kwargs)
-
- return wrap
-
-
def main_module():
"""
Return the module name of the __main__ module - i.e. the filename with the
diff --git a/tests/system_tests_auth_service_plugin.py b/tests/system_tests_auth_service_plugin.py
index 2bf0412..6a7ba59 100644
--- a/tests/system_tests_auth_service_plugin.py
+++ b/tests/system_tests_auth_service_plugin.py
@@ -19,7 +19,7 @@
import os
from subprocess import PIPE, Popen
-from system_test import TestCase, Qdrouterd, main_module, SkipIfNeeded
+from system_test import TestCase, Qdrouterd, main_module
from system_test import unittest
from proton import SASL
from proton.handlers import MessagingHandler
@@ -82,7 +82,7 @@ sql_select: dummy select
('router', {'mode': 'standalone', 'id': 'router'})
])).wait_ready()
- @SkipIfNeeded(not SASL.extended(), "Cyrus library not available. skipping test")
+ @unittest.skipIf(not SASL.extended(), "Cyrus library not available. skipping test")
def test_valid_credentials(self):
"""
Check authentication succeeds when valid credentials are presented.
@@ -93,7 +93,7 @@ sql_select: dummy select
self.assertEqual(True, test.connected)
self.assertIsNone(test.error)
- @SkipIfNeeded(not SASL.extended(), "Cyrus library not available. skipping test")
+ @unittest.skipIf(not SASL.extended(), "Cyrus library not available. skipping test")
def test_invalid_credentials(self):
"""
Check authentication fails when invalid credentials are presented.
diff --git a/tests/system_tests_authz_service_plugin.py b/tests/system_tests_authz_service_plugin.py
index a741afd..3e9ef5c 100644
--- a/tests/system_tests_authz_service_plugin.py
+++ b/tests/system_tests_authz_service_plugin.py
@@ -26,7 +26,7 @@ from proton.handlers import MessagingHandler
from proton.reactor import Container
import system_test
-from system_test import TestCase, Qdrouterd, main_module, DIR, Process, SkipIfNeeded
+from system_test import TestCase, Qdrouterd, main_module, DIR, Process
from system_test import unittest
@@ -91,7 +91,7 @@ mech_list: SCRAM-SHA-1 PLAIN
'saslConfigPath': os.getcwd()})
])).wait_ready()
- @SkipIfNeeded(not SASL.extended(), "Cyrus library not available. skipping test")
+ @unittest.skipIf(not SASL.extended(), "Cyrus library not available. skipping test")
def test_authorized(self):
container = Container()
client = ConnectionHandler('foo', 1)
@@ -101,7 +101,7 @@ mech_list: SCRAM-SHA-1 PLAIN
self.assertEqual(1, client.received)
self.assertEqual(0, len(client.errors))
- @SkipIfNeeded(not SASL.extended(), "Cyrus library not available. skipping test")
+ @unittest.skipIf(not SASL.extended(), "Cyrus library not available. skipping test")
def test_unauthorized(self):
container = Container()
client = ConnectionHandler('bar', 1)
@@ -113,7 +113,7 @@ mech_list: SCRAM-SHA-1 PLAIN
self.assertEqual('amqp:unauthorized-access', client.errors[0])
self.assertEqual('amqp:unauthorized-access', client.errors[1])
- @SkipIfNeeded(not SASL.extended(), "Cyrus library not available. skipping test")
+ @unittest.skipIf(not SASL.extended(), "Cyrus library not available. skipping test")
def test_wildcard(self):
container = Container()
client = ConnectionHandler('whatever', 1)
@@ -123,7 +123,7 @@ mech_list: SCRAM-SHA-1 PLAIN
self.assertEqual(1, client.received)
self.assertEqual(0, len(client.errors))
- @SkipIfNeeded(not SASL.extended(), "Cyrus library not available. skipping test")
+ @unittest.skipIf(not SASL.extended(), "Cyrus library not available. skipping test")
def test_dynamic_source_anonymous_sender(self):
container = Container()
client = DynamicSourceAnonymousSender()
@@ -133,7 +133,7 @@ mech_list: SCRAM-SHA-1 PLAIN
self.assertEqual('hello', client.message)
self.assertEqual(0, len(client.errors))
- @SkipIfNeeded(not SASL.extended(), "Cyrus library not available. skipping test")
+ @unittest.skipIf(not SASL.extended(), "Cyrus library not available. skipping test")
def test_unauthorized_anonymous_sender_target(self):
container = Container()
client = DynamicSourceAnonymousSender()
diff --git a/tests/system_tests_console.py b/tests/system_tests_console.py
index 28e9c77..60757d8 100644
--- a/tests/system_tests_console.py
+++ b/tests/system_tests_console.py
@@ -23,7 +23,7 @@ import time
import unittest
import subprocess
from subprocess import PIPE
-from system_test import main_module, SkipIfNeeded, TestCase
+from system_test import main_module, TestCase
from system_test import Qdrouterd, TIMEOUT, AsyncTestSender, AsyncTestReceiver
from proton import Message
@@ -129,7 +129,7 @@ class ConsoleTest(TestCase):
return out
# If we are unable to run the npm command. Skip the test
- @SkipIfNeeded(ConsolePreReq.should_skip(), 'Test skipped: npm command not found')
+ @unittest.skipIf(ConsolePreReq.should_skip(), 'Test skipped: npm command not found')
def test_console(self):
self.run_console_test()
diff --git a/tests/system_tests_distribution.py b/tests/system_tests_distribution.py
index a488811..4e200f7 100644
--- a/tests/system_tests_distribution.py
+++ b/tests/system_tests_distribution.py
@@ -18,8 +18,9 @@
#
import sys
+
from proton import Message
-from system_test import TestCase, Qdrouterd, main_module, TIMEOUT, SkipIfNeeded, TestTimeout
+from system_test import TestCase, Qdrouterd, main_module, TIMEOUT, TestTimeout
from system_test import unittest
from proton.handlers import MessagingHandler
from proton.reactor import Container, LinkOption, ApplicationEvent, EventInjector
@@ -497,49 +498,49 @@ class DistributionTests (TestCase):
cls.C_addr = router_C.addresses[0]
cls.D_addr = router_D.addresses[0]
- @SkipIfNeeded(DistributionSkipMapper.skip['test_01'], 'Test skipped during development.')
+ @unittest.skipIf(DistributionSkipMapper.skip['test_01'], 'Test skipped during development.')
def test_01_targeted_sender_AC(self):
name = 'test_01'
test = TargetedSenderTest(name, self.A_addr, self.C_addr, "closest/01")
test.run()
self.assertIsNone(test.error)
- @SkipIfNeeded(DistributionSkipMapper.skip['test_02'], 'Test skipped during development.')
+ @unittest.skipIf(DistributionSkipMapper.skip['test_02'], 'Test skipped during development.')
def test_02_targeted_sender_DC(self):
name = 'test_02'
test = TargetedSenderTest(name, self.D_addr, self.C_addr, "closest/02")
test.run()
self.assertIsNone(test.error)
- @SkipIfNeeded(DistributionSkipMapper.skip['test_03'], 'Test skipped during development.')
+ @unittest.skipIf(DistributionSkipMapper.skip['test_03'], 'Test skipped during development.')
def test_03_anonymous_sender_AC(self):
name = 'test_03'
test = AnonymousSenderTest(name, self.A_addr, self.C_addr)
test.run()
self.assertIsNone(test.error)
- @SkipIfNeeded(DistributionSkipMapper.skip['test_04'], 'Test skipped during development.')
+ @unittest.skipIf(DistributionSkipMapper.skip['test_04'], 'Test skipped during development.')
def test_04_anonymous_sender_DC(self):
name = 'test_04'
test = AnonymousSenderTest(name, self.D_addr, self.C_addr)
test.run()
self.assertIsNone(test.error)
- @SkipIfNeeded(DistributionSkipMapper.skip['test_05'], 'Test skipped during development.')
+ @unittest.skipIf(DistributionSkipMapper.skip['test_05'], 'Test skipped during development.')
def test_05_dynamic_reply_to_AC(self):
name = 'test_05'
test = DynamicReplyTo(name, self.A_addr, self.C_addr)
test.run()
self.assertIsNone(test.error)
- @SkipIfNeeded(DistributionSkipMapper.skip['test_06'], 'Test skipped during development.')
+ @unittest.skipIf(DistributionSkipMapper.skip['test_06'], 'Test skipped during development.')
def test_06_dynamic_reply_to_DC(self):
name = 'test_06'
test = DynamicReplyTo(name, self.D_addr, self.C_addr)
test.run()
self.assertIsNone(test.error)
- @SkipIfNeeded(DistributionSkipMapper.skip['test_07'], 'Test skipped during development.')
+ @unittest.skipIf(DistributionSkipMapper.skip['test_07'], 'Test skipped during development.')
def test_07_linkroute(self):
name = 'test_07'
test = LinkAttachRouting(name,
@@ -552,7 +553,7 @@ class DistributionTests (TestCase):
test.run()
self.assertIsNone(test.error)
- @SkipIfNeeded(DistributionSkipMapper.skip['test_08'], 'Test skipped during development.')
+ @unittest.skipIf(DistributionSkipMapper.skip['test_08'], 'Test skipped during development.')
def test_08_linkroute_check_only(self):
name = 'test_08'
test = LinkAttachRoutingCheckOnly(name,
@@ -565,7 +566,7 @@ class DistributionTests (TestCase):
test.run()
self.assertIsNone(test.error)
- @SkipIfNeeded(DistributionSkipMapper.skip['test_09'], 'Test skipped during development.')
+ @unittest.skipIf(DistributionSkipMapper.skip['test_09'], 'Test skipped during development.')
def test_09_closest_linear(self):
name = 'test_09'
test = ClosestTest(name,
@@ -578,7 +579,7 @@ class DistributionTests (TestCase):
test.run()
self.assertIsNone(test.error)
- @SkipIfNeeded(DistributionSkipMapper.skip['test_10'], 'Test skipped during development.')
+ @unittest.skipIf(DistributionSkipMapper.skip['test_10'], 'Test skipped during development.')
def test_10_closest_mesh(self):
name = 'test_10'
test = ClosestTest(name,
@@ -658,7 +659,7 @@ class DistributionTests (TestCase):
# 100 55 33 12
#
- @SkipIfNeeded(DistributionSkipMapper.skip['test_11'], 'Test skipped during development.')
+ @unittest.skipIf(DistributionSkipMapper.skip['test_11'], 'Test skipped during development.')
def test_11_balanced_linear(self):
name = 'test_11'
# slop is how much the second two values may diverge from
@@ -689,7 +690,7 @@ class DistributionTests (TestCase):
test.run()
self.assertIsNone(test.error)
- @SkipIfNeeded(DistributionSkipMapper.skip['test_12'], 'Test skipped during development.')
+ @unittest.skipIf(DistributionSkipMapper.skip['test_12'], 'Test skipped during development.')
def test_12_balanced_linear_omit_middle_receiver(self):
name = 'test_12'
# If we omit the middle receiver, then router A will count
@@ -785,7 +786,7 @@ class DistributionTests (TestCase):
# 3. B and D are both with 1 of their expected values.
#
- @SkipIfNeeded(DistributionSkipMapper.skip['test_13'], 'Test skipped during development.')
+ @unittest.skipIf(DistributionSkipMapper.skip['test_13'], 'Test skipped during development.')
def test_13_balanced_mesh(self):
name = 'test_13'
total = 100
@@ -809,7 +810,7 @@ class DistributionTests (TestCase):
test.run()
self.assertIsNone(test.error)
- @SkipIfNeeded(DistributionSkipMapper.skip['test_14'], 'Test skipped during development.')
+ @unittest.skipIf(DistributionSkipMapper.skip['test_14'], 'Test skipped during development.')
def test_14_multicast_linear(self):
name = 'test_14'
test = MulticastTest(name,
@@ -821,7 +822,7 @@ class DistributionTests (TestCase):
test.run()
self.assertIsNone(test.error)
- @SkipIfNeeded(DistributionSkipMapper.skip['test_15'], 'Test skipped during development.')
+ @unittest.skipIf(DistributionSkipMapper.skip['test_15'], 'Test skipped during development.')
def test_15_multicast_mesh(self):
name = 'test_15'
test = MulticastTest(name,
@@ -833,8 +834,8 @@ class DistributionTests (TestCase):
test.run()
self.assertIsNone(test.error)
- @SkipIfNeeded(DistributionSkipMapper.skip['test_16'], 'Test skipped during development.')
- def test_16_linkroute_linear_all_local(self) :
+ @unittest.skipIf(DistributionSkipMapper.skip['test_16'], 'Test skipped during development.')
+ def test_16_linkroute_linear_all_local(self):
name = 'test_16'
"""
This test should route all senders' link-attaches
@@ -920,8 +921,8 @@ class DistributionTests (TestCase):
test.run()
self.assertIsNone(test.error)
- @SkipIfNeeded(DistributionSkipMapper.skip['test_17'], 'Test skipped during development.')
- def test_17_linkroute_linear_all_B(self) :
+ @unittest.skipIf(DistributionSkipMapper.skip['test_17'], 'Test skipped during development.')
+ def test_17_linkroute_linear_all_B(self):
name = 'test_17'
"""
This test should route all senders' link-attaches
@@ -1007,8 +1008,8 @@ class DistributionTests (TestCase):
test.run()
self.assertIsNone(test.error)
- @SkipIfNeeded(DistributionSkipMapper.skip['test_18'], 'Test skipped during development.')
- def test_18_linkroute_linear_all_C(self) :
+ @unittest.skipIf(DistributionSkipMapper.skip['test_18'], 'Test skipped during development.')
+ def test_18_linkroute_linear_all_C(self):
name = 'test_18'
"""
This test should route all senders' link-attaches
@@ -1094,8 +1095,8 @@ class DistributionTests (TestCase):
test.run()
self.assertIsNone(test.error)
- @SkipIfNeeded(DistributionSkipMapper.skip['test_19'], 'Test skipped during development.')
- def test_19_linkroute_linear_kill(self) :
+ @unittest.skipIf(DistributionSkipMapper.skip['test_19'], 'Test skipped during development.')
+ def test_19_linkroute_linear_kill(self):
name = 'test_19'
"""
Start out as usual, making four senders and seeing their link-attaches
@@ -1241,8 +1242,8 @@ class DistributionTests (TestCase):
test.run()
self.assertIsNone(test.error)
- @SkipIfNeeded(DistributionSkipMapper.skip['test_20'], 'Test skipped during development.')
- def test_20_linkroute_mesh_all_local(self) :
+ @unittest.skipIf(DistributionSkipMapper.skip['test_20'], 'Test skipped during development.')
+ def test_20_linkroute_mesh_all_local(self):
name = 'test_20'
#
# c c
@@ -1341,8 +1342,8 @@ class DistributionTests (TestCase):
test.run()
self.assertIsNone(test.error)
- @SkipIfNeeded(DistributionSkipMapper.skip['test_21'], 'Test skipped during development.')
- def test_21_linkroute_mesh_nonlocal(self) :
+ @unittest.skipIf(DistributionSkipMapper.skip['test_21'], 'Test skipped during development.')
+ def test_21_linkroute_mesh_nonlocal(self):
name = 'test_21'
#
# c
@@ -1441,8 +1442,8 @@ class DistributionTests (TestCase):
test.run()
self.assertIsNone(test.error)
- @SkipIfNeeded(DistributionSkipMapper.skip['test_22'], 'Test skipped during development.')
- def test_22_linkroute_mesh_kill(self) :
+ @unittest.skipIf(DistributionSkipMapper.skip['test_22'], 'Test skipped during development.')
+ def test_22_linkroute_mesh_kill(self):
name = 'test_22'
# c c
@@ -1596,8 +1597,8 @@ class DistributionTests (TestCase):
test.run()
self.assertIsNone(test.error)
- @SkipIfNeeded(DistributionSkipMapper.skip['test_23'], 'Test skipped during development.')
- def test_23_waypoint(self) :
+ @unittest.skipIf(DistributionSkipMapper.skip['test_23'], 'Test skipped during development.')
+ def test_23_waypoint(self):
name = 'test_23'
test = WaypointTest(name,
self.container_ids[1],
@@ -1609,7 +1610,7 @@ class DistributionTests (TestCase):
test.run()
self.assertIsNone(test.error)
- @SkipIfNeeded(DistributionSkipMapper.skip['test_24'], 'Test skipped during development.')
+ @unittest.skipIf(DistributionSkipMapper.skip['test_24'], 'Test skipped during development.')
def test_24_serial_waypoint_test(self):
name = 'test_24'
test = SerialWaypointTest(name,
@@ -1622,7 +1623,7 @@ class DistributionTests (TestCase):
test.run()
self.assertIsNone(test.error)
- @SkipIfNeeded(DistributionSkipMapper.skip['test_25'], 'Test skipped during development.')
+ @unittest.skipIf(DistributionSkipMapper.skip['test_25'], 'Test skipped during development.')
def test_25_parallel_waypoint_test(self):
name = 'test_25'
test = ParallelWaypointTest(name,
diff --git a/tests/system_tests_grpc.py b/tests/system_tests_grpc.py
index eed9aa3..5377b85 100644
--- a/tests/system_tests_grpc.py
+++ b/tests/system_tests_grpc.py
@@ -16,8 +16,9 @@
# specific language governing permissions and limitations
# under the License.
#
+import unittest
-from system_test import TestCase, Qdrouterd, SkipIfNeeded, TIMEOUT
+from system_test import TestCase, Qdrouterd, TIMEOUT
try:
import grpc
import friendship_server as fs
@@ -151,7 +152,7 @@ class GrpcServiceMethodsTest(TestCase):
pe.email = friend
yield pe
- @SkipIfNeeded(skip_test(), "grpcio is needed to run grpc tests")
+ @unittest.skipIf(skip_test(), "grpcio is needed to run grpc tests")
def test_grpc_01_unary(self):
"""
Validates unary request and response message
@@ -163,7 +164,7 @@ class GrpcServiceMethodsTest(TestCase):
p = self.create_person(name, mail)
assert p is not None
- @SkipIfNeeded(skip_test(), "grpcio is needed to run grpc tests")
+ @unittest.skipIf(skip_test(), "grpcio is needed to run grpc tests")
def test_grpc_02_bidirectional_stream(self):
"""
Validates bidirectional streaming request and response messages
@@ -174,7 +175,7 @@ class GrpcServiceMethodsTest(TestCase):
assert res.friend2 is not None
assert not res.error
- @SkipIfNeeded(skip_test(), "grpcio is needed to run grpc tests")
+ @unittest.skipIf(skip_test(), "grpcio is needed to run grpc tests")
def test_grpc_03_server_stream(self):
"""
Validates server streaming response messages
@@ -189,7 +190,7 @@ class GrpcServiceMethodsTest(TestCase):
assert(all(f in self.EXP_FRIENDS[key] for f in friends))
assert(all(f in friends for f in self.EXP_FRIENDS[key]))
- @SkipIfNeeded(skip_test(), "grpcio is needed to run grpc tests")
+ @unittest.skipIf(skip_test(), "grpcio is needed to run grpc tests")
def test_grpc_04_client_stream(self):
"""
Validates client streaming request messages
diff --git a/tests/system_tests_http1_adaptor.py b/tests/system_tests_http1_adaptor.py
index 0bff760..cb5163c 100644
--- a/tests/system_tests_http1_adaptor.py
+++ b/tests/system_tests_http1_adaptor.py
@@ -128,7 +128,7 @@ class Http1AdaptorManagementTest(TestCase):
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
s.bind(("", self.http_server_port))
- s.setblocking(1)
+ s.setblocking(True)
s.settimeout(3) # reconnect attempts every 2.5 seconds
s.listen(1)
with self.assertRaises(socket.timeout):
diff --git a/tests/system_tests_http2.py b/tests/system_tests_http2.py
index 30524a5..5a2a50c 100644
--- a/tests/system_tests_http2.py
+++ b/tests/system_tests_http2.py
@@ -19,9 +19,10 @@
import os
import sys
+import unittest
from time import sleep
import system_test
-from system_test import TestCase, Qdrouterd, QdManager, Process, SkipIfNeeded
+from system_test import TestCase, Qdrouterd, QdManager, Process
from subprocess import PIPE
h2hyper_installed = True
@@ -113,12 +114,13 @@ class Http2TestBase(TestCase):
return out
-class CommonHttp2Tests():
+class CommonHttp2Tests:
"""
Common Base class containing all tests. These tests are run by all
topologies of routers.
"""
- @SkipIfNeeded(skip_test(), "Python 3.7 or greater, Quart 0.13.0 or greater and curl needed to run http2 tests")
+
+ @unittest.skipIf(skip_test(), "Python 3.7 or greater, Quart 0.13.0 or greater and curl needed to run http2 tests")
# Tests the HTTP2 head request
def test_head_request(self):
# Run curl 127.0.0.1:port --http2-prior-knowledge --head
@@ -128,7 +130,7 @@ class CommonHttp2Tests():
self.assertIn('server: hypercorn-h2', out)
self.assertIn('content-type: text/html; charset=utf-8', out)
- @SkipIfNeeded(skip_test(), "Python 3.7 or greater, Quart 0.13.0 or greater and curl needed to run http2 tests")
+ @unittest.skipIf(skip_test(), "Python 3.7 or greater, Quart 0.13.0 or greater and curl needed to run http2 tests")
def test_get_request(self):
# Run curl 127.0.0.1:port --http2-prior-knowledge
address = self.router_qdra.http_addresses[0]
@@ -140,7 +142,7 @@ class CommonHttp2Tests():
i += 1
self.assertIn(ret_string, out)
- # @SkipIfNeeded(skip_test(), "Python 3.7 or greater, Quart 0.13.0 or greater and curl needed to run http2 tests")
+ # @unittest.skipIf(skip_test(), "Python 3.7 or greater, Quart 0.13.0 or greater and curl needed to run http2 tests")
# def test_large_get_request(self):
# Tests a large get request. Response is more than 50k which means it
# will span many qd_http2_buffer_t objects.
@@ -149,49 +151,49 @@ class CommonHttp2Tests():
# out = self.run_curl(address=address)
# self.assertIn("49996,49997,49998,49999", out)
- @SkipIfNeeded(skip_test(), "Python 3.7 or greater, Quart 0.13.0 or greater and curl needed to run http2 tests")
+ @unittest.skipIf(skip_test(), "Python 3.7 or greater, Quart 0.13.0 or greater and curl needed to run http2 tests")
def test_post_request(self):
# curl -d "fname=John&lname=Doe" -X POST 127.0.0.1:9000/myinfo --http2-prior-knowledge
address = self.router_qdra.http_addresses[0] + "/myinfo"
out = self.run_curl(args=['-d', 'fname=John&lname=Doe', '-X', 'POST'], address=address)
self.assertIn('Success! Your first name is John, last name is Doe', out)
- @SkipIfNeeded(skip_test(), "Python 3.7 or greater, Quart 0.13.0 or greater and curl needed to run http2 tests")
+ @unittest.skipIf(skip_test(), "Python 3.7 or greater, Quart 0.13.0 or greater and curl needed to run http2 tests")
def test_delete_request(self):
# curl -X DELETE "http://127.0.0.1:9000/myinfo/delete/22122" -H "accept: application/json" --http2-prior-knowledge
address = self.router_qdra.http_addresses[0] + "/myinfo/delete/22122"
out = self.run_curl(args=['-X', 'DELETE'], address=address)
self.assertIn('{"fname": "John", "lname": "Doe", "id": "22122"}', out)
- @SkipIfNeeded(skip_test(), "Python 3.7 or greater, Quart 0.13.0 or greater and curl needed to run http2 tests")
+ @unittest.skipIf(skip_test(), "Python 3.7 or greater, Quart 0.13.0 or greater and curl needed to run http2 tests")
def test_put_request(self):
# curl -d "fname=John&lname=Doe" -X PUT 127.0.0.1:9000/myinfo --http2-prior-knowledge
address = self.router_qdra.http_addresses[0] + "/myinfo"
out = self.run_curl(args=['-d', 'fname=John&lname=Doe', '-X', 'PUT'], address=address)
self.assertIn('Success! Your first name is John, last name is Doe', out)
- @SkipIfNeeded(skip_test(), "Python 3.7 or greater, Quart 0.13.0 or greater and curl needed to run http2 tests")
+ @unittest.skipIf(skip_test(), "Python 3.7 or greater, Quart 0.13.0 or greater and curl needed to run http2 tests")
def test_patch_request(self):
# curl -d "fname=John&lname=Doe" -X PATCH 127.0.0.1:9000/myinfo --http2-prior-knowledge
address = self.router_qdra.http_addresses[0] + "/patch"
out = self.run_curl(args=['--data', '{\"op\":\"add\",\"path\":\"/user\",\"value\":\"jane\"}', '-X', 'PATCH'], address=address)
self.assertIn('"op":"add"', out)
- @SkipIfNeeded(skip_test(), "Python 3.7 or greater, Quart 0.13.0 or greater and curl needed to run http2 tests")
+ @unittest.skipIf(skip_test(), "Python 3.7 or greater, Quart 0.13.0 or greater and curl needed to run http2 tests")
def test_404(self):
# Run curl 127.0.0.1:port/unavilable --http2-prior-knowledge
address = self.router_qdra.http_addresses[0] + "/unavilable"
out = self.run_curl(address=address)
self.assertIn('404 Not Found', out)
- @SkipIfNeeded(skip_test(), "Python 3.7 or greater, Quart 0.13.0 or greater and curl needed to run http2 tests")
+ @unittest.skipIf(skip_test(), "Python 3.7 or greater, Quart 0.13.0 or greater and curl needed to run http2 tests")
def test_500(self):
# Run curl 127.0.0.1:port/unavilable --http2-prior-knowledge
address = self.router_qdra.http_addresses[0] + "/test/500"
out = self.run_curl(address=address)
self.assertIn('500 Internal Server Error', out)
- @SkipIfNeeded(skip_test(), "Python 3.7 or greater, Quart 0.13.0 or greater and curl needed to run http2 tests")
+ @unittest.skipIf(skip_test(), "Python 3.7 or greater, Quart 0.13.0 or greater and curl needed to run http2 tests")
def test_get_image_png(self):
# Run curl 127.0.0.1:port --http2-prior-knowledge
passed = False
@@ -203,7 +205,7 @@ class CommonHttp2Tests():
passed = True
self.assertTrue(passed)
- @SkipIfNeeded(skip_test(), "Python 3.7 or greater, Quart 0.13.0 or greater and curl needed to run http2 tests")
+ @unittest.skipIf(skip_test(), "Python 3.7 or greater, Quart 0.13.0 or greater and curl needed to run http2 tests")
def test_get_image_jpg(self):
# Run curl 127.0.0.1:port --http2-prior-knowledge
passed = False
@@ -324,12 +326,12 @@ class Http2TestOneStandaloneRouter(Http2TestBase, CommonHttp2Tests):
])
cls.router_qdra = cls.tester.qdrouterd(name, config, wait=True)
- @SkipIfNeeded(skip_test(), "Python 3.7 or greater, Quart 0.13.0 or greater and curl needed to run http2 tests")
+ @unittest.skipIf(skip_test(), "Python 3.7 or greater, Quart 0.13.0 or greater and curl needed to run http2 tests")
def test_zzz_http_connector_delete(self):
self.check_connector_delete(client_addr=self.router_qdra.http_addresses[0],
server_addr=self.router_qdra.addresses[0])
- @SkipIfNeeded(skip_test(), "Python 3.7 or greater, Quart 0.13.0 or greater and curl needed to run http2 tests")
+ @unittest.skipIf(skip_test(), "Python 3.7 or greater, Quart 0.13.0 or greater and curl needed to run http2 tests")
def test_000_stats(self):
# Run curl 127.0.0.1:port --http2-prior-knowledge
address = self.router_qdra.http_addresses[0]
@@ -407,7 +409,7 @@ class Http2TestOneEdgeRouter(Http2TestBase, CommonHttp2Tests):
])
cls.router_qdra = cls.tester.qdrouterd(name, config, wait=True)
- @SkipIfNeeded(skip_test(), "Python 3.7 or greater, Quart 0.13.0 or greater and curl needed to run http2 tests")
+ @unittest.skipIf(skip_test(), "Python 3.7 or greater, Quart 0.13.0 or greater and curl needed to run http2 tests")
def test_zzz_http_connector_delete(self):
self.check_connector_delete(client_addr=self.router_qdra.http_addresses[0],
server_addr=self.router_qdra.addresses[0])
@@ -445,7 +447,7 @@ class Http2TestOneInteriorRouter(Http2TestBase, CommonHttp2Tests):
])
cls.router_qdra = cls.tester.qdrouterd(name, config, wait=True)
- @SkipIfNeeded(skip_test(), "Python 3.7 or greater, Quart 0.13.0 or greater and curl needed to run http2 tests")
+ @unittest.skipIf(skip_test(), "Python 3.7 or greater, Quart 0.13.0 or greater and curl needed to run http2 tests")
def test_zzz_http_connector_delete(self):
self.check_connector_delete(client_addr=self.router_qdra.http_addresses[0],
server_addr=self.router_qdra.addresses[0])
@@ -501,7 +503,7 @@ class Http2TestTwoRouter(Http2TestBase, CommonHttp2Tests):
sleep(2)
- @SkipIfNeeded(skip_test(), "Python 3.7 or greater, Quart 0.13.0 or greater and curl needed to run http2 tests")
+ @unittest.skipIf(skip_test(), "Python 3.7 or greater, Quart 0.13.0 or greater and curl needed to run http2 tests")
def test_000_stats(self):
# Run curl 127.0.0.1:port --http2-prior-knowledge
address = self.router_qdra.http_addresses[0]
@@ -550,7 +552,7 @@ class Http2TestTwoRouter(Http2TestBase, CommonHttp2Tests):
self.assertEqual(stats_b[0].get('bytesOut'), 24)
self.assertEqual(stats_b[0].get('bytesIn'), 3944)
- @SkipIfNeeded(skip_test(), "Python 3.7 or greater, Quart 0.13.0 or greater and curl needed to run http2 tests")
+ @unittest.skipIf(skip_test(), "Python 3.7 or greater, Quart 0.13.0 or greater and curl needed to run http2 tests")
def test_zzz_http_connector_delete(self):
self.check_connector_delete(client_addr=self.router_qdra.http_addresses[0],
server_addr=self.router_qdrb.addresses[0])
@@ -702,7 +704,7 @@ class Http2TestEdgeToEdgeViaInteriorRouter(Http2TestBase, CommonHttp2Tests):
cls.router_qdrb = cls.tester.qdrouterd("edge-router-b", config_edge_b)
sleep(5)
- @SkipIfNeeded(skip_test(), "Python 3.7 or greater, Quart 0.13.0 or greater and curl needed to run http2 tests")
+ @unittest.skipIf(skip_test(), "Python 3.7 or greater, Quart 0.13.0 or greater and curl needed to run http2 tests")
def test_zzz_http_connector_delete(self):
self.check_connector_delete(client_addr=self.router_qdra.http_addresses[0],
server_addr=self.router_qdrb.addresses[0])
@@ -739,8 +741,8 @@ class Http2TestGoAway(Http2TestBase):
])
cls.router_qdra = cls.tester.qdrouterd(name, config, wait=True)
- @SkipIfNeeded(skip_h2_test(),
- "Python 3.7 or greater, hyper-h2 and curl needed to run hyperhttp2 tests")
+ @unittest.skipIf(skip_h2_test(),
+ "Python 3.7 or greater, hyper-h2 and curl needed to run hyperhttp2 tests")
def test_goaway(self):
# Executes a request against the router at the /goaway_test_1 URL
# The router in turn forwards the request to the http2 server which
diff --git a/tests/system_tests_qdstat.py b/tests/system_tests_qdstat.py
index 2f55b7b..9258c63 100644
--- a/tests/system_tests_qdstat.py
+++ b/tests/system_tests_qdstat.py
@@ -23,7 +23,7 @@ import system_test
import unittest
from subprocess import PIPE
from proton import Url, SSLDomain, SSLUnavailable, SASL
-from system_test import main_module, SkipIfNeeded
+from system_test import main_module
from proton.utils import BlockingConnection
@@ -1000,7 +1000,7 @@ try:
def ssl_test_bad(self, url_name, arg_names):
self.assertRaises(AssertionError, self.ssl_test, url_name, arg_names)
- @SkipIfNeeded(not SASL.extended(), "Cyrus library not available. skipping test")
+ @unittest.skipIf(not SASL.extended(), "Cyrus library not available. skipping test")
def test_ssl_cert_to_auth_fail_no_sasl_external(self):
self.ssl_test_bad('auth_s', ['client_cert_all'])
diff --git a/tests/system_tests_sasl_plain.py b/tests/system_tests_sasl_plain.py
index 452d5c7..6afc9f3 100644
--- a/tests/system_tests_sasl_plain.py
+++ b/tests/system_tests_sasl_plain.py
@@ -20,7 +20,7 @@
from time import sleep
import os
from subprocess import PIPE, Popen
-from system_test import TestCase, Qdrouterd, main_module, DIR, TIMEOUT, SkipIfNeeded
+from system_test import TestCase, Qdrouterd, main_module, DIR, TIMEOUT
from system_test import unittest, QdManager
from qpid_dispatch.management.client import Node
from proton import SASL
@@ -122,7 +122,7 @@ class RouterTestPlainSaslFailure(RouterTestPlainSaslCommon):
# Give some time for connector failures to be written to the log.
sleep(3)
- @SkipIfNeeded(not SASL.extended(), "Cyrus library not available. skipping test")
+ @unittest.skipIf(not SASL.extended(), "Cyrus library not available. skipping test")
def test_inter_router_sasl_fail(self):
passed = False
long_type = 'org.apache.qpid.dispatch.connection'
@@ -218,7 +218,7 @@ class RouterTestPlainSaslFailureUsingLiteral(RouterTestPlainSaslCommon):
# Give some time for connector failures to be written to the log.
sleep(3)
- @SkipIfNeeded(not SASL.extended(), "Cyrus library not available. skipping test")
+ @unittest.skipIf(not SASL.extended(), "Cyrus library not available. skipping test")
def test_inter_router_sasl_fail(self):
passed = False
long_type = 'org.apache.qpid.dispatch.connection'
@@ -298,7 +298,7 @@ class RouterTestPlainSasl(RouterTestPlainSaslCommon):
cls.routers[1].wait_router_connected('QDR.X')
- @SkipIfNeeded(not SASL.extended(), "Cyrus library not available. skipping test")
+ @unittest.skipIf(not SASL.extended(), "Cyrus library not available. skipping test")
def test_inter_router_plain_exists(self):
"""
Check authentication of inter-router link is PLAIN.
@@ -321,7 +321,7 @@ class RouterTestPlainSasl(RouterTestPlainSaslCommon):
self.assertIn("inter-router", out)
self.assertIn("test@domain.com(PLAIN)", out)
- @SkipIfNeeded(not SASL.extended(), "Cyrus library not available. skipping test")
+ @unittest.skipIf(not SASL.extended(), "Cyrus library not available. skipping test")
def test_qdstat_connect_sasl(self):
"""
Make qdstat use sasl plain authentication.
@@ -345,7 +345,7 @@ class RouterTestPlainSasl(RouterTestPlainSaslCommon):
self.assertEqual(1, split_list.count("inter-router"))
self.assertEqual(1, split_list.count("normal"))
- @SkipIfNeeded(not SASL.extended(), "Cyrus library not available. skipping test")
+ @unittest.skipIf(not SASL.extended(), "Cyrus library not available. skipping test")
def test_qdstat_connect_sasl_password_file(self):
"""
Make qdstat use sasl plain authentication with client password specified in a file.
@@ -449,7 +449,7 @@ class RouterTestPlainSaslOverSsl(RouterTestPlainSaslCommon):
cls.routers[1].wait_router_connected('QDR.X')
- @SkipIfNeeded(not SASL.extended(), "Cyrus library not available. skipping test")
+ @unittest.skipIf(not SASL.extended(), "Cyrus library not available. skipping test")
def test_aaa_qdstat_connect_sasl_over_ssl(self):
"""
Make qdstat use sasl plain authentication over ssl.
@@ -481,7 +481,7 @@ class RouterTestPlainSaslOverSsl(RouterTestPlainSaslCommon):
self.assertEqual(1, split_list.count("inter-router"))
self.assertEqual(1, split_list.count("normal"))
- @SkipIfNeeded(not SASL.extended(), "Cyrus library not available. skipping test")
+ @unittest.skipIf(not SASL.extended(), "Cyrus library not available. skipping test")
def test_inter_router_plain_over_ssl_exists(self):
"""The setUpClass sets up two routers with SASL PLAIN enabled over TLS.
@@ -581,7 +581,7 @@ class RouterTestVerifyHostNameYes(RouterTestPlainSaslCommon):
except:
pass
- @SkipIfNeeded(not SASL.extended(), "Cyrus library not available. skipping test")
+ @unittest.skipIf(not SASL.extended(), "Cyrus library not available. skipping test")
def test_no_inter_router_connection(self):
"""
Tests to make sure that there are no 'inter-router' connections.
@@ -703,7 +703,7 @@ class RouterTestVerifyHostNameNo(RouterTestPlainSaslCommon):
# user must be test@domain.com
self.assertEqual('test@domain.com', results[N].user)
- @SkipIfNeeded(not SASL.extended(), "Cyrus library not available. skipping test")
+ @unittest.skipIf(not SASL.extended(), "Cyrus library not available. skipping test")
def test_inter_router_plain_over_ssl_exists(self):
"""
Tests to make sure that an inter-router connection exists between the routers since verifyHostname is 'no'.
@@ -714,7 +714,7 @@ class RouterTestVerifyHostNameNo(RouterTestPlainSaslCommon):
self.common_asserts(results)
- @SkipIfNeeded(not SASL.extended(), "Cyrus library not available. skipping test")
+ @unittest.skipIf(not SASL.extended(), "Cyrus library not available. skipping test")
def test_zzz_delete_create_ssl_profile(self):
"""
Deletes a connector and its corresponding ssl profile and recreates both
diff --git a/tests/system_tests_ssl.py b/tests/system_tests_ssl.py
index ed563d4..1e78eae 100644
--- a/tests/system_tests_ssl.py
+++ b/tests/system_tests_ssl.py
@@ -27,7 +27,7 @@ import re
import time
from subprocess import Popen, PIPE
from qpid_dispatch.management.client import Node
-from system_test import TestCase, main_module, Qdrouterd, DIR, SkipIfNeeded
+from system_test import TestCase, main_module, Qdrouterd, DIR
from system_test import unittest
from proton import SASL, Url, SSLDomain, SSLUnavailable
from proton.utils import BlockingConnection
@@ -456,7 +456,7 @@ class RouterTestSslClient(RouterTestSslBase):
self.OPENSSL_ALLOW_TLSV1_2 and tlsv1_2,
self.OPENSSL_ALLOW_TLSV1_3 and tlsv1_3]
- @SkipIfNeeded(RouterTestSslBase.DISABLE_SSL_TESTING, RouterTestSslBase.DISABLE_REASON)
+ @unittest.skipIf(RouterTestSslBase.DISABLE_SSL_TESTING, RouterTestSslBase.DISABLE_REASON)
def test_tls1_only(self):
"""
Expects TLSv1 only is allowed
@@ -464,7 +464,7 @@ class RouterTestSslClient(RouterTestSslBase):
self.assertEqual(self.get_expected_tls_result([True, False, False, False]),
self.get_allowed_protocols(self.PORT_TLS1))
- @SkipIfNeeded(RouterTestSslBase.DISABLE_SSL_TESTING, RouterTestSslBase.DISABLE_REASON)
+ @unittest.skipIf(RouterTestSslBase.DISABLE_SSL_TESTING, RouterTestSslBase.DISABLE_REASON)
def test_tls11_only(self):
"""
Expects TLSv1.1 only is allowed
@@ -472,7 +472,7 @@ class RouterTestSslClient(RouterTestSslBase):
self.assertEqual(self.get_expected_tls_result([False, True, False, False]),
self.get_allowed_protocols(self.PORT_TLS11))
- @SkipIfNeeded(RouterTestSslBase.DISABLE_SSL_TESTING, RouterTestSslBase.DISABLE_REASON)
+ @unittest.skipIf(RouterTestSslBase.DISABLE_SSL_TESTING, RouterTestSslBase.DISABLE_REASON)
def test_tls12_only(self):
"""
Expects TLSv1.2 only is allowed
@@ -480,7 +480,7 @@ class RouterTestSslClient(RouterTestSslBase):
self.assertEqual(self.get_expected_tls_result([False, False, True, False]),
self.get_allowed_protocols(self.PORT_TLS12))
- @SkipIfNeeded(RouterTestSslBase.DISABLE_SSL_TESTING, RouterTestSslBase.DISABLE_REASON)
+ @unittest.skipIf(RouterTestSslBase.DISABLE_SSL_TESTING, RouterTestSslBase.DISABLE_REASON)
def test_tls13_only(self):
"""
Expects TLSv1.3 only is allowed
@@ -488,7 +488,7 @@ class RouterTestSslClient(RouterTestSslBase):
self.assertEqual(self.get_expected_tls_result([False, False, False, True]),
self.get_allowed_protocols(self.PORT_TLS13))
- @SkipIfNeeded(RouterTestSslBase.DISABLE_SSL_TESTING, RouterTestSslBase.DISABLE_REASON)
+ @unittest.skipIf(RouterTestSslBase.DISABLE_SSL_TESTING, RouterTestSslBase.DISABLE_REASON)
def test_tls1_tls11_only(self):
"""
Expects TLSv1 and TLSv1.1 only are allowed
@@ -496,7 +496,7 @@ class RouterTestSslClient(RouterTestSslBase):
self.assertEqual(self.get_expected_tls_result([True, True, False, False]),
self.get_allowed_protocols(self.PORT_TLS1_TLS11))
- @SkipIfNeeded(RouterTestSslBase.DISABLE_SSL_TESTING, RouterTestSslBase.DISABLE_REASON)
+ @unittest.skipIf(RouterTestSslBase.DISABLE_SSL_TESTING, RouterTestSslBase.DISABLE_REASON)
def test_tls1_tls12_only(self):
"""
Expects TLSv1 and TLSv1.2 only are allowed
@@ -504,7 +504,7 @@ class RouterTestSslClient(RouterTestSslBase):
self.assertEqual(self.get_expected_tls_result([True, False, True, False]),
self.get_allowed_protocols(self.PORT_TLS1_TLS12))
- @SkipIfNeeded(RouterTestSslBase.DISABLE_SSL_TESTING, RouterTestSslBase.DISABLE_REASON)
+ @unittest.skipIf(RouterTestSslBase.DISABLE_SSL_TESTING, RouterTestSslBase.DISABLE_REASON)
def test_tls11_tls12_only(self):
"""
Expects TLSv1.1 and TLSv1.2 only are allowed
@@ -512,7 +512,7 @@ class RouterTestSslClient(RouterTestSslBase):
self.assertEqual(self.get_expected_tls_result([False, True, True, False]),
self.get_allowed_protocols(self.PORT_TLS11_TLS12))
- @SkipIfNeeded(RouterTestSslBase.DISABLE_SSL_TESTING, RouterTestSslBase.DISABLE_REASON)
+ @unittest.skipIf(RouterTestSslBase.DISABLE_SSL_TESTING, RouterTestSslBase.DISABLE_REASON)
def test_tls_all(self):
"""
Expects all supported versions: TLSv1, TLSv1.1, TLSv1.2 and TLSv1.3 to be allowed
@@ -520,15 +520,15 @@ class RouterTestSslClient(RouterTestSslBase):
self.assertEqual(self.get_expected_tls_result([True, True, True, True]),
self.get_allowed_protocols(self.PORT_TLS_ALL))
- @SkipIfNeeded(RouterTestSslBase.DISABLE_SSL_TESTING, RouterTestSslBase.DISABLE_REASON)
+ @unittest.skipIf(RouterTestSslBase.DISABLE_SSL_TESTING, RouterTestSslBase.DISABLE_REASON)
def test_ssl_invalid(self):
"""
Expects connection is rejected as SSL is no longer supported
"""
self.assertEqual(False, self.is_proto_allowed(self.PORT_SSL3, 'SSLv3'))
- @SkipIfNeeded(RouterTestSslBase.DISABLE_SSL_TESTING or not SASL.extended(),
- "Cyrus library not available. skipping test")
+ @unittest.skipIf(RouterTestSslBase.DISABLE_SSL_TESTING or not SASL.extended(),
+ "Cyrus library not available. skipping test")
def test_ssl_sasl_client_valid(self):
"""
Attempts to connect a Proton client using a valid SASL authentication info
@@ -542,8 +542,8 @@ class RouterTestSslClient(RouterTestSslBase):
self.assertEqual(exp_tls_results[0], self.is_ssl_sasl_client_accepted(self.PORT_TLS_SASL, "TLSv1"))
self.assertEqual(exp_tls_results[2], self.is_ssl_sasl_client_accepted(self.PORT_TLS_SASL, "TLSv1.2"))
- @SkipIfNeeded(RouterTestSslBase.DISABLE_SSL_TESTING or not SASL.extended(),
- "Cyrus library not available. skipping test")
+ @unittest.skipIf(RouterTestSslBase.DISABLE_SSL_TESTING or not SASL.extended(),
+ "Cyrus library not available. skipping test")
def test_ssl_sasl_client_invalid(self):
"""
Attempts to connect a Proton client using a valid SASL authentication info
@@ -756,8 +756,8 @@ class RouterTestSslInterRouter(RouterTestSslBase):
node.close()
return router_nodes
- @SkipIfNeeded(RouterTestSslBase.DISABLE_SSL_TESTING or not SASL.extended(),
- "Cyrus library not available. skipping test")
+ @unittest.skipIf(RouterTestSslBase.DISABLE_SSL_TESTING or not SASL.extended(),
+ "Cyrus library not available. skipping test")
def test_connected_tls_sasl_routers(self):
"""
Validates if all expected routers are connected in the network
diff --git a/tests/system_tests_tcp_adaptor.py b/tests/system_tests_tcp_adaptor.py
index a3d74a8..71bce4c 100644
--- a/tests/system_tests_tcp_adaptor.py
+++ b/tests/system_tests_tcp_adaptor.py
@@ -28,7 +28,6 @@ from system_test import Logger
from system_test import main_module
from system_test import Process
from system_test import Qdrouterd
-from system_test import SkipIfNeeded
from system_test import TestCase
from system_test import TIMEOUT
from system_test import unittest
@@ -770,7 +769,7 @@ class TcpAdaptor(TestCase):
#
# Tests run by ctest
#
- @SkipIfNeeded(DISABLE_SELECTOR_TESTS, DISABLE_SELECTOR_REASON)
+ @unittest.skipIf(DISABLE_SELECTOR_TESTS, DISABLE_SELECTOR_REASON)
def test_01_tcp_basic_connectivity(self):
"""
Echo a series of 1-byte messages, one at a time, to prove general connectivity.
@@ -790,7 +789,7 @@ class TcpAdaptor(TestCase):
self.logger.log("TCP_TEST test_01_tcp_basic_connectivity Stop %s SUCCESS" % name)
# larger messages
- @SkipIfNeeded(DISABLE_SELECTOR_TESTS, DISABLE_SELECTOR_REASON)
+ @unittest.skipIf(DISABLE_SELECTOR_TESTS, DISABLE_SELECTOR_REASON)
def test_10_tcp_INTA_INTA_100(self):
name = "test_10_tcp_INTA_INTA_100"
self.logger.log("TCP_TEST Start %s" % name)
@@ -802,7 +801,7 @@ class TcpAdaptor(TestCase):
assert result is None, "TCP_TEST Stop %s FAIL: %s" % (name, result)
self.logger.log("TCP_TEST Stop %s SUCCESS" % name)
- @SkipIfNeeded(DISABLE_SELECTOR_TESTS, DISABLE_SELECTOR_REASON)
+ @unittest.skipIf(DISABLE_SELECTOR_TESTS, DISABLE_SELECTOR_REASON)
def test_11_tcp_INTA_INTA_1000(self):
name = "test_11_tcp_INTA_INTA_1000"
self.logger.log("TCP_TEST Start %s" % name)
@@ -814,7 +813,7 @@ class TcpAdaptor(TestCase):
assert result is None, "TCP_TEST Stop %s FAIL: %s" % (name, result)
self.logger.log("TCP_TEST Stop %s SUCCESS" % name)
- @SkipIfNeeded(DISABLE_SELECTOR_TESTS, DISABLE_SELECTOR_REASON)
+ @unittest.skipIf(DISABLE_SELECTOR_TESTS, DISABLE_SELECTOR_REASON)
def test_12_tcp_INTA_INTA_500000(self):
name = "test_12_tcp_INTA_INTA_500000"
self.logger.log("TCP_TEST Start %s" % name)
@@ -826,7 +825,7 @@ class TcpAdaptor(TestCase):
assert result is None, "TCP_TEST Stop %s FAIL: %s" % (name, result)
self.logger.log("TCP_TEST Stop %s SUCCESS" % name)
- @SkipIfNeeded(DISABLE_SELECTOR_TESTS, DISABLE_SELECTOR_REASON)
+ @unittest.skipIf(DISABLE_SELECTOR_TESTS, DISABLE_SELECTOR_REASON)
def test_13_tcp_EA1_EC2_500000(self):
name = "test_12_tcp_EA1_EC2_500000"
self.logger.log("TCP_TEST Start %s" % name)
@@ -837,7 +836,7 @@ class TcpAdaptor(TestCase):
sys.stdout.flush()
assert result is None, "TCP_TEST Stop %s FAIL: %s" % (name, result)
- @SkipIfNeeded(DISABLE_SELECTOR_TESTS, DISABLE_SELECTOR_REASON)
+ @unittest.skipIf(DISABLE_SELECTOR_TESTS, DISABLE_SELECTOR_REASON)
def test_20_tcp_connect_disconnect(self):
name = "test_20_tcp_connect_disconnect"
self.logger.log("TCP_TEST Start %s" % name)
@@ -851,7 +850,7 @@ class TcpAdaptor(TestCase):
self.logger.log("TCP_TEST Stop %s SUCCESS" % name)
# concurrent messages
- @SkipIfNeeded(DISABLE_SELECTOR_TESTS, DISABLE_SELECTOR_REASON)
+ @unittest.skipIf(DISABLE_SELECTOR_TESTS, DISABLE_SELECTOR_REASON)
def test_50_concurrent(self):
name = "test_50_concurrent_AtoA_BtoB"
self.logger.log("TCP_TEST Start %s" % name)
@@ -865,7 +864,7 @@ class TcpAdaptor(TestCase):
self.logger.log("TCP_TEST Stop %s SUCCESS" % name)
# Q2 holdoff
- @SkipIfNeeded(DISABLE_SELECTOR_TESTS, DISABLE_SELECTOR_REASON)
+ @unittest.skipIf(DISABLE_SELECTOR_TESTS, DISABLE_SELECTOR_REASON)
def test_60_q2_holdoff(self):
# for now, Q2 is disabled to avoid stalling TCP backpressure
self.skipTest("Q2 is disabled on TCP adaptor")
@@ -1010,7 +1009,7 @@ class TcpAdaptorManagementTest(TestCase):
# The router and the echo server are running at this point.
assert cls.echo_server.is_running
- @SkipIfNeeded(DISABLE_SELECTOR_TESTS, DISABLE_SELECTOR_REASON)
+ @unittest.skipIf(DISABLE_SELECTOR_TESTS, DISABLE_SELECTOR_REASON)
def test_01_mgmt(self):
"""
Create and delete TCP connectors and listeners
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org