diff options
author | Satish Kumar <satish.kumar01@arm.com> | 2020-12-09 19:50:19 +0000 |
---|---|---|
committer | Rui Miguel Silva <rui.silva@arm.com> | 2020-12-09 22:04:59 +0000 |
commit | b12eb5abfa367a4d6734b3ee2d05bc95e6c70632 (patch) | |
tree | 697283f629594d8ff407420b11e6430da1952c52 | |
parent | b03c760a17a873410548ab31022ded25f2fea8e3 (diff) |
corstone: use FVP's PID to detect the listening processCORSTONE-700-2020.12.10
Instead of the FVP name, the PID of the FVP process is
used inside the search string which finds the listening
process. This change allows the process to be found
irrespective of the FVP binary path name.
Change-Id: Ia5de1f505e7aa4204b934145482e8f3d08d99aef
Signed-off-by: Satish Kumar <satish.kumar01@arm.com>
-rw-r--r-- | iot/scripts/test/fvp_wrapper.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/iot/scripts/test/fvp_wrapper.py b/iot/scripts/test/fvp_wrapper.py index 3d0e509..03d063e 100644 --- a/iot/scripts/test/fvp_wrapper.py +++ b/iot/scripts/test/fvp_wrapper.py @@ -61,6 +61,9 @@ def show_exception_details(e,e_fvp_path,e_fvp_params): print(json.dumps(e_fvp_params, indent=4)) +def get_pid(name): + return int(check_output(["pidof","-s",name])) + # # wait_iris_server: # @@ -80,7 +83,8 @@ def wait_iris_server(fvp_process, iris_port, max_wait_time,wait_reason=0): if int(ret) == 0: raise Exception("netstat command not installed, please install it") - netstat_cmd = ["sh", "-c", 'netstat -tpnl 2>/dev/null | egrep -i ":{0}.+{1}" | wc -l'.format(iris_port, fvp_process)] + pid = get_pid(fvp_process) + netstat_cmd = ["sh", "-c", 'netstat -tpnl 2>/dev/null | egrep -i ":{0}.+{1}" | wc -l'.format(iris_port, pid)] i = 0 @@ -335,7 +339,7 @@ class FVPWrapper(object): else: raise Exception("Failure to detect Iris server port") - fvp_ready = wait_iris_server(fvp_process=self.fvp_name.lower().replace("-",""), + fvp_ready = wait_iris_server(fvp_process=self.fvp_path, iris_port=g_model_port,max_wait_time=g_wait_fvp_ready,wait_reason=0) if fvp_ready == False: @@ -537,7 +541,7 @@ class FVPWrapper(object): #terminates the model and allows the FVP to release the TXT log files self.fvp.release(True) - fvp_terminated = wait_iris_server(fvp_process=self.fvp_name.lower().replace("-", ""), + fvp_terminated = wait_iris_server(fvp_process=self.fvp_path, iris_port=g_model_port, max_wait_time=g_wait_fvp_finish, wait_reason=1) if fvp_terminated == False: |