commit 03ff410dffb98bd87e364de9c56facab546a3e35
parent 4c6173ee8953b3274cb7411cf2b604187066ac62
Author: James Prestwood <prestwoj@gmail.com>
Date: Thu, 10 Sep 2020 16:12:39 -0700
auto-t: update testClientNonInteractive to use TestContext
This makes any iwctl output hidden unless enabled via the verbose
option.
Diffstat:
1 file changed, 12 insertions(+), 14 deletions(-)
diff --git a/autotests/testClientNonInteractive/connect_command_test.py b/autotests/testClientNonInteractive/connect_command_test.py
@@ -8,6 +8,7 @@ import iwd
from iwd import IWD
import testutil
import subprocess
+from config import ctx
class Test(unittest.TestCase):
@@ -34,11 +35,10 @@ class Test(unittest.TestCase):
# Use --dontaks cmd-line option
with self.assertRaises(subprocess.CalledProcessError):
- subprocess.check_call(['iwctl', '-d', 'station',
- device.name, 'connect', ssid])
+ ctx.start_process(['iwctl', 'd', 'station', device.name, 'connect', ssid], check=True)
- subprocess.check_call(['iwctl', '-P', 'passphrase',
- 'station', device.name, 'connect', ssid])
+ ctx.start_process(['iwctl', '-P', 'passphrase', 'station', device.name, 'connect', ssid],
+ check=True)
self.check_connection_success(ssid)
@@ -47,9 +47,8 @@ class Test(unittest.TestCase):
device = self.wd.list_devices(1)[0]
- subprocess.check_call(['iwctl', '-u', 'user', '-p', 'password',
- 'station', device.name, 'connect', ssid])
-
+ ctx.start_process(['iwctl', '-u', 'user', '-p', 'password', 'station', \
+ device.name, 'connect', ssid], check=True)
self.check_connection_success(ssid)
def test_connection_with_password(self):
@@ -57,8 +56,8 @@ class Test(unittest.TestCase):
device = self.wd.list_devices(1)[0]
- subprocess.check_call(['iwctl', '-p', 'password',
- 'station', device.name, 'connect', ssid])
+ ctx.start_process(['iwctl', '-p', 'password', 'station', device.name, 'connect', ssid],
+ check=True)
self.check_connection_success(ssid)
@@ -68,8 +67,8 @@ class Test(unittest.TestCase):
device = self.wd.list_devices(1)[0]
with self.assertRaises(subprocess.CalledProcessError):
- subprocess.check_call(['iwctl', '-P', 'incorrect_passphrase',
- 'station', device.name, 'connect', ssid])
+ ctx.start_process(['iwctl', '-P', 'incorrect_passphrase', 'station', device.name, \
+ 'connect', ssid], check=True)
def test_invalid_command_line_option(self):
ssid = 'ssidPassphrase'
@@ -77,14 +76,13 @@ class Test(unittest.TestCase):
device = self.wd.list_devices(1)[0]
with self.assertRaises(subprocess.CalledProcessError):
- subprocess.check_call(['iwctl', '-z',
- 'station', device.name, 'connect', ssid])
+ ctx.start_process(['iwctl', '-z', 'station', device.name, 'connect', ssid], check=True)
def test_invalid_command(self):
device = self.wd.list_devices(1)[0]
with self.assertRaises(subprocess.CalledProcessError):
- subprocess.check_call(['iwctl', 'inexistent', 'command'])
+ ctx.start_process(['iwctl', 'inexistent', 'command'], check=True)
@classmethod
def setUpClass(cls):