X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=tests%2Fregression%2Fust%2Fbaddr-statedump%2Ftest_baddr-statedump.py;h=c145972bb7fe4071c435d2bbac71c42c0c84a47b;hb=ceaa850af52d745b398474c294fb9e66e3b055ce;hp=723eb1ba6ba2c4c234157921873f4c87924ccf33;hpb=db4e2b3e3c9a578a456916f13506012061d919fd;p=lttng-tools.git diff --git a/tests/regression/ust/baddr-statedump/test_baddr-statedump.py b/tests/regression/ust/baddr-statedump/test_baddr-statedump.py index 723eb1ba6..c145972bb 100644 --- a/tests/regression/ust/baddr-statedump/test_baddr-statedump.py +++ b/tests/regression/ust/baddr-statedump/test_baddr-statedump.py @@ -1,20 +1,9 @@ #!/usr/bin/env python3 # -# Copyright (C) - 2013 Jérémie Galarneau -# Copyright (C) - 2015 Antoine Busque +# Copyright (C) 2013 Jérémie Galarneau +# Copyright (C) 2015 Antoine Busque # -# This program is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License, version 2 only, as -# published by the Free Software Foundation. -# -# This program is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for -# more details. -# -# You should have received a copy of the GNU General Public License along with -# this program; if not, write to the Free Software Foundation, Inc., 51 -# Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# SPDX-License-Identifier: GPL-2.0-only import os import subprocess @@ -45,15 +34,8 @@ session_info = create_session() enable_ust_tracepoint_event(session_info, "*") start_session(session_info) -test_process = subprocess.Popen(test_path + "prog.strip", stdout=subprocess.PIPE, stderr=subprocess.PIPE) -if sys.version_info >= (3, 3): - try: - test_process.wait(5) - except subprocess.TimeoutExpired: - test_process.kill() - bail("Failed to run ust baddr-statedump test application.", session_info) -else: - test_process.wait() +test_process = subprocess.Popen(test_path + "prog.strip", stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) +test_process.wait() print_test_result(test_process.returncode == 0, current_test, "Test application exited normally") current_test += 1 @@ -62,9 +44,9 @@ stop_session(session_info) # Check for statedump events in the resulting trace try: - babeltrace_process = subprocess.Popen(["babeltrace", session_info.trace_path], stdout=subprocess.PIPE, stderr=subprocess.PIPE) + babeltrace_process = subprocess.Popen([BABELTRACE_BIN, session_info.trace_path], stdout=subprocess.PIPE, stderr=subprocess.PIPE) except FileNotFoundError: - bail("Could not open babeltrace. Please make sure it is installed.", session_info) + bail("Could not open {}. Please make sure it is installed.".format(BABELTRACE_BIN), session_info) start_event_found = False bin_info_event_found = False