From e4b937d3c4ddb960002a3aa9b0f209eb63c8b710 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20Benn=C3=A9e?= Date: Tue, 17 Nov 2020 17:36:30 +0000 Subject: scripts/ci: clean up default args logic a little MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This allows us to do: ./scripts/ci/gitlab-pipeline-status -w -b HEAD -p 2961854 to check out own pipeline status of a recently pushed branch. Signed-off-by: Alex Bennée Reviewed-by: Wainer dos Santos Moschetta Message-Id: <20201117173635.29101-2-alex.bennee@linaro.org> --- scripts/ci/gitlab-pipeline-status | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/scripts/ci/gitlab-pipeline-status b/scripts/ci/gitlab-pipeline-status index bac8233..78e72f6 100755 --- a/scripts/ci/gitlab-pipeline-status +++ b/scripts/ci/gitlab-pipeline-status @@ -31,7 +31,7 @@ class NoPipelineFound(Exception): """Communication is successfull but pipeline is not found.""" -def get_local_branch_commit(branch='staging'): +def get_local_branch_commit(branch): """ Returns the commit sha1 for the *local* branch named "staging" """ @@ -126,18 +126,16 @@ def create_parser(): help=('The GitLab project ID. Defaults to the project ' 'for https://gitlab.com/qemu-project/qemu, that ' 'is, "%(default)s"')) - try: - default_commit = get_local_branch_commit() - commit_required = False - except ValueError: - default_commit = '' - commit_required = True - parser.add_argument('-c', '--commit', required=commit_required, - default=default_commit, + parser.add_argument('-b', '--branch', type=str, default="staging", + help=('Specify the branch to check. ' + 'Use HEAD for your current branch. ' + 'Otherwise looks at "%(default)s"')) + parser.add_argument('-c', '--commit', + default=None, help=('Look for a pipeline associated with the given ' 'commit. If one is not explicitly given, the ' - 'commit associated with the local branch named ' - '"staging" is used. Default: %(default)s')) + 'commit associated with the default branch ' + 'is used.')) parser.add_argument('--verbose', action='store_true', default=False, help=('A minimal verbosity level that prints the ' 'overall result of the check/wait')) @@ -149,6 +147,10 @@ def main(): """ parser = create_parser() args = parser.parse_args() + + if not args.commit: + args.commit = get_local_branch_commit(args.branch) + success = False try: if args.wait: -- cgit v1.1 From 8c175c63eefe4efb8614718a9cbc72d03ce4d4a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20Benn=C3=A9e?= Date: Tue, 17 Nov 2020 17:36:31 +0000 Subject: tests: add prefixes to the bare mkdtemp calls MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The first step to debug a thing is to know what created the thing in the first place. Add some prefixes so random tmpdir's have something grep in the code. Signed-off-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Wainer dos Santos Moschetta Reviewed-by: Thomas Huth Message-Id: <20201117173635.29101-3-alex.bennee@linaro.org> --- python/qemu/machine.py | 3 ++- tests/acceptance/avocado_qemu/__init__.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/python/qemu/machine.py b/python/qemu/machine.py index 6420f01..64d966a 100644 --- a/python/qemu/machine.py +++ b/python/qemu/machine.py @@ -303,7 +303,8 @@ class QEMUMachine: return args def _pre_launch(self) -> None: - self._temp_dir = tempfile.mkdtemp(dir=self._test_dir) + self._temp_dir = tempfile.mkdtemp(prefix="qemu-machine-", + dir=self._test_dir) self._qemu_log_path = os.path.join(self._temp_dir, self._name + ".log") self._qemu_log_file = open(self._qemu_log_path, 'wb') diff --git a/tests/acceptance/avocado_qemu/__init__.py b/tests/acceptance/avocado_qemu/__init__.py index 4cda037..307020b 100644 --- a/tests/acceptance/avocado_qemu/__init__.py +++ b/tests/acceptance/avocado_qemu/__init__.py @@ -171,7 +171,8 @@ class Test(avocado.Test): self.cancel("No QEMU binary defined or found in the build tree") def _new_vm(self, *args): - vm = QEMUMachine(self.qemu_bin, sock_dir=tempfile.mkdtemp()) + sd = tempfile.mkdtemp(prefix="avo_qemu_sock_") + vm = QEMUMachine(self.qemu_bin, sock_dir=sd) if args: vm.add_args(*args) return vm -- cgit v1.1 From 69272bec1a1934a9a133c807fe238a91ace70e0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20Benn=C3=A9e?= Date: Tue, 17 Nov 2020 17:36:32 +0000 Subject: tests/avocado: clean-up socket directory after run MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Previously we were leaving temporary directories behind. While the QEMUMachine does make efforts to clean up after itself the directory belongs to the calling function. We use TemporaryDirectory to wrap this although we explicitly clear the reference in tearDown() as it doesn't get cleaned up otherwise. Signed-off-by: Alex Bennée Message-Id: <20201117173635.29101-4-alex.bennee@linaro.org> --- tests/acceptance/avocado_qemu/__init__.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/acceptance/avocado_qemu/__init__.py b/tests/acceptance/avocado_qemu/__init__.py index 307020b..bf54e41 100644 --- a/tests/acceptance/avocado_qemu/__init__.py +++ b/tests/acceptance/avocado_qemu/__init__.py @@ -171,8 +171,8 @@ class Test(avocado.Test): self.cancel("No QEMU binary defined or found in the build tree") def _new_vm(self, *args): - sd = tempfile.mkdtemp(prefix="avo_qemu_sock_") - vm = QEMUMachine(self.qemu_bin, sock_dir=sd) + self._sd = tempfile.TemporaryDirectory(prefix="avo_qemu_sock_") + vm = QEMUMachine(self.qemu_bin, sock_dir=self._sd.name) if args: vm.add_args(*args) return vm @@ -193,6 +193,7 @@ class Test(avocado.Test): def tearDown(self): for vm in self._vms.values(): vm.shutdown() + self._sd = None def fetch_asset(self, name, asset_hash=None, algorithm=None, -- cgit v1.1 From ac74e282d4c769b4fb4f58b8f5e04df5c03f3c49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20Benn=C3=A9e?= Date: Tue, 17 Nov 2020 17:36:33 +0000 Subject: gitlab: move remaining x86 check-tcg targets to gitlab MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The GCC check-tcg (user) test in particular was very prone to timing out on Travis. We only actually need to move the some-softmmu builds across as we already have coverage for linux-user. As --enable-debug-tcg does increase the run time somewhat as more debug is put in let's restrict that to just the plugins build. It's unlikely that a plugins enabled build is going to hide a sanity failure in core TCG code so let the plugin builds do the heavy lifting on checking TCG sanity so the non-plugin builds can run swiftly. Now the only remaining check-tcg builds on Travis are for the various non-x86 arches. Signed-off-by: Alex Bennée Reviewed-by: Wainer dos Santos Moschetta Reviewed-by: Thomas Huth Message-Id: <20201117173635.29101-5-alex.bennee@linaro.org> --- .gitlab-ci.yml | 17 +++++++++++++++++ .travis.yml | 26 -------------------------- 2 files changed, 17 insertions(+), 26 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 9a8b375..b406027 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -247,6 +247,15 @@ build-user: CONFIGURE_ARGS: --disable-tools --disable-system MAKE_CHECK_ARGS: check-tcg +# Only build the softmmu targets we have check-tcg tests for +build-some-softmmu: + <<: *native_build_job_definition + variables: + IMAGE: debian-all-test-cross + CONFIGURE_ARGS: --disable-tools --enable-debug-tcg + TARGETS: xtensa-softmmu arm-softmmu aarch64-softmmu alpha-softmmu + MAKE_CHECK_ARGS: check-tcg + # Run check-tcg against linux-user (with plugins) # we skip sparc64-linux-user until it has been fixed somewhat # we skip cris-linux-user as it doesn't use the common run loop @@ -258,6 +267,14 @@ build-user-plugins: MAKE_CHECK_ARGS: check-tcg timeout: 1h 30m +build-some-softmmu-plugins: + <<: *native_build_job_definition + variables: + IMAGE: debian-all-test-cross + CONFIGURE_ARGS: --disable-tools --disable-user --enable-plugins --enable-debug-tcg + TARGETS: xtensa-softmmu arm-softmmu aarch64-softmmu alpha-softmmu + MAKE_CHECK_ARGS: check-tcg + build-clang: <<: *native_build_job_definition variables: diff --git a/.travis.yml b/.travis.yml index a3d7817..bac085f8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -301,32 +301,6 @@ jobs: - ${SRC_DIR}/configure ${CONFIG} --extra-cflags="-g3 -O0 -fsanitize=thread" || { cat config.log meson-logs/meson-log.txt && exit 1; } - # Run check-tcg against linux-user - - name: "GCC check-tcg (user)" - env: - - CONFIG="--disable-system --enable-debug-tcg" - - TEST_BUILD_CMD="make build-tcg" - - TEST_CMD="make check-tcg" - - CACHE_NAME="${TRAVIS_BRANCH}-linux-gcc-debug-tcg" - - - # Run check-tcg against softmmu targets - - name: "GCC check-tcg (some-softmmu)" - env: - - CONFIG="--enable-debug-tcg --target-list=xtensa-softmmu,arm-softmmu,aarch64-softmmu,alpha-softmmu" - - TEST_BUILD_CMD="make build-tcg" - - TEST_CMD="make check-tcg" - - CACHE_NAME="${TRAVIS_BRANCH}-linux-gcc-debug-tcg" - - - # Run check-tcg against softmmu targets (with plugins) - - name: "GCC plugins check-tcg (some-softmmu)" - env: - - CONFIG="--enable-plugins --enable-debug-tcg --target-list=xtensa-softmmu,arm-softmmu,aarch64-softmmu,alpha-softmmu" - - TEST_BUILD_CMD="make build-tcg" - - TEST_CMD="make check-tcg" - - CACHE_NAME="${TRAVIS_BRANCH}-linux-gcc-debug-tcg" - - name: "[aarch64] GCC check-tcg" arch: arm64 dist: focal -- cgit v1.1 From 8e9419b7902f6ae789101071ebf86c3a245be916 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Date: Tue, 17 Nov 2020 17:36:34 +0000 Subject: tests/docker: Install liblttng-ust-dev package in Ubuntu 20.04 image MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Install the liblttng-ust-dev package to be able to build QEMU using the User-Space Tracer trace backend (configure --enable-trace-backends=ust). Suggested-by: Wainer dos Santos Moschetta Signed-off-by: Philippe Mathieu-Daudé Signed-off-by: Alex Bennée Message-Id: <20201111121234.3246812-2-philmd@redhat.com> Message-Id: <20201117173635.29101-6-alex.bennee@linaro.org> --- tests/docker/dockerfiles/ubuntu2004.docker | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/docker/dockerfiles/ubuntu2004.docker b/tests/docker/dockerfiles/ubuntu2004.docker index 355bbb3..ae889d8 100644 --- a/tests/docker/dockerfiles/ubuntu2004.docker +++ b/tests/docker/dockerfiles/ubuntu2004.docker @@ -23,6 +23,7 @@ ENV PACKAGES flex bison \ libiscsi-dev \ libjemalloc-dev \ libjpeg-turbo8-dev \ + liblttng-ust-dev \ liblzo2-dev \ libncurses5-dev \ libncursesw5-dev \ -- cgit v1.1 From 1352d5688da004642d3e9e19697802989f2915d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Date: Tue, 17 Nov 2020 17:36:35 +0000 Subject: gitlab-ci: Move trace backend tests across to gitlab MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Similarly to commit 8cdb2cef3f1, move the trace backend tests to GitLab. Note the User-Space Tracer backend is still tested on Ubuntu by the s390x jobs on Travis-CI. Signed-off-by: Philippe Mathieu-Daudé Signed-off-by: Alex Bennée Acked-by: Thomas Huth Message-Id: <20201111121234.3246812-3-philmd@redhat.com> Message-Id: <20201117173635.29101-7-alex.bennee@linaro.org> --- .gitlab-ci.yml | 18 ++++++++++++++++++ .travis.yml | 19 ------------------- 2 files changed, 18 insertions(+), 19 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b406027..d0173e8 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -415,6 +415,24 @@ check-crypto-only-gnutls: IMAGE: centos7 MAKE_CHECK_ARGS: check +# We don't need to exercise every backend with every front-end +build-trace-multi-user: + <<: *native_build_job_definition + variables: + IMAGE: ubuntu2004 + CONFIGURE_ARGS: --enable-trace-backends=log,simple,syslog --disable-system + +build-trace-ftrace-system: + <<: *native_build_job_definition + variables: + IMAGE: ubuntu2004 + CONFIGURE_ARGS: --enable-trace-backends=ftrace --target-list=x86_64-softmmu + +build-trace-ust-system: + <<: *native_build_job_definition + variables: + IMAGE: ubuntu2004 + CONFIGURE_ARGS: --enable-trace-backends=ust --target-list=x86_64-softmmu check-patch: stage: build diff --git a/.travis.yml b/.travis.yml index bac085f8..1f80bdb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -232,25 +232,6 @@ jobs: - TEST_CMD="" - # We don't need to exercise every backend with every front-end - - name: "GCC trace log,simple,syslog (user)" - env: - - CONFIG="--enable-trace-backends=log,simple,syslog --disable-system" - - TEST_CMD="" - - - - name: "GCC trace ftrace (x86_64-softmmu)" - env: - - CONFIG="--enable-trace-backends=ftrace --target-list=x86_64-softmmu" - - TEST_CMD="" - - - - name: "GCC trace ust (x86_64-softmmu)" - env: - - CONFIG="--enable-trace-backends=ust --target-list=x86_64-softmmu" - - TEST_CMD="" - - # Using newer GCC with sanitizers - name: "GCC9 with sanitizers (softmmu)" dist: bionic -- cgit v1.1 From 534f80e1dffbf520bed9bf5fd5ae98de6662e126 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20Benn=C3=A9e?= Date: Wed, 18 Nov 2020 14:07:39 +0000 Subject: .cirrus.yml: bump timeout period for MacOS builds MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit These seem to trigger timeouts with some regularity. Signed-off-by: Alex Bennée Reviewed-by: Thomas Huth Message-Id: <20201118140739.18377-1-alex.bennee@linaro.org> Signed-off-by: Alex Bennée --- .cirrus.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.cirrus.yml b/.cirrus.yml index f0209b7..08db7c4 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -18,6 +18,7 @@ freebsd_12_task: - gmake -j$(sysctl -n hw.ncpu) check V=1 macos_task: + timeout_in: 90m osx_instance: image: catalina-base install_script: @@ -32,6 +33,7 @@ macos_task: - gmake check V=1 macos_xcode_task: + timeout_in: 90m osx_instance: # this is an alias for the latest Xcode image: catalina-xcode -- cgit v1.1