diff --git a/tests/system_tests_autolinks.py b/tests/system_tests_autolinks.py index 1a22366f4..a94d91aee 100644 --- a/tests/system_tests_autolinks.py +++ b/tests/system_tests_autolinks.py @@ -332,17 +332,6 @@ def setUpClass(cls): cls.route_address = cls.router.addresses[1] cls.ls_route_address = cls.router.addresses[2] - def run_qdstat_general(self): - cmd = ['qdstat', '--bus', str(AutolinkTest.normal_address), '--timeout', str(TIMEOUT)] + ['-g'] - p = self.popen( - cmd, - name='qdstat-' + self.id(), stdout=PIPE, expect=None, - universal_newlines=True) - - out = p.communicate()[0] - assert p.returncode == 0, "qdstat exit status %s, output:\n%s" % (p.returncode, out) - return out - def run_skmanage(self, cmd, input=None, expect=Process.EXIT_OK): p = self.popen( ['skmanage'] + cmd.split(' ') + ['--bus', AutolinkTest.normal_address, '--indent=-1', '--timeout', str(TIMEOUT)], diff --git a/tests/system_tests_tcp_adaptor.py b/tests/system_tests_tcp_adaptor.py index c93672aa0..7ff2fef66 100644 --- a/tests/system_tests_tcp_adaptor.py +++ b/tests/system_tests_tcp_adaptor.py @@ -21,6 +21,7 @@ import json import os import socket +import subprocess import sys import time import traceback @@ -28,11 +29,11 @@ from subprocess import STDOUT 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 TestCase from system_test import TIMEOUT +from system_test import TestCase +from system_test import main_module from system_test import unittest # Tests in this file are organized by classes that inherit TestCase. @@ -89,23 +90,18 @@ class TCP_echo_server: def ncat_available(): - popen_args = ['ncat', '--version'] try: - process = Process(popen_args, - name='ncat_check', - stdout=PIPE, - expect=None, - universal_newlines=True) - out = process.communicate()[0] - return True - except: + return 0 == subprocess.check_call(['ncat', '--version'], + stdout=subprocess.DEVNULL, + stderr=subprocess.DEVNULL) + except OSError: return False # # Test concurrent clients # -class EchoClientRunner(): +class EchoClientRunner: """ Launch an echo client upon construction. Provide poll interface for checking done/error.