From nobody Thu Sep 19 16:01:05 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1725025467; cv=none; d=zohomail.com; s=zohoarc; b=hqAbd5D4gx0SrhUQ9LI+IbSTwzw+OIZd6xylWVTZOCqki2h4XOsGQDJ2YrYvlRujBANXV15z1AbzTP9P4SeL6MzP7d39RWPOwWzbAMlRGdfWjfvepmwQKalrk3L9mQFxFFut+yYS/eA4Z9RhM3V/7f1+xMln8inN5QOS7E9YVNs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1725025467; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=oyJ1Na6ZOFRqsA2Tx/ekQJYvHzOg6wjyd7n+vYrvIAA=; b=PU5AfvpTxC/kk9Idu0t7aqRexPCakyvmcS2He6rc6i5bnE3dsyjbokGSVsBd8ZNut8MCDFmvJfXJaJgOTLw+hguOJnE+JgODaE4yynN4Cybpb+PeZKk6NvjMG3/pCnjVxXjOHJvgaComE9+NAqyQ8w3iIUvnR+gIXtplHUcafrI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1725025467447236.44562120479907; Fri, 30 Aug 2024 06:44:27 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sk1qu-0007P2-G0; Fri, 30 Aug 2024 09:39:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sk1qs-0007Jv-Rw for qemu-devel@nongnu.org; Fri, 30 Aug 2024 09:39:47 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sk1qr-0005Fa-3G for qemu-devel@nongnu.org; Fri, 30 Aug 2024 09:39:46 -0400 Received: from mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-320-GoinHH0cMq-jL2ldMVUT2Q-1; Fri, 30 Aug 2024 09:39:41 -0400 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 69D091955D53; Fri, 30 Aug 2024 13:39:40 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.39.192.7]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id CE9CA300019C; Fri, 30 Aug 2024 13:39:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1725025184; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=oyJ1Na6ZOFRqsA2Tx/ekQJYvHzOg6wjyd7n+vYrvIAA=; b=a6P2pYbqgdcwOzSd8K4bWtraQOSOjE575QGyXiv+fdGGFWMbCWb1G1N9uWCBKVwSxvOrPw m9o8TInbRJSNlWXtGfyB4JHdpoQRY4RNBjL0sHm03YZSAuO/iMrW+Aro5Otsc7SostMLGA y6uODNAYItBVHNzuGqkvCr6n04kknVw= X-MC-Unique: GoinHH0cMq-jL2ldMVUT2Q-1 From: Thomas Huth To: qemu-devel@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , "Daniel P . Berrange" Cc: =?UTF-8?q?Alex=20Benn=C3=A9e?= , Ani Sinha , Richard Henderson , John Snow , Fabiano Rosas Subject: [PATCH v5 11/44] tests/functional: Prepare the meson build system for the functional tests Date: Fri, 30 Aug 2024 15:38:05 +0200 Message-ID: <20240830133841.142644-12-thuth@redhat.com> In-Reply-To: <20240830133841.142644-1-thuth@redhat.com> References: <20240830133841.142644-1-thuth@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1725025469705116600 Provide a meson.build file for the upcoming python-based functional tests, and add some wrapper glue targets to the tests/Makefile.include file. We are going to use two "speed" modes for the functional tests: The "quick" tests can be run at any time (i.e. also during "make check"), while the "thorough" tests should only be run when running a "make check-functional" test run (since these tests might download additional assets from the internet). The changes to the meson.build files are partly based on an earlier patch by Ani Sinha. Reviewed-by: Philippe Mathieu-Daud=C3=A9 Tested-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Thomas Huth --- tests/Makefile.include | 11 +++++ tests/functional/meson.build | 81 ++++++++++++++++++++++++++++++++++++ tests/meson.build | 1 + 3 files changed, 93 insertions(+) create mode 100644 tests/functional/meson.build diff --git a/tests/Makefile.include b/tests/Makefile.include index fbb1a4b211..66c8cc3123 100644 --- a/tests/Makefile.include +++ b/tests/Makefile.include @@ -9,6 +9,8 @@ check-help: @echo "Individual test suites:" @echo " $(MAKE) check-qtest-TARGET Run qtest tests for given target" @echo " $(MAKE) check-qtest Run qtest tests" + @echo " $(MAKE) check-functional Run python-based functional test= s" + @echo " $(MAKE) check-functional-TARGET Run functional tests for a given= target" @echo " $(MAKE) check-unit Run qobject tests" @echo " $(MAKE) check-qapi-schema Run QAPI schema tests" @echo " $(MAKE) check-block Run block tests" @@ -152,6 +154,15 @@ check-acceptance-deprecated-warning: =20 check-acceptance: check-acceptance-deprecated-warning | check-avocado =20 +FUNCTIONAL_TARGETS=3D$(patsubst %-softmmu,check-functional-%, $(filter %-s= oftmmu,$(TARGETS))) +.PHONY: $(FUNCTIONAL_TARGETS) +$(FUNCTIONAL_TARGETS): + @$(MAKE) SPEED=3Dthorough $(subst -functional,-func,$@) + +.PHONY: check-functional +check-functional: + @$(MAKE) SPEED=3Dthorough check-func check-func-quick + # Consolidated targets =20 .PHONY: check check-clean get-vm-images diff --git a/tests/functional/meson.build b/tests/functional/meson.build new file mode 100644 index 0000000000..052d2e8781 --- /dev/null +++ b/tests/functional/meson.build @@ -0,0 +1,81 @@ +# QEMU functional tests: +# Tests that are put in the 'quick' category are run by default during +# 'make check'. Everything that should not be run during 'make check' +# (e.g. tests that fetch assets from the internet) should be put into +# the 'thorough' category instead. + +# Most tests run too slow with TCI enabled, so skip the functional tests t= here +if get_option('tcg_interpreter') + subdir_done() +endif + +# Timeouts for individual tests that can be slow e.g. with debugging enabl= ed +test_timeouts =3D { +} + +tests_generic_system =3D [ +] + +tests_generic_linuxuser =3D [ +] + +tests_generic_bsduser =3D [ +] + +tests_x86_64_system_quick =3D [ +] + +tests_x86_64_system_thorough =3D [ +] + +foreach speed : ['quick', 'thorough'] + foreach dir : target_dirs + + target_base =3D dir.split('-')[0] + + if dir.endswith('-softmmu') + sysmode =3D 'system' + test_emulator =3D emulators['qemu-system-' + target_base] + elif dir.endswith('-linux-user') + sysmode =3D 'linuxuser' + test_emulator =3D emulators['qemu-' + target_base] + elif dir.endswith('-bsd-user') + sysmode =3D 'bsduser' + test_emulator =3D emulators['qemu-' + target_base] + else + continue + endif + + if speed =3D=3D 'quick' + suites =3D ['func-quick', 'func-' + target_base] + target_tests =3D get_variable('tests_' + target_base + '_' + sysmode= + '_quick', []) \ + + get_variable('tests_generic_' + sysmode) + else + suites =3D ['func-' + speed, 'func-' + target_base + '-' + speed, sp= eed] + target_tests =3D get_variable('tests_' + target_base + '_' + sysmode= + '_' + speed, []) + endif + + test_deps =3D roms + test_env =3D environment() + if have_tools + test_env.set('QEMU_TEST_QEMU_IMG', meson.global_build_root() / 'qemu= -img') + test_deps +=3D [qemu_img] + endif + test_env.set('QEMU_TEST_QEMU_BINARY', test_emulator.full_path()) + test_env.set('QEMU_BUILD_ROOT', meson.project_build_root()) + test_env.set('PYTHONPATH', meson.project_source_root() / 'python:' + + meson.current_source_dir()) + + foreach test : target_tests + test('func-@0@/@1@'.format(target_base, test), + python, + depends: [test_deps, test_emulator, emulator_modules], + env: test_env, + args: [meson.current_source_dir() / 'test_' + test + '.py'], + protocol: 'tap', + timeout: test_timeouts.get(test, 60), + priority: test_timeouts.get(test, 60), + suite: suites) + endforeach + endforeach +endforeach diff --git a/tests/meson.build b/tests/meson.build index 80dd3029cf..907a4c1c98 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -85,3 +85,4 @@ subdir('unit') subdir('qapi-schema') subdir('qtest') subdir('migration') +subdir('functional') --=20 2.46.0