From 9c778ceeae57914b1bde8669e9369d2ef6288ef2 Mon Sep 17 00:00:00 2001 From: Terence Hampson Date: Thu, 29 Aug 2024 20:04:40 +0200 Subject: [PATCH] Fix Fabric Sync test script issues discovered on TH (#35283) --- src/python_testing/TC_CCTRL_2_2.py | 9 ++++++--- src/python_testing/TC_CCTRL_2_3.py | 9 ++++++--- src/python_testing/TC_MCORE_FS_1_1.py | 9 ++++++--- 3 files changed, 18 insertions(+), 9 deletions(-) diff --git a/src/python_testing/TC_CCTRL_2_2.py b/src/python_testing/TC_CCTRL_2_2.py index 4d11692d14ba24..8080f9db324ff3 100644 --- a/src/python_testing/TC_CCTRL_2_2.py +++ b/src/python_testing/TC_CCTRL_2_2.py @@ -53,11 +53,14 @@ async def setup_class(self): self.port = 5543 discriminator = random.randint(0, 4095) passcode = 20202021 - app_args = f'--secured-device-port {self.port} --discriminator {discriminator} --passcode {passcode} --KVS {self.kvs}' - cmd = f'{app} {app_args}' + cmd = [app] + cmd.extend(['--secured-device-port', str(5543)]) + cmd.extend(['--discriminator', str(discriminator)]) + cmd.extend(['--passcode', str(passcode)]) + cmd.extend(['--KVS', self.kvs]) # TODO: Determine if we want these logs cooked or pushed to somewhere else logging.info("Starting TH_SERVER") - self.app_process = subprocess.Popen(cmd, bufsize=0, shell=True) + self.app_process = subprocess.Popen(cmd) logging.info("TH_SERVER started") time.sleep(3) diff --git a/src/python_testing/TC_CCTRL_2_3.py b/src/python_testing/TC_CCTRL_2_3.py index c733235f635ff8..9baa0856412d5f 100644 --- a/src/python_testing/TC_CCTRL_2_3.py +++ b/src/python_testing/TC_CCTRL_2_3.py @@ -52,11 +52,14 @@ async def setup_class(self): self.port = 5543 discriminator = random.randint(0, 4095) passcode = 20202021 - app_args = f'--secured-device-port {self.port} --discriminator {discriminator} --passcode {passcode} --KVS {self.kvs}' - cmd = f'{app} {app_args}' + cmd = [app] + cmd.extend(['--secured-device-port', str(5543)]) + cmd.extend(['--discriminator', str(discriminator)]) + cmd.extend(['--passcode', str(passcode)]) + cmd.extend(['--KVS', self.kvs]) # TODO: Determine if we want these logs cooked or pushed to somewhere else logging.info("Starting TH_SERVER") - self.app_process = subprocess.Popen(cmd, bufsize=0, shell=True) + self.app_process = subprocess.Popen(cmd) logging.info("TH_SERVER started") time.sleep(3) diff --git a/src/python_testing/TC_MCORE_FS_1_1.py b/src/python_testing/TC_MCORE_FS_1_1.py index f64b718e96f2e8..27978af3dee234 100755 --- a/src/python_testing/TC_MCORE_FS_1_1.py +++ b/src/python_testing/TC_MCORE_FS_1_1.py @@ -45,11 +45,14 @@ async def setup_class(self): self.port = 5543 discriminator = random.randint(0, 4095) passcode = 20202021 - app_args = f'--secured-device-port {self.port} --discriminator {discriminator} --passcode {passcode} --KVS {self.kvs}' - cmd = f'{app} {app_args}' + cmd = [app] + cmd.extend(['--secured-device-port', str(5543)]) + cmd.extend(['--discriminator', str(discriminator)]) + cmd.extend(['--passcode', str(passcode)]) + cmd.extend(['--KVS', self.kvs]) # TODO: Determine if we want these logs cooked or pushed to somewhere else logging.info("Starting application to acts mock a server portion of TH_FSA") - self.app_process = subprocess.Popen(cmd, bufsize=0, shell=True) + self.app_process = subprocess.Popen(cmd) logging.info("Started application to acts mock a server portion of TH_FSA") time.sleep(3)