Skip to content

Commit

Permalink
Issue #233 - Remove remaining instances of Process(expect=None (#395)
Browse files Browse the repository at this point in the history
  • Loading branch information
jiridanek authored Apr 28, 2022
1 parent 2c99db4 commit 8ce04f7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 23 deletions.
11 changes: 0 additions & 11 deletions tests/system_tests_autolinks.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)],
Expand Down
20 changes: 8 additions & 12 deletions tests/system_tests_tcp_adaptor.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,19 @@
import json
import os
import socket
import subprocess
import sys
import time
import traceback
from subprocess import PIPE
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.
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 8ce04f7

Please sign in to comment.