From patchwork Tue Sep 10 12:37:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 826987 Delivered-To: patch@linaro.org Received: by 2002:adf:ab1c:0:b0:367:895a:4699 with SMTP id q28csp280611wrc; Tue, 10 Sep 2024 05:38:30 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCV6lY2ZZHR17m0r09EdhzP38goMYgQxC4NRm0IeJRqsC3NNJKwSjDwpS7dP8uUBIiZwVshiZg==@linaro.org X-Google-Smtp-Source: AGHT+IFAmdeW+S67sgVr5Mmw/T1m0p6YYd8ppPFiv4PBIYboq2cVQh/uunNouESkN4otz0ph80YX X-Received: by 2002:a05:6102:2ac2:b0:49b:e62d:b5d4 with SMTP id ada2fe7eead31-49bedcd18dbmr9596680137.21.1725971910262; Tue, 10 Sep 2024 05:38:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1725971910; cv=none; d=google.com; s=arc-20240605; b=OPEaYlNeFpL4k1AhXDZDX/D/L4nKeW+s8bXbziAZy/KPiKXF85NN+HkRB0YNOKvtt0 9ApJTiemt8/rHWXASTyHBpyBZ75/swItMEtFYLL9EKhLPnLMZmK0HpOtC/MfvZUkTPnd i6FtN2N7mfh60FDoZ7h6OZkyE3B+ydSVTYHNMnaS1EFvLdck+oMM+KeYOFxuhi468GL/ rrXtxiSrdi8OeYC4rTvflUpMLK2rjU6P0TPoLWRy0eLOEzDf/WUVJbbxmwh7LT3+nuL1 nodmTRLh8dqPbBRVVDLK39KEbhhOh+tb2yqK4UDj7fJQcwXVhXzsIjsRsL8xVg0IER0m 7Uzg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Rju49n8Z3Hj8Bn7+6iZDm9Iio+jiWTk7ezdxQvx0KGo=; fh=tOREyZHlK9Diwyw/7bj5IUyLT4I5EVkj5DE8XDtMiTs=; b=Dkmf6EC7hTwjF/g/7y1a2VVoUwJ9BhCSQolBLcDIo5Bd3BfCfOx1/oUugPimD+aXmA xxibVhGZ3CLKMKur6ZDwB4NkqXaA0SBt2tvNXQnSYE5Jl+R17ZIfBD1+fFPNVtBo0SrX srobuL7WtjSE8dagCIHQjhzH27QLrdnSS+YBKVgUjpMV+brmO1VlxmJ9js33NY5aLe9g 7XSRP3scXhujE7V8E5srJ1C9fs7QtV/M6EQI2L4/BC51wjb1F2MRLLdCHkfC/1ueh/Ky 5uTl9AjBEpBJy4/8EmYX9CX6EEIfVThmeRC97euNZlhhHX28TNg9B9nWU1UO1jU76bdZ P26Q==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=jIsArbsU; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id ada2fe7eead31-49c16cce0f0si267316137.225.2024.09.10.05.38.29 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 10 Sep 2024 05:38:30 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=jIsArbsU; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1so086-0001sk-R1; Tue, 10 Sep 2024 08:37:58 -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 1so07p-0008F7-Pr for qemu-devel@nongnu.org; Tue, 10 Sep 2024 08:37:43 -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 1so07n-00057q-4w for qemu-devel@nongnu.org; Tue, 10 Sep 2024 08:37:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1725971855; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Rju49n8Z3Hj8Bn7+6iZDm9Iio+jiWTk7ezdxQvx0KGo=; b=jIsArbsU61l1+BVJiMSgjr3TSRKWlREx88Fprk/NDm+A+hRQN+Sx0BjZYNAJ8Vf+iBFvL2 kzP3nCmi0RcgoJIq9jzHX0Vv0SGUkZPEb1x3/TvTofxpov89uRVA4HhlvlGFGtOmtvLqcA NoE9SypfQI3U4wuSBzebD0iuX2tntbk= Received: from mx-prod-mc-01.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-486-xcfK1AWbNBSnW5p-0Xnmzw-1; Tue, 10 Sep 2024 08:37:34 -0400 X-MC-Unique: xcfK1AWbNBSnW5p-0Xnmzw-1 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (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-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 64D5C193E8DE; Tue, 10 Sep 2024 12:37:32 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.39.193.120]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 3C1C519560AB; Tue, 10 Sep 2024 12:37:30 +0000 (UTC) From: Thomas Huth To: qemu-devel@nongnu.org Cc: Peter Maydell Subject: [PULL 01/22] meson: Split --enable-sanitizers to --enable-{asan, ubsan} Date: Tue, 10 Sep 2024 14:37:02 +0200 Message-ID: <20240910123726.182975-2-thuth@redhat.com> In-Reply-To: <20240910123726.182975-1-thuth@redhat.com> References: <20240910123726.182975-1-thuth@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 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: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.145, 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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Richard Henderson We do not always want both address and undefined behavior sanitizers running at the same time. For the gitlab custom-runners, drop to only --enable-ubsan. These jobs are not run by default, but as will be obvious in the next patch, we don't run ASan on x86 either, and it seems wrong to hold aarch64 and s390x to a different standard. Signed-off-by: Richard Henderson Reviewed-by: Thomas Huth Message-ID: <20240813095216.306555-2-richard.henderson@linaro.org> Signed-off-by: Thomas Huth --- docs/devel/testing/fuzzing.rst | 4 ++-- meson.build | 15 +++++++++++---- tests/qtest/fdc-test.c | 2 +- .../custom-runners/ubuntu-22.04-aarch64.yml | 2 +- .../custom-runners/ubuntu-22.04-s390x.yml | 2 +- meson_options.txt | 6 ++++-- scripts/meson-buildoptions.sh | 9 ++++++--- tests/docker/test-debug | 4 ++-- 8 files changed, 28 insertions(+), 16 deletions(-) diff --git a/docs/devel/testing/fuzzing.rst b/docs/devel/testing/fuzzing.rst index 3bfcb33fc4..dfe1973cf8 100644 --- a/docs/devel/testing/fuzzing.rst +++ b/docs/devel/testing/fuzzing.rst @@ -24,8 +24,8 @@ Configure with (substitute the clang binaries with the version you installed). Here, enable-sanitizers, is optional but it allows us to reliably detect bugs such as out-of-bounds accesses, use-after-frees, double-frees etc.:: - CC=clang-8 CXX=clang++-8 /path/to/configure --enable-fuzzing \ - --enable-sanitizers + CC=clang-8 CXX=clang++-8 /path/to/configure \ + --enable-fuzzing --enable-asan --enable-ubsan Fuzz targets are built similarly to system targets:: diff --git a/meson.build b/meson.build index fbda17c987..f6b8060b72 100644 --- a/meson.build +++ b/meson.build @@ -479,24 +479,31 @@ if get_option('safe_stack') and coroutine_backend != 'ucontext' error('SafeStack is only supported with the ucontext coroutine backend') endif -if get_option('sanitizers') +if get_option('asan') if cc.has_argument('-fsanitize=address') qemu_cflags = ['-fsanitize=address'] + qemu_cflags qemu_ldflags = ['-fsanitize=address'] + qemu_ldflags + else + error('Your compiler does not support -fsanitize=address') endif +endif - # Detect static linking issue with ubsan - https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84285 +if get_option('ubsan') + # Detect static linking issue with ubsan: + # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84285 if cc.links('int main(int argc, char **argv) { return argc + 1; }', args: [qemu_ldflags, '-fsanitize=undefined']) qemu_cflags = ['-fsanitize=undefined'] + qemu_cflags qemu_ldflags = ['-fsanitize=undefined'] + qemu_ldflags + else + error('Your compiler does not support -fsanitize=undefined') endif endif # Thread sanitizer is, for now, much noisier than the other sanitizers; # keep it separate until that is not the case. if get_option('tsan') - if get_option('sanitizers') + if get_option('asan') or get_option('ubsan') error('TSAN is not supported with other sanitizers') endif if not cc.has_function('__tsan_create_fiber', @@ -2516,7 +2523,7 @@ if rdma.found() endif have_asan_fiber = false -if get_option('sanitizers') and \ +if get_option('asan') and \ not cc.has_function('__sanitizer_start_switch_fiber', args: '-fsanitize=address', prefix: '#include ') diff --git a/tests/qtest/fdc-test.c b/tests/qtest/fdc-test.c index 5e8fbda9df..8645b080f7 100644 --- a/tests/qtest/fdc-test.c +++ b/tests/qtest/fdc-test.c @@ -552,7 +552,7 @@ static bool qtest_check_clang_sanitizer(void) #ifdef QEMU_SANITIZE_ADDRESS return true; #else - g_test_skip("QEMU not configured using --enable-sanitizers"); + g_test_skip("QEMU not configured using --enable-asan"); return false; #endif } diff --git a/.gitlab-ci.d/custom-runners/ubuntu-22.04-aarch64.yml b/.gitlab-ci.d/custom-runners/ubuntu-22.04-aarch64.yml index 263a3c2140..ca2f140471 100644 --- a/.gitlab-ci.d/custom-runners/ubuntu-22.04-aarch64.yml +++ b/.gitlab-ci.d/custom-runners/ubuntu-22.04-aarch64.yml @@ -103,7 +103,7 @@ ubuntu-22.04-aarch64-clang: script: - mkdir build - cd build - - ../configure --disable-libssh --cc=clang --cxx=clang++ --enable-sanitizers + - ../configure --disable-libssh --cc=clang --cxx=clang++ --enable-ubsan || { cat config.log meson-logs/meson-log.txt; exit 1; } - make --output-sync -j`nproc --ignore=40` - make --output-sync -j`nproc --ignore=40` check diff --git a/.gitlab-ci.d/custom-runners/ubuntu-22.04-s390x.yml b/.gitlab-ci.d/custom-runners/ubuntu-22.04-s390x.yml index 69ddd3e7d5..ca374acb8c 100644 --- a/.gitlab-ci.d/custom-runners/ubuntu-22.04-s390x.yml +++ b/.gitlab-ci.d/custom-runners/ubuntu-22.04-s390x.yml @@ -80,7 +80,7 @@ ubuntu-22.04-s390x-clang: script: - mkdir build - cd build - - ../configure --cc=clang --cxx=clang++ --enable-sanitizers + - ../configure --cc=clang --cxx=clang++ --enable-ubsan || { cat config.log meson-logs/meson-log.txt; exit 1; } - make --output-sync -j`nproc` - make --output-sync -j`nproc` check diff --git a/meson_options.txt b/meson_options.txt index 0269fa0f16..98615c3c4e 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -91,8 +91,10 @@ option('tcg_interpreter', type: 'boolean', value: false, description: 'TCG with bytecode interpreter (slow)') option('safe_stack', type: 'boolean', value: false, description: 'SafeStack Stack Smash Protection (requires clang/llvm and coroutine backend ucontext)') -option('sanitizers', type: 'boolean', value: false, - description: 'enable default sanitizers') +option('asan', type: 'boolean', value: false, + description: 'enable address sanitizer') +option('ubsan', type: 'boolean', value: false, + description: 'enable undefined behaviour sanitizer') option('tsan', type: 'boolean', value: false, description: 'enable thread sanitizer') option('stack_protector', type: 'feature', value: 'auto', diff --git a/scripts/meson-buildoptions.sh b/scripts/meson-buildoptions.sh index c97079a38c..a6ee2d9c01 100644 --- a/scripts/meson-buildoptions.sh +++ b/scripts/meson-buildoptions.sh @@ -21,6 +21,7 @@ meson_options_help() { printf "%s\n" ' --disable-relocatable toggle relocatable install' printf "%s\n" ' --docdir=VALUE Base directory for documentation installation' printf "%s\n" ' (can be empty) [share/doc]' + printf "%s\n" ' --enable-asan enable address sanitizer' printf "%s\n" ' --enable-block-drv-whitelist-in-tools' printf "%s\n" ' use block whitelist also in tools instead of only' printf "%s\n" ' QEMU' @@ -46,13 +47,13 @@ meson_options_help() { printf "%s\n" ' getrandom()' printf "%s\n" ' --enable-safe-stack SafeStack Stack Smash Protection (requires' printf "%s\n" ' clang/llvm and coroutine backend ucontext)' - printf "%s\n" ' --enable-sanitizers enable default sanitizers' printf "%s\n" ' --enable-strip Strip targets on install' printf "%s\n" ' --enable-tcg-interpreter TCG with bytecode interpreter (slow)' printf "%s\n" ' --enable-trace-backends=CHOICES' printf "%s\n" ' Set available tracing backends [log] (choices:' printf "%s\n" ' dtrace/ftrace/log/nop/simple/syslog/ust)' printf "%s\n" ' --enable-tsan enable thread sanitizer' + printf "%s\n" ' --enable-ubsan enable undefined behaviour sanitizer' printf "%s\n" ' --firmwarepath=VALUES search PATH for firmware files [share/qemu-' printf "%s\n" ' firmware]' printf "%s\n" ' --iasl=VALUE Path to ACPI disassembler' @@ -230,6 +231,8 @@ _meson_option_parse() { --disable-af-xdp) printf "%s" -Daf_xdp=disabled ;; --enable-alsa) printf "%s" -Dalsa=enabled ;; --disable-alsa) printf "%s" -Dalsa=disabled ;; + --enable-asan) printf "%s" -Dasan=true ;; + --disable-asan) printf "%s" -Dasan=false ;; --enable-attr) printf "%s" -Dattr=enabled ;; --disable-attr) printf "%s" -Dattr=disabled ;; --audio-drv-list=*) quote_sh "-Daudio_drv_list=$2" ;; @@ -456,8 +459,6 @@ _meson_option_parse() { --disable-rutabaga-gfx) printf "%s" -Drutabaga_gfx=disabled ;; --enable-safe-stack) printf "%s" -Dsafe_stack=true ;; --disable-safe-stack) printf "%s" -Dsafe_stack=false ;; - --enable-sanitizers) printf "%s" -Dsanitizers=true ;; - --disable-sanitizers) printf "%s" -Dsanitizers=false ;; --enable-sdl) printf "%s" -Dsdl=enabled ;; --disable-sdl) printf "%s" -Dsdl=disabled ;; --enable-sdl-image) printf "%s" -Dsdl_image=enabled ;; @@ -505,6 +506,8 @@ _meson_option_parse() { --disable-u2f) printf "%s" -Du2f=disabled ;; --enable-uadk) printf "%s" -Duadk=enabled ;; --disable-uadk) printf "%s" -Duadk=disabled ;; + --enable-ubsan) printf "%s" -Dubsan=true ;; + --disable-ubsan) printf "%s" -Dubsan=false ;; --enable-usb-redir) printf "%s" -Dusb_redir=enabled ;; --disable-usb-redir) printf "%s" -Dusb_redir=disabled ;; --enable-vde) printf "%s" -Dvde=enabled ;; diff --git a/tests/docker/test-debug b/tests/docker/test-debug index f52f16328c..678ceccc27 100755 --- a/tests/docker/test-debug +++ b/tests/docker/test-debug @@ -1,6 +1,6 @@ #!/bin/bash -e # -# Compile and check with clang & --enable-debug --enable-sanitizers. +# Compile and check with clang & debug & sanitizers # # Copyright (c) 2016-2018 Red Hat Inc. # @@ -19,7 +19,7 @@ requires_binary clang cd "$BUILD_DIR" OPTS="--cxx=clang++ --cc=clang --host-cc=clang" -OPTS="--enable-debug --enable-sanitizers $OPTS" +OPTS="--enable-debug --enable-asan --enable-ubsan $OPTS" export ASAN_OPTIONS=detect_leaks=0 build_qemu $OPTS From patchwork Tue Sep 10 12:37:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 826998 Delivered-To: patch@linaro.org Received: by 2002:adf:ab1c:0:b0:367:895a:4699 with SMTP id q28csp281920wrc; Tue, 10 Sep 2024 05:41:57 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVR0VgU3TBbCl05NmUsTUTSISIfNqaE2IT5p+lTEJrn5p+1BmY62VIQu5XIRGZWaGD6DlddBQ==@linaro.org X-Google-Smtp-Source: AGHT+IF0Ti+IheSiHm3O9O+hnCMZhzEmj1udvHLGmb/ro6bEowU9L+ldmNUaRZai8CQzfZDl6/qo X-Received: by 2002:a05:620a:4556:b0:7a1:e4e4:3a9e with SMTP id af79cd13be357-7a9a38846c6mr1897647685a.21.1725972116866; Tue, 10 Sep 2024 05:41:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1725972116; cv=none; d=google.com; s=arc-20240605; b=eQ4iauBmils/xqHdaVnlzWous1QNshDckKY2ke6lTVCt2zb1lx9wFdgM6deWH071w1 33mo6rrvr6wDR6EBLJPXfnGoheC21UXV9X3tSlt2t2KEPVBwQnr/SLmxplj41GaDyAFz wUC5b6PDNCxmBNC4m7FRJn65HenTgCDGZR7787rFVW/mHR/mFzDxgR2u/C2By4juv3QR nb0wfgthNG8K2d+aqXfsgv+Bhhh/i3Q0cG8zdAGimvxpr+lyfY1hVJ4XR/kvWA9K/uKe 2aRaeVjY3dNvoKbYKqm2yPrFFGaVacYEWJU+u1lnekk5JtmyzmgKlcjHXECjkneDDGyA x46g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=eZJnuK2h81KcY66kd08hYy3F+YH70C9Bsh4bBdmoAuQ=; fh=tOREyZHlK9Diwyw/7bj5IUyLT4I5EVkj5DE8XDtMiTs=; b=gK/FwXvxtinzldDws0SsjKHVkkGfZXAppPq0xx/JjEo6KIItaulLcYsI1Re4O4hi4w Blc7KBrVWLgq6NXcp8LLeodo/q81aF6v60igYjrDhqfjRkZ9q91dm3SOfZ6nPaf4yOGn ptBdk8XIiMRJI/67FJAT3C9x0ASEjrGyFdb+Pwtp/0qNYDbcAl7rIPHMPpc8ucSQCbSK AxjcS6xRgTzBwQ0ZyhyYXbSZ8Ivrdu0SMS9Cj7i5v3TZPaf41beg3ElWgkYFhpckVSTr 393ATcBVLPx4lJViI5+iTqcwsONufRVuumBLmy4oy6UVBx2s+1QjeWSXoXfhVphAsmZf UKWA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=dUbgZm3h; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7a9a7a46dcdsi792765885a.413.2024.09.10.05.41.56 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 10 Sep 2024 05:41:56 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=dUbgZm3h; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1so084-0001RU-FQ; Tue, 10 Sep 2024 08:37:56 -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 1so07r-0008K0-0r for qemu-devel@nongnu.org; Tue, 10 Sep 2024 08:37:43 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1so07n-000581-PD for qemu-devel@nongnu.org; Tue, 10 Sep 2024 08:37:42 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1725971857; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=eZJnuK2h81KcY66kd08hYy3F+YH70C9Bsh4bBdmoAuQ=; b=dUbgZm3hfijWgJHEyI9dvMHyr/6uYcpPVoFV6E4x2Ym1VBnlvZBAr+wND/ToN41s7J8y1H b/cxW0CS6s5hqQlzbwKAj79B8T4mR4GsztPluF1sR/nDVfm4V/vvftkrN5sCw54Wm0UVML gSQ9Pyky5gNJHmfjuagrHGMLw133M5w= Received: from mx-prod-mc-01.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-275-t_yedJesOGejhof5mDoQLg-1; Tue, 10 Sep 2024 08:37:35 -0400 X-MC-Unique: t_yedJesOGejhof5mDoQLg-1 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (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-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 3B9F6193E8CE; Tue, 10 Sep 2024 12:37:34 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.39.193.120]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id D640119560B0; Tue, 10 Sep 2024 12:37:32 +0000 (UTC) From: Thomas Huth To: qemu-devel@nongnu.org Cc: Peter Maydell Subject: [PULL 02/22] meson: Move -fsanitize=undefined into normal configuraton Date: Tue, 10 Sep 2024 14:37:03 +0200 Message-ID: <20240910123726.182975-3-thuth@redhat.com> In-Reply-To: <20240910123726.182975-1-thuth@redhat.com> References: <20240910123726.182975-1-thuth@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 Received-SPF: pass client-ip=170.10.129.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.145, 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_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Richard Henderson With 8e466dd09246 and 23ef50ae2d0c, we disable function pointer sanitization in CI because the qemu code base does not support it. We must disable this for normal usage of --enable-ubsan as well, so move it there. Append options rather than prepend, since all of this requires proper ordering of options. Signed-off-by: Richard Henderson Reviewed-by: Thomas Huth Message-ID: <20240813095216.306555-3-richard.henderson@linaro.org> Signed-off-by: Thomas Huth --- meson.build | 11 +++++++++-- .gitlab-ci.d/buildtest.yml | 10 ++++------ 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/meson.build b/meson.build index f6b8060b72..4701ee3aab 100644 --- a/meson.build +++ b/meson.build @@ -493,8 +493,15 @@ if get_option('ubsan') # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84285 if cc.links('int main(int argc, char **argv) { return argc + 1; }', args: [qemu_ldflags, '-fsanitize=undefined']) - qemu_cflags = ['-fsanitize=undefined'] + qemu_cflags - qemu_ldflags = ['-fsanitize=undefined'] + qemu_ldflags + qemu_cflags += ['-fsanitize=undefined'] + qemu_ldflags += ['-fsanitize=undefined'] + + # Suppress undefined behaviour from function call to mismatched type. + # In addition, tcg prologue does not emit function type prefix + # required by function call sanitizer. + if cc.has_argument('-fno-sanitize=function') + qemu_cflags += ['-fno-sanitize=function'] + endif else error('Your compiler does not support -fsanitize=undefined') endif diff --git a/.gitlab-ci.d/buildtest.yml b/.gitlab-ci.d/buildtest.yml index 1d2afae996..9ac0776b94 100644 --- a/.gitlab-ci.d/buildtest.yml +++ b/.gitlab-ci.d/buildtest.yml @@ -428,9 +428,8 @@ clang-system: job: amd64-fedora-container variables: IMAGE: fedora - CONFIGURE_ARGS: --cc=clang --cxx=clang++ - --extra-cflags=-fsanitize=undefined --extra-cflags=-fno-sanitize-recover=undefined - --extra-cflags=-fno-sanitize=function + CONFIGURE_ARGS: --cc=clang --cxx=clang++ --enable-ubsan + --extra-cflags=-fno-sanitize-recover=undefined TARGETS: alpha-softmmu arm-softmmu m68k-softmmu mips64-softmmu s390x-softmmu MAKE_CHECK_ARGS: check-qtest check-tcg @@ -441,10 +440,9 @@ clang-user: timeout: 70m variables: IMAGE: debian-all-test-cross - CONFIGURE_ARGS: --cc=clang --cxx=clang++ --disable-system + CONFIGURE_ARGS: --cc=clang --cxx=clang++ --disable-system --enable-ubsan --target-list-exclude=alpha-linux-user,microblazeel-linux-user,aarch64_be-linux-user,i386-linux-user,m68k-linux-user,mipsn32el-linux-user,xtensaeb-linux-user - --extra-cflags=-fsanitize=undefined --extra-cflags=-fno-sanitize-recover=undefined - --extra-cflags=-fno-sanitize=function + --extra-cflags=-fno-sanitize-recover=undefined MAKE_CHECK_ARGS: check-unit check-tcg # Set LD_JOBS=1 because this requires LTO and ld consumes a large amount of memory. From patchwork Tue Sep 10 12:37:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 826992 Delivered-To: patch@linaro.org Received: by 2002:adf:ab1c:0:b0:367:895a:4699 with SMTP id q28csp281096wrc; Tue, 10 Sep 2024 05:39:45 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUnQ4L3si8ImanF8GTwroxRAVOej5UL0NcQTWC3aQYRlGhdfuWvpm6ssKRjxBPS1uIipPzaLQ==@linaro.org X-Google-Smtp-Source: AGHT+IHapOHucvrxBBoOKPvloqSmIy1Q9jD082IyAi6X+LenHScfgQ2zhoG6Ft5PYjwmhMOKuAyv X-Received: by 2002:a05:620a:1a20:b0:7a9:bc34:aa00 with SMTP id af79cd13be357-7a9bc34c319mr900148685a.7.1725971985303; Tue, 10 Sep 2024 05:39:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1725971985; cv=none; d=google.com; s=arc-20240605; b=k2CnqAPCXZNXCZzDK+n5i9gonAjgK1FH/mlT+cvvok29IrdPzul7YXJKGf5AD0BfAX LDjju5usBOJ2U10bQzcq6v06LkNyU1XNU1b5+hzeGYTZue/1MQdkldiqTwO7rzz+NdS9 OINiC44aHEjlbY0TRAbvfd1bsilq4E0v2Mlyaoyo6l4jstQTiPDfFYyD1TugINqNqIII cfjEue9PUMDwM3//14rW3IYcmNmCRWsg/6+h9C2U8fsHyeOFDcmFBvAfEh9CEx1sTVQa R0Xk5jihXW+9ftnsmPyDu/6udC2oGTQrI3pEPRVl7PwLa2OVxHksz0IDm1Gh3Htls93w q7eg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=8Brn6cLGnhTP1KmrwwsRzuR+4YftSsDFHM3QZUWTvPE=; fh=tOREyZHlK9Diwyw/7bj5IUyLT4I5EVkj5DE8XDtMiTs=; b=Lk4Wi6Wa6vG/KeWf5pLyhThboewPug7Yi2oBqqs9lHpTssrdgZADVnTVsdWuPVDEWD m7QmzvmZldGto+1SyabestuT4zm70yNfnFESFjzvWqoRaD3Yz4xuorEohJAul+O2NkCB 61gqZoxxYdL7zSEdsBjrN1VoC+zIBPrCEwDZpD5Gh7ZOGptQFZs/hiYRkZ4m4HGE9dBu FJTRxUIXoKHUhBKzpC+Ku93XxXPWwLCrA6mU6jDnBLvOr1gmxivYLZfftGa/80ZXviYR e+1J/vkcV9BN+hp9cDlq9/ZhHcd0OJ5y0dwg1EXB/VkejOd3xCKg4nkQDBqOJtO4DdQI tbeg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=gO1sVM87; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7a9a7a7b2ebsi787954885a.698.2024.09.10.05.39.45 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 10 Sep 2024 05:39:45 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=gO1sVM87; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1so081-000182-Ae; Tue, 10 Sep 2024 08:37:53 -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 1so07r-0008L6-AA for qemu-devel@nongnu.org; Tue, 10 Sep 2024 08:37:43 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1so07p-00058F-Ng for qemu-devel@nongnu.org; Tue, 10 Sep 2024 08:37:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1725971861; 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=8Brn6cLGnhTP1KmrwwsRzuR+4YftSsDFHM3QZUWTvPE=; b=gO1sVM87XWXgGimkUNmelEKcOLGxNv72pT6mEifU/0CC266pAuL2c5n4qQL5iJ9w9WXguj S0GTvUiTOtDmFb2FOoFmo5AXVVn5iHklmnMXjc0B3A0Q4FKiiyxpEGieP9fgdRy+tIYo9+ Efw4VSVI1KEQYpHYt7GKQsGprTThC40= Received: from mx-prod-mc-05.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-427-wG5j9D-ZMniL_lZeiOz8VQ-1; Tue, 10 Sep 2024 08:37:37 -0400 X-MC-Unique: wG5j9D-ZMniL_lZeiOz8VQ-1 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (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-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 7ED4A1954B35; Tue, 10 Sep 2024 12:37:36 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.39.193.120]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id E9D0919560AB; Tue, 10 Sep 2024 12:37:34 +0000 (UTC) From: Thomas Huth To: qemu-devel@nongnu.org Cc: Peter Maydell Subject: [PULL 03/22] gitlab-ci: Build MSYS2 job using multiple CPUs Date: Tue, 10 Sep 2024 14:37:04 +0200 Message-ID: <20240910123726.182975-4-thuth@redhat.com> In-Reply-To: <20240910123726.182975-1-thuth@redhat.com> References: <20240910123726.182975-1-thuth@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 Received-SPF: pass client-ip=170.10.129.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.145, 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_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Philippe Mathieu-Daudé Signed-off-by: Philippe Mathieu-Daudé Message-ID: <20240819112141.13786-1-philmd@linaro.org> Signed-off-by: Thomas Huth --- .gitlab-ci.d/windows.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.d/windows.yml b/.gitlab-ci.d/windows.yml index 759e9a76b5..45ed0c96fe 100644 --- a/.gitlab-ci.d/windows.yml +++ b/.gitlab-ci.d/windows.yml @@ -88,6 +88,7 @@ msys2-64bit: mingw-w64-x86_64-python mingw-w64-x86_64-zstd" - Write-Output "Running build at $(Get-Date -Format u)" + - $env:JOBS = $(.\msys64\usr\bin\bash -lc nproc) - $env:CHERE_INVOKING = 'yes' # Preserve the current working directory - $env:MSYS = 'winsymlinks:native' # Enable native Windows symlink - $env:CCACHE_BASEDIR = "$env:CI_PROJECT_DIR" @@ -99,7 +100,7 @@ msys2-64bit: - cd build - ..\msys64\usr\bin\bash -lc "ccache --zero-stats" - ..\msys64\usr\bin\bash -lc "../configure $CONFIGURE_ARGS" - - ..\msys64\usr\bin\bash -lc "make" + - ..\msys64\usr\bin\bash -lc "make -j$env:JOBS" - ..\msys64\usr\bin\bash -lc "make check MTESTARGS='$TEST_ARGS' || { cat meson-logs/testlog.txt; exit 1; } ;" - ..\msys64\usr\bin\bash -lc "ccache --show-stats" - Write-Output "Finished build at $(Get-Date -Format u)" From patchwork Tue Sep 10 12:37:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 826988 Delivered-To: patch@linaro.org Received: by 2002:adf:ab1c:0:b0:367:895a:4699 with SMTP id q28csp280791wrc; Tue, 10 Sep 2024 05:39:00 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWUPRGes5ErYMYFq1jyezo4rHJypOmks25NrS0lobU3mxleYWh5Rs4ZGM5nemWD3vun91L92w==@linaro.org X-Google-Smtp-Source: AGHT+IGftGRBOOpB7ZVkiHtm1HlEWec39F/AqWZ0fAFlKbgjdFt1uzeR01OuNw9kDNGXuS26eTIa X-Received: by 2002:a05:6102:26d4:b0:493:e582:70ce with SMTP id ada2fe7eead31-49beccf9791mr8181687137.10.1725971940193; Tue, 10 Sep 2024 05:39:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1725971940; cv=none; d=google.com; s=arc-20240605; b=YlWWtxOh2If5UOtp2s78xtU6OXwTQ8FFTApR4Gc/YYEli3MODzn5/DCf/v/NknVVQW WR08lAfEXPcocHEGeAKV+jisWQ521w6mtbblsNLNgCC0BvYCKrW3s2rN2R79JqUeQey4 53nOIeZePU4ktBIVSfe3FPmhkHsEty2YrrikC149Gs78VO1WIiI/qdrQiwUQo0FBgo93 9cc5gjHSjAzrNQK/HCr2g23bEBCOUt8BIXUIsMfHPEsEQgvPSEfORU7yvdLO569eZ/nk bMIQ7CvaNnXUerRgaARfaox1ebbxfw52/M+pJyDfrAdZBg/GgGgYLCLrI/ISjL2DZa2e 0KhQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=DseQ+PNtGUI5GM+MFiMyUvwByq4R1FQSDsAnXzpfdD0=; fh=tOREyZHlK9Diwyw/7bj5IUyLT4I5EVkj5DE8XDtMiTs=; b=LpoA+vD1iZr73yfCiDjvDpltum/6WUyROeWJyw0GhGxsDok7gSX0WDqg5D1Nf3grpy SVWniiW4KKBaa4vpTngS296QH5L6/pQ0+JnHXsj1ha2Jndak5HaD3RyyWH8meoWTBcNa 1G2gWhiVAodUAaiKspjtw7uaDohuDsrEkmyxNVxuWhyxCBlBGwLO+hMbJNDJNExWg9Gv MniR1J2fav8fQSxi4F5OkkW1MCHalBk1G2PkUwp1AnJGn3dy68M0yKsZaDPVPoVrrtsQ 4Xtna5sNK5n4VqkSNRc24EHHdRJvY2/w94zf/DGfv6m6YIg+6LQMAc5BHVmu16s0rpD3 kXUQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ieFltaHe; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id ada2fe7eead31-49c16dd0e57si250994137.409.2024.09.10.05.39.00 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 10 Sep 2024 05:39:00 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ieFltaHe; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1so086-0001rX-Kt; Tue, 10 Sep 2024 08:37:59 -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 1so083-0001Wq-Os for qemu-devel@nongnu.org; Tue, 10 Sep 2024 08:37:55 -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 1so080-00059X-4N for qemu-devel@nongnu.org; Tue, 10 Sep 2024 08:37:55 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1725971869; 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=DseQ+PNtGUI5GM+MFiMyUvwByq4R1FQSDsAnXzpfdD0=; b=ieFltaHeEohe9ur7o7SFsM0G4oJum+XuSkSTEj8URhinsPxwUXqaVSIogkXzfdI1pPa4jp DzTE1SZvEu5xNlo0f0k9oVuvityWMHGQ6MLFS67EuPC8pAC/VN9gjRNzkwOQtyvh0o0VGL Gn8YmkZgtPg9EDfAHP1O0PMO70Vejxo= 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-148-D7MuhjtfNTehQPQ4N1Q0Iw-1; Tue, 10 Sep 2024 08:37:48 -0400 X-MC-Unique: D7MuhjtfNTehQPQ4N1Q0Iw-1 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (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 B7BFE1935876; Tue, 10 Sep 2024 12:37:47 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.39.193.120]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 8BE2219560B1; Tue, 10 Sep 2024 12:37:46 +0000 (UTC) From: Thomas Huth To: qemu-devel@nongnu.org Cc: Peter Maydell Subject: [PULL 09/22] tests/functional: Convert mips64el Fuloong2e avocado test (2/2) Date: Tue, 10 Sep 2024 14:37:10 +0200 Message-ID: <20240910123726.182975-10-thuth@redhat.com> In-Reply-To: <20240910123726.182975-1-thuth@redhat.com> References: <20240910123726.182975-1-thuth@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 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: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.145, 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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Philippe Mathieu-Daudé Straight forward conversion. Update the SHA1 hashes to SHA256 hashes since SHA1 should not be used anymore nowadays. Signed-off-by: Philippe Mathieu-Daudé Message-ID: <20240827094905.80648-3-philmd@linaro.org> [thuth: Use LinuxKernelTest class for this test] Message-ID: <20240906180549.792832-4-thuth@redhat.com> Signed-off-by: Thomas Huth --- tests/avocado/boot_linux_console.py | 21 ----------------- tests/functional/test_mips64el_fuloong2e.py | 25 ++++++++++++++++++--- 2 files changed, 22 insertions(+), 24 deletions(-) diff --git a/tests/avocado/boot_linux_console.py b/tests/avocado/boot_linux_console.py index 396836bf64..e1e20c36f7 100644 --- a/tests/avocado/boot_linux_console.py +++ b/tests/avocado/boot_linux_console.py @@ -170,27 +170,6 @@ def test_mips64el_malta(self): console_pattern = 'Kernel command line: %s' % kernel_command_line self.wait_for_console_pattern(console_pattern) - def test_mips64el_fuloong2e(self): - """ - :avocado: tags=arch:mips64el - :avocado: tags=machine:fuloong2e - :avocado: tags=endian:little - """ - deb_url = ('http://archive.debian.org/debian/pool/main/l/linux/' - 'linux-image-3.16.0-6-loongson-2e_3.16.56-1+deb8u1_mipsel.deb') - deb_hash = 'd04d446045deecf7b755ef576551de0c4184dd44' - deb_path = self.fetch_asset(deb_url, asset_hash=deb_hash) - kernel_path = self.extract_from_deb(deb_path, - '/boot/vmlinux-3.16.0-6-loongson-2e') - - self.vm.set_console() - kernel_command_line = self.KERNEL_COMMON_COMMAND_LINE + 'console=ttyS0' - self.vm.add_args('-kernel', kernel_path, - '-append', kernel_command_line) - self.vm.launch() - console_pattern = 'Kernel command line: %s' % kernel_command_line - self.wait_for_console_pattern(console_pattern) - def test_mips_malta_cpio(self): """ :avocado: tags=arch:mips diff --git a/tests/functional/test_mips64el_fuloong2e.py b/tests/functional/test_mips64el_fuloong2e.py index 7688a32713..a32d5f9d08 100755 --- a/tests/functional/test_mips64el_fuloong2e.py +++ b/tests/functional/test_mips64el_fuloong2e.py @@ -12,14 +12,33 @@ import os import subprocess -from qemu_test import QemuSystemTest +from qemu_test import LinuxKernelTest, Asset from qemu_test import wait_for_console_pattern from unittest import skipUnless -class MipsFuloong2e(QemuSystemTest): +class MipsFuloong2e(LinuxKernelTest): timeout = 60 + ASSET_KERNEL = Asset( + ('http://archive.debian.org/debian/pool/main/l/linux/' + 'linux-image-3.16.0-6-loongson-2e_3.16.56-1+deb8u1_mipsel.deb'), + '2a70f15b397f4ced632b0c15cb22660394190644146d804d60a4796eefbe1f50') + + def test_linux_kernel_3_16(self): + deb_path = self.ASSET_KERNEL.fetch() + kernel_path = self.extract_from_deb(deb_path, + '/boot/vmlinux-3.16.0-6-loongson-2e') + + self.set_machine('fuloong2e') + self.vm.set_console() + kernel_command_line = self.KERNEL_COMMON_COMMAND_LINE + 'console=ttyS0' + self.vm.add_args('-kernel', kernel_path, + '-append', kernel_command_line) + self.vm.launch() + console_pattern = 'Kernel command line: %s' % kernel_command_line + self.wait_for_console_pattern(console_pattern) + @skipUnless(os.getenv('QEMU_TEST_ALLOW_UNTRUSTED_CODE'), 'untrusted code') @skipUnless(os.getenv('RESCUE_YL_PATH'), 'RESCUE_YL_PATH not available') def test_linux_kernel_2_6_27_isa_serial(self): @@ -42,4 +61,4 @@ def test_linux_kernel_2_6_27_isa_serial(self): if __name__ == '__main__': - QemuSystemTest.main() + LinuxKernelTest.main() From patchwork Tue Sep 10 12:37:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 826989 Delivered-To: patch@linaro.org Received: by 2002:adf:ab1c:0:b0:367:895a:4699 with SMTP id q28csp280846wrc; Tue, 10 Sep 2024 05:39:07 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVS+W6leNrVwmkzElDlS7Akgr22aY+RovuceqIY7AuWbRzUe46ovu1Hi2Fyb296qpoc6EMMjA==@linaro.org X-Google-Smtp-Source: AGHT+IHm7OzWEyYNE2d5NTQ6AcsUE7f7Wwu496m027SBIXLA/glXEL0zYEk+CgsJlcx6V5idmpA+ X-Received: by 2002:ac8:5843:0:b0:458:4b8b:1517 with SMTP id d75a77b69052e-4584b8b21a0mr9051451cf.18.1725971947539; Tue, 10 Sep 2024 05:39:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1725971947; cv=none; d=google.com; s=arc-20240605; b=ezmlvuqZ0K9RxpSRmLIVAot2U6jwWsm/QkaCO7Y6cf9OQR0UaDBCkbt3Sp8f0OroNY rGB/sFZQ/61bc/CsMINpa+dpUTJJV8Q1GMPJkuTLgfw3yv/f5XnqMF1Ke8CMltZZAakC /KLer2X2QwZWpZQLTSTZg04J9H+tLtVKtMsp/LkdSPznpjK4hHgqND7FSUwLg73v4Fw/ os5DuXUpHJUbQ9TRntM+w1vts1egDo9GXt5gQafw9qzcuvJMOxTyODf+4W9VWKygD24a QFuax2KVQfxQQkhSe3GjU2H4PzNHJZyQgra4pKjNAUK9s6OfrjSB4IHqagiSGR/5kH11 so6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=W6QHQJ48zpU4qGd3mkKxNWD3H8DD0ZEDdWZ1xYCdr60=; fh=tOREyZHlK9Diwyw/7bj5IUyLT4I5EVkj5DE8XDtMiTs=; b=OhoQSBkf05mRWa88OmlQqnli07wCN6oqdG/0u+d7GQTkBzGxVFRrvFUv1bZmVXsatD SfzyOmXlP7ybz6qF+QI4bZSvHV0x3z2c8G1/JxrB2XRSJvFQAT+Eksw3y2EEAfvP0rTq uhTgSykuYPgOzYWkQS/X4o7R+otXRj7Txqy0je5GhhpILUaCU5o/lrRGUiCEcHt64sIn 1YZpOdNDlEeW2U065TG2v8Aq/ILF1cvzE56PUhTtNSfLtL1rpuzZho17OOO2Iv+hqeki GiCFWHlXMd29WKBGykRMZrFfBnDL1TEQpKRz8vZKrhRLfP0qJNLEn8zDFIS0i+g3YTzI LvMQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=YiH16JZv; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-45822fb3b33si75414951cf.579.2024.09.10.05.39.07 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 10 Sep 2024 05:39:07 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=YiH16JZv; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1so08N-0003Cg-Oo; Tue, 10 Sep 2024 08:38:17 -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 1so08J-0002vp-RH for qemu-devel@nongnu.org; Tue, 10 Sep 2024 08:38:11 -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 1so088-0005AM-MQ for qemu-devel@nongnu.org; Tue, 10 Sep 2024 08:38:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1725971875; 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=W6QHQJ48zpU4qGd3mkKxNWD3H8DD0ZEDdWZ1xYCdr60=; b=YiH16JZvUrM4LyAkPyvBBJgg1hTHdN3eI0tpwjyJPcBLMJ6qsZp8sYiIgcabrr64ideAyK AOi1vkP+teGAAmW1vOZ3E+zMwubfKxjjTsWn3rEjVYfpC5mFKa7vniEQiP8GxUVLcMYMti lGuk7egaA5zrMQlQJkzr+Dj3uVxXyvY= Received: from mx-prod-mc-03.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-282-3OJDxxeKN3im1hL0OwuUHg-1; Tue, 10 Sep 2024 08:37:50 -0400 X-MC-Unique: 3OJDxxeKN3im1hL0OwuUHg-1 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (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-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id C5AF71977025; Tue, 10 Sep 2024 12:37:49 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.39.193.120]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 6A37919560AB; Tue, 10 Sep 2024 12:37:47 +0000 (UTC) From: Thomas Huth To: qemu-devel@nongnu.org Cc: Peter Maydell Subject: [PULL 10/22] tests/functional: Convert mips64el I6400 Malta avocado tests Date: Tue, 10 Sep 2024 14:37:11 +0200 Message-ID: <20240910123726.182975-11-thuth@redhat.com> In-Reply-To: <20240910123726.182975-1-thuth@redhat.com> References: <20240910123726.182975-1-thuth@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 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: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.145, 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, SPF_HELO_NONE=0.001, T_SPF_TEMPERROR=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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Philippe Mathieu-Daudé Straight forward conversion. Update the SHA1 hashes to SHA256 hashes since SHA1 should not be used anymore nowadays. Signed-off-by: Philippe Mathieu-Daudé Message-ID: <20240827094905.80648-4-philmd@linaro.org> Reviewed-by: Thomas Huth Message-ID: <20240906180549.792832-5-thuth@redhat.com> Signed-off-by: Thomas Huth --- MAINTAINERS | 1 + tests/avocado/machine_mips_malta.py | 108 ------------------------ tests/functional/meson.build | 1 + tests/functional/test_mips64el_malta.py | 108 ++++++++++++++++++++++++ 4 files changed, 110 insertions(+), 108 deletions(-) create mode 100755 tests/functional/test_mips64el_malta.py diff --git a/MAINTAINERS b/MAINTAINERS index a25022a77a..dcf3823169 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1371,6 +1371,7 @@ F: hw/pci-host/gt64120.c F: include/hw/southbridge/piix.h F: tests/avocado/linux_ssh_mips_malta.py F: tests/avocado/machine_mips_malta.py +F: tests/functional/test_mips64el_malta.py Mipssim R: Aleksandar Rikalo diff --git a/tests/avocado/machine_mips_malta.py b/tests/avocado/machine_mips_malta.py index 07a80633b5..05c64e18c4 100644 --- a/tests/avocado/machine_mips_malta.py +++ b/tests/avocado/machine_mips_malta.py @@ -8,121 +8,13 @@ # SPDX-License-Identifier: GPL-2.0-or-later import os -import gzip -import logging -from avocado import skipUnless -from avocado import skipUnless from avocado.utils import archive from avocado_qemu import QemuSystemTest -from avocado_qemu import exec_command_and_wait_for_pattern from avocado_qemu import interrupt_interactive_console_until_pattern from avocado_qemu import wait_for_console_pattern -NUMPY_AVAILABLE = True -try: - import numpy as np -except ImportError: - NUMPY_AVAILABLE = False - -CV2_AVAILABLE = True -try: - import cv2 -except ImportError: - CV2_AVAILABLE = False - - -@skipUnless(NUMPY_AVAILABLE, 'Python NumPy not installed') -@skipUnless(CV2_AVAILABLE, 'Python OpenCV not installed') -class MaltaMachineFramebuffer(QemuSystemTest): - - timeout = 30 - - KERNEL_COMMON_COMMAND_LINE = 'printk.time=0 ' - - def do_test_i6400_framebuffer_logo(self, cpu_cores_count): - """ - Boot Linux kernel and check Tux logo is displayed on the framebuffer. - """ - screendump_path = os.path.join(self.workdir, 'screendump.pbm') - - kernel_url = ('https://github.com/philmd/qemu-testing-blob/raw/' - 'a5966ca4b5/mips/malta/mips64el/' - 'vmlinux-4.7.0-rc1.I6400.gz') - kernel_hash = '096f50c377ec5072e6a366943324622c312045f6' - kernel_path_gz = self.fetch_asset(kernel_url, asset_hash=kernel_hash) - kernel_path = self.workdir + "vmlinux" - archive.gzip_uncompress(kernel_path_gz, kernel_path) - - tuxlogo_url = ('https://github.com/torvalds/linux/raw/v2.6.12/' - 'drivers/video/logo/logo_linux_vga16.ppm') - tuxlogo_hash = '3991c2ddbd1ddaecda7601f8aafbcf5b02dc86af' - tuxlogo_path = self.fetch_asset(tuxlogo_url, asset_hash=tuxlogo_hash) - - self.vm.set_console() - kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE + - 'clocksource=GIC console=tty0 console=ttyS0') - self.vm.add_args('-kernel', kernel_path, - '-smp', '%u' % cpu_cores_count, - '-vga', 'std', - '-append', kernel_command_line) - self.vm.launch() - framebuffer_ready = 'Console: switching to colour frame buffer device' - wait_for_console_pattern(self, framebuffer_ready, - failure_message='Kernel panic - not syncing') - self.vm.cmd('human-monitor-command', command_line='stop') - self.vm.cmd('human-monitor-command', - command_line='screendump %s' % screendump_path) - logger = logging.getLogger('framebuffer') - - match_threshold = 0.95 - screendump_bgr = cv2.imread(screendump_path, cv2.IMREAD_COLOR) - tuxlogo_bgr = cv2.imread(tuxlogo_path, cv2.IMREAD_COLOR) - result = cv2.matchTemplate(screendump_bgr, tuxlogo_bgr, - cv2.TM_CCOEFF_NORMED) - loc = np.where(result >= match_threshold) - tuxlogo_count = 0 - h, w = tuxlogo_bgr.shape[:2] - debug_png = os.getenv('AVOCADO_CV2_SCREENDUMP_PNG_PATH') - for tuxlogo_count, pt in enumerate(zip(*loc[::-1]), start=1): - logger.debug('found Tux at position (x, y) = %s', pt) - cv2.rectangle(screendump_bgr, pt, - (pt[0] + w, pt[1] + h), (0, 0, 255), 2) - if debug_png: - cv2.imwrite(debug_png, screendump_bgr) - self.assertGreaterEqual(tuxlogo_count, cpu_cores_count) - - def test_mips_malta_i6400_framebuffer_logo_1core(self): - """ - :avocado: tags=arch:mips64el - :avocado: tags=machine:malta - :avocado: tags=cpu:I6400 - """ - self.do_test_i6400_framebuffer_logo(1) - - @skipUnless(os.getenv('QEMU_TEST_FLAKY_TESTS'), 'Test is unstable on GitLab') - def test_mips_malta_i6400_framebuffer_logo_7cores(self): - """ - :avocado: tags=arch:mips64el - :avocado: tags=machine:malta - :avocado: tags=cpu:I6400 - :avocado: tags=mips:smp - :avocado: tags=flaky - """ - self.do_test_i6400_framebuffer_logo(7) - - @skipUnless(os.getenv('QEMU_TEST_FLAKY_TESTS'), 'Test is unstable on GitLab') - def test_mips_malta_i6400_framebuffer_logo_8cores(self): - """ - :avocado: tags=arch:mips64el - :avocado: tags=machine:malta - :avocado: tags=cpu:I6400 - :avocado: tags=mips:smp - :avocado: tags=flaky - """ - self.do_test_i6400_framebuffer_logo(8) - class MaltaMachine(QemuSystemTest): def do_test_yamon(self): diff --git a/tests/functional/meson.build b/tests/functional/meson.build index c6bb345d2c..9baf903e39 100644 --- a/tests/functional/meson.build +++ b/tests/functional/meson.build @@ -75,6 +75,7 @@ tests_mips64el_system_quick = [ tests_mips64el_system_thorough = [ 'mips64el_loongson3v', + 'mips64el_malta', ] tests_ppc_system_quick = [ diff --git a/tests/functional/test_mips64el_malta.py b/tests/functional/test_mips64el_malta.py new file mode 100755 index 0000000000..0c4e9a00ef --- /dev/null +++ b/tests/functional/test_mips64el_malta.py @@ -0,0 +1,108 @@ +#!/usr/bin/env python3 +# +# Functional tests for the little-endian 64-bit MIPS Malta board +# +# Copyright (c) Philippe Mathieu-Daudé +# +# This work is licensed under the terms of the GNU GPL, version 2 or later. +# See the COPYING file in the top-level directory. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +import os +import logging + +from qemu_test import LinuxKernelTest, Asset +from qemu_test import exec_command_and_wait_for_pattern +from qemu_test.utils import gzip_uncompress +from unittest import skipUnless + +NUMPY_AVAILABLE = True +try: + import numpy as np +except ImportError: + NUMPY_AVAILABLE = False + +CV2_AVAILABLE = True +try: + import cv2 +except ImportError: + CV2_AVAILABLE = False + + +@skipUnless(NUMPY_AVAILABLE, 'Python NumPy not installed') +@skipUnless(CV2_AVAILABLE, 'Python OpenCV not installed') +class MaltaMachineFramebuffer(LinuxKernelTest): + + timeout = 30 + + ASSET_KERNEL_4_7_0 = Asset( + ('https://github.com/philmd/qemu-testing-blob/raw/a5966ca4b5/' + 'mips/malta/mips64el/vmlinux-4.7.0-rc1.I6400.gz'), + '1f64efc59968a3c328672e6b10213fe574bb2308d9d2ed44e75e40be59e9fbc2') + + ASSET_TUXLOGO = Asset( + ('https://github.com/torvalds/linux/raw/v2.6.12/' + 'drivers/video/logo/logo_linux_vga16.ppm'), + 'b762f0d91ec018887ad1b334543c2fdf9be9fdfc87672b409211efaa3ea0ef79') + + def do_test_i6400_framebuffer_logo(self, cpu_cores_count): + """ + Boot Linux kernel and check Tux logo is displayed on the framebuffer. + """ + screendump_path = os.path.join(self.workdir, 'screendump.pbm') + + kernel_path_gz = self.ASSET_KERNEL_4_7_0.fetch() + kernel_path = self.workdir + "vmlinux" + gzip_uncompress(kernel_path_gz, kernel_path) + + tuxlogo_path = self.ASSET_TUXLOGO.fetch() + + self.set_machine('malta') + self.vm.set_console() + kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE + + 'clocksource=GIC console=tty0 console=ttyS0') + self.vm.add_args('-kernel', kernel_path, + '-cpu', 'I6400', + '-smp', '%u' % cpu_cores_count, + '-vga', 'std', + '-append', kernel_command_line) + self.vm.launch() + framebuffer_ready = 'Console: switching to colour frame buffer device' + self.wait_for_console_pattern(framebuffer_ready) + self.vm.cmd('human-monitor-command', command_line='stop') + self.vm.cmd('human-monitor-command', + command_line='screendump %s' % screendump_path) + logger = logging.getLogger('framebuffer') + + match_threshold = 0.95 + screendump_bgr = cv2.imread(screendump_path, cv2.IMREAD_COLOR) + tuxlogo_bgr = cv2.imread(tuxlogo_path, cv2.IMREAD_COLOR) + result = cv2.matchTemplate(screendump_bgr, tuxlogo_bgr, + cv2.TM_CCOEFF_NORMED) + loc = np.where(result >= match_threshold) + tuxlogo_count = 0 + h, w = tuxlogo_bgr.shape[:2] + debug_png = os.getenv('AVOCADO_CV2_SCREENDUMP_PNG_PATH') + for tuxlogo_count, pt in enumerate(zip(*loc[::-1]), start=1): + logger.debug('found Tux at position (x, y) = %s', pt) + cv2.rectangle(screendump_bgr, pt, + (pt[0] + w, pt[1] + h), (0, 0, 255), 2) + if debug_png: + cv2.imwrite(debug_png, screendump_bgr) + self.assertGreaterEqual(tuxlogo_count, cpu_cores_count) + + def test_mips_malta_i6400_framebuffer_logo_1core(self): + self.do_test_i6400_framebuffer_logo(1) + + @skipUnless(os.getenv('QEMU_TEST_FLAKY_TESTS'), 'Test is unstable on GitLab') + def test_mips_malta_i6400_framebuffer_logo_7cores(self): + self.do_test_i6400_framebuffer_logo(7) + + @skipUnless(os.getenv('QEMU_TEST_FLAKY_TESTS'), 'Test is unstable on GitLab') + def test_mips_malta_i6400_framebuffer_logo_8cores(self): + self.do_test_i6400_framebuffer_logo(8) + + +if __name__ == '__main__': + LinuxKernelTest.main() From patchwork Tue Sep 10 12:37:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 826997 Delivered-To: patch@linaro.org Received: by 2002:adf:ab1c:0:b0:367:895a:4699 with SMTP id q28csp281857wrc; Tue, 10 Sep 2024 05:41:46 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXaPqY0jhFgiPRurp81MuUf8ILNBbNq2FDUPCMFldrE4CjNQArKZLnSyqEh7m0VFwsU7xVO5w==@linaro.org X-Google-Smtp-Source: AGHT+IGt4xUDEcaa/iULs5XFMRFrVmFvEgSSpQUWq0AeKNkfAgJAIVE5M9mGMKCYprzb4FcLQYSv X-Received: by 2002:a05:620a:1998:b0:7a9:a868:8814 with SMTP id af79cd13be357-7a9bf96dc9bmr567934785a.14.1725972106564; Tue, 10 Sep 2024 05:41:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1725972106; cv=none; d=google.com; s=arc-20240605; b=Dae4jJ5DbhgkryY9QzyoHU/z+6E7c7L4ISZ6Kh2XtqejRLEKKKBhNfxNDZMyQYV7H/ 7jcmgiXkqh975qaL5jfEzSy0AWb5HHxr27PVCVsZd29JJtMQF1sWr0lnflFS8BqRwDhl foCBVjh4iGMVnBuVHsecLjjzlC+peukJ8l1GCsB1rw1V9p3f7cxOAxZB+nFYAac9Dwl6 ohDg7gUji9wASiX2zVEpw1Bgcl+DNGoBkWhnSCI3KHHMw0Wq3lESOxRonrNJFRH10pZn RyEnCRUFRkH0CjLaS2cUD+vjIIv6ZN1/thv3+MqD5MNgcV01tfJs7imP0JdeKhvRUeDf Dz1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=iZe3dpPIOirOU0DqUL9wsE5Tn/WVqS1Vb/yx1VX2zk0=; fh=tOREyZHlK9Diwyw/7bj5IUyLT4I5EVkj5DE8XDtMiTs=; b=aoF14TC04FdT419in9UeoJN8NDusm/C6xyb9ykm3L4cSb3rx/bbTcX0/NCIpP41qPO kyZheqCyV9Ox3ePA+VGSMhQQ6o2JCAqvBPl0hctyJN+GtKRLcRekRg/ydri0TyeMLkmO 0sg2IxknEHSniOakAmuObKgzl2s+l3WFTleFoP3yEAxoQjks5lKObnBNHbixkJICgO9a KRpgKO1CRcJLbLYRNd1w3e5N67kkAkPfeNTF9BtOMYbcbv96miGOz32gi6yRAmwhmCWS vVebdB0yAO6BA7U7yiPXg3yaz4ll4a9xAfZdrJBwp9IjCt/bGAwF13abuDPv3GM+5hCo mOIA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=APMk5Sf8; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7a9a7a46508si759128985a.391.2024.09.10.05.41.46 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 10 Sep 2024 05:41:46 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=APMk5Sf8; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1so08S-0003vC-Ow; Tue, 10 Sep 2024 08:38:21 -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 1so08G-0002bn-4t for qemu-devel@nongnu.org; Tue, 10 Sep 2024 08:38:09 -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 1so086-0005AR-Nw for qemu-devel@nongnu.org; Tue, 10 Sep 2024 08:38:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1725971875; 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=iZe3dpPIOirOU0DqUL9wsE5Tn/WVqS1Vb/yx1VX2zk0=; b=APMk5Sf8+ZsZw49PMQDIKs0OYVIW4eNDeKt2gxdLR6+Hq+LfPcgqpHbg6SXghG8PedoI2i vYlW7BOPSZQpZHPUPL0Jw+zF92RUuswkUoB/HQQW3K7FTLt/ZK9iRdO5DuNcxdM/O2xWhW knoJqLC2pRNyU/mlCR1q4b1ASJLGD9A= Received: from mx-prod-mc-03.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-668-gOeDVagRO9mKL6VtlbKmeA-1; Tue, 10 Sep 2024 08:37:52 -0400 X-MC-Unique: gOeDVagRO9mKL6VtlbKmeA-1 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (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-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 298D4195604F; Tue, 10 Sep 2024 12:37:51 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.39.193.120]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 2981B19560AD; Tue, 10 Sep 2024 12:37:49 +0000 (UTC) From: Thomas Huth To: qemu-devel@nongnu.org Cc: Peter Maydell Subject: [PULL 11/22] tests/functional: Convert mips64el 5KEc Malta avocado tests Date: Tue, 10 Sep 2024 14:37:12 +0200 Message-ID: <20240910123726.182975-12-thuth@redhat.com> In-Reply-To: <20240910123726.182975-1-thuth@redhat.com> References: <20240910123726.182975-1-thuth@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 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.145, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, PDS_BTC_ID=0.156, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Philippe Mathieu-Daudé Straight forward conversion. Update the SHA1 hashes to SHA256 hashes since SHA1 should not be used anymore nowadays. Signed-off-by: Philippe Mathieu-Daudé Message-ID: <20240827094905.80648-5-philmd@linaro.org> Message-ID: <20240906180549.792832-6-thuth@redhat.com> Signed-off-by: Thomas Huth --- tests/avocado/boot_linux_console.py | 74 ------------------------ tests/functional/test_mips64el_malta.py | 76 +++++++++++++++++++++++++ 2 files changed, 76 insertions(+), 74 deletions(-) diff --git a/tests/avocado/boot_linux_console.py b/tests/avocado/boot_linux_console.py index e1e20c36f7..84b31cb84e 100644 --- a/tests/avocado/boot_linux_console.py +++ b/tests/avocado/boot_linux_console.py @@ -138,38 +138,6 @@ def test_mips_malta(self): console_pattern = 'Kernel command line: %s' % kernel_command_line self.wait_for_console_pattern(console_pattern) - def test_mips64el_malta(self): - """ - This test requires the ar tool to extract "data.tar.gz" from - the Debian package. - - The kernel can be rebuilt using this Debian kernel source [1] and - following the instructions on [2]. - - [1] http://snapshot.debian.org/package/linux-2.6/2.6.32-48/ - #linux-source-2.6.32_2.6.32-48 - [2] https://kernel-team.pages.debian.net/kernel-handbook/ - ch-common-tasks.html#s-common-official - - :avocado: tags=arch:mips64el - :avocado: tags=machine:malta - """ - deb_url = ('http://snapshot.debian.org/archive/debian/' - '20130217T032700Z/pool/main/l/linux-2.6/' - 'linux-image-2.6.32-5-5kc-malta_2.6.32-48_mipsel.deb') - deb_hash = '1aaec92083bf22fda31e0d27fa8d9a388e5fc3d5' - deb_path = self.fetch_asset(deb_url, asset_hash=deb_hash) - kernel_path = self.extract_from_deb(deb_path, - '/boot/vmlinux-2.6.32-5-5kc-malta') - - self.vm.set_console() - kernel_command_line = self.KERNEL_COMMON_COMMAND_LINE + 'console=ttyS0' - self.vm.add_args('-kernel', kernel_path, - '-append', kernel_command_line) - self.vm.launch() - console_pattern = 'Kernel command line: %s' % kernel_command_line - self.wait_for_console_pattern(console_pattern) - def test_mips_malta_cpio(self): """ :avocado: tags=arch:mips @@ -211,48 +179,6 @@ def test_mips_malta_cpio(self): # Wait for VM to shut down gracefully self.vm.wait() - @skipUnless(os.getenv('AVOCADO_ALLOW_UNTRUSTED_CODE'), 'untrusted code') - def test_mips64el_malta_5KEc_cpio(self): - """ - :avocado: tags=arch:mips64el - :avocado: tags=machine:malta - :avocado: tags=endian:little - :avocado: tags=cpu:5KEc - """ - kernel_url = ('https://github.com/philmd/qemu-testing-blob/' - 'raw/9ad2df38/mips/malta/mips64el/' - 'vmlinux-3.19.3.mtoman.20150408') - kernel_hash = '00d1d268fb9f7d8beda1de6bebcc46e884d71754' - kernel_path = self.fetch_asset(kernel_url, asset_hash=kernel_hash) - initrd_url = ('https://github.com/groeck/linux-build-test/' - 'raw/8584a59e/rootfs/' - 'mipsel64/rootfs.mipsel64r1.cpio.gz') - initrd_hash = '1dbb8a396e916847325284dbe2151167' - initrd_path_gz = self.fetch_asset(initrd_url, algorithm='md5', - asset_hash=initrd_hash) - initrd_path = self.workdir + "rootfs.cpio" - archive.gzip_uncompress(initrd_path_gz, initrd_path) - - self.vm.set_console() - kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE - + 'console=ttyS0 console=tty ' - + 'rdinit=/sbin/init noreboot') - self.vm.add_args('-kernel', kernel_path, - '-initrd', initrd_path, - '-append', kernel_command_line, - '-no-reboot') - self.vm.launch() - wait_for_console_pattern(self, 'Boot successful.') - - exec_command_and_wait_for_pattern(self, 'cat /proc/cpuinfo', - 'MIPS 5KE') - exec_command_and_wait_for_pattern(self, 'uname -a', - '3.19.3.mtoman.20150408') - exec_command_and_wait_for_pattern(self, 'reboot', - 'reboot: Restarting system') - # Wait for VM to shut down gracefully - self.vm.wait() - def do_test_mips_malta32el_nanomips(self, kernel_path_xz): kernel_path = self.workdir + "kernel" with lzma.open(kernel_path_xz, 'rb') as f_in: diff --git a/tests/functional/test_mips64el_malta.py b/tests/functional/test_mips64el_malta.py index 0c4e9a00ef..1be93d7ff0 100755 --- a/tests/functional/test_mips64el_malta.py +++ b/tests/functional/test_mips64el_malta.py @@ -30,6 +30,82 @@ CV2_AVAILABLE = False +class MaltaMachineConsole(QemuSystemTest): + + ASSET_KERNEL_2_63_2 = Asset( + ('http://snapshot.debian.org/archive/debian/' + '20130217T032700Z/pool/main/l/linux-2.6/' + 'linux-image-2.6.32-5-5kc-malta_2.6.32-48_mipsel.deb'), + '35eb476f03be589824b0310358f1c447d85e645b88cbcd2ac02b97ef560f9f8d') + + def test_mips64el_malta(self): + """ + This test requires the ar tool to extract "data.tar.gz" from + the Debian package. + + The kernel can be rebuilt using this Debian kernel source [1] and + following the instructions on [2]. + + [1] http://snapshot.debian.org/package/linux-2.6/2.6.32-48/ + #linux-source-2.6.32_2.6.32-48 + [2] https://kernel-team.pages.debian.net/kernel-handbook/ + ch-common-tasks.html#s-common-official + """ + deb_path = self.ASSET_KERNEL_2_63_2.fetch() + kernel_path = extract_from_deb(deb_path, self.workdir, + '/boot/vmlinux-2.6.32-5-5kc-malta') + + self.set_machine('malta') + self.vm.set_console() + kernel_command_line = KERNEL_COMMON_COMMAND_LINE + 'console=ttyS0' + self.vm.add_args('-kernel', kernel_path, + '-append', kernel_command_line) + self.vm.launch() + console_pattern = 'Kernel command line: %s' % kernel_command_line + linux_kernel_wait_for_pattern(self, console_pattern) + + ASSET_KERNEL_3_19_3 = Asset( + ('https://github.com/philmd/qemu-testing-blob/' + 'raw/9ad2df38/mips/malta/mips64el/' + 'vmlinux-3.19.3.mtoman.20150408'), + '8d3beb003bc66051ead98e7172139017fcf9ce2172576541c57e86418dfa5ab8') + + ASSET_CPIO_R1 = Asset( + ('https://github.com/groeck/linux-build-test/' + 'raw/8584a59e/rootfs/mipsel64/' + 'rootfs.mipsel64r1.cpio.gz'), + '75ba10cd35fb44e32948eeb26974f061b703c81c4ba2fab1ebcacf1d1bec3b61') + + @skipUnless(os.getenv('QEMU_TEST_ALLOW_UNTRUSTED_CODE'), 'untrusted code') + def test_mips64el_malta_5KEc_cpio(self): + kernel_path = self.ASSET_KERNEL_3_19_3.fetch() + initrd_path_gz = self.ASSET_CPIO_R1.fetch() + initrd_path = os.path.join(self.workdir, 'rootfs.cpio') + gzip_uncompress(initrd_path_gz, initrd_path) + + self.set_machine('malta') + self.vm.set_console() + kernel_command_line = (KERNEL_COMMON_COMMAND_LINE + + 'console=ttyS0 console=tty ' + + 'rdinit=/sbin/init noreboot') + self.vm.add_args('-cpu', '5KEc', + '-kernel', kernel_path, + '-initrd', initrd_path, + '-append', kernel_command_line, + '-no-reboot') + self.vm.launch() + linux_kernel_wait_for_pattern(self, 'Boot successful.') + + exec_command_and_wait_for_pattern(self, 'cat /proc/cpuinfo', + 'MIPS 5KE') + exec_command_and_wait_for_pattern(self, 'uname -a', + '3.19.3.mtoman.20150408') + exec_command_and_wait_for_pattern(self, 'reboot', + 'reboot: Restarting system') + # Wait for VM to shut down gracefully + self.vm.wait() + + @skipUnless(NUMPY_AVAILABLE, 'Python NumPy not installed') @skipUnless(CV2_AVAILABLE, 'Python OpenCV not installed') class MaltaMachineFramebuffer(LinuxKernelTest): From patchwork Tue Sep 10 12:37:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 826995 Delivered-To: patch@linaro.org Received: by 2002:adf:ab1c:0:b0:367:895a:4699 with SMTP id q28csp281788wrc; Tue, 10 Sep 2024 05:41:37 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVZpiawDyB9qq25pJvEXNovOQq3rEP1acSU4lLBSpu6TS6JpUuARV2IifUH/tiNM703tITe9A==@linaro.org X-Google-Smtp-Source: AGHT+IFstz6vf+cmCkIqMnNzlTMxL3wxL6OiUraImRb5dflk31bbSXaAq2LYTQ+hQCsBgvT3772V X-Received: by 2002:a05:620a:1b9b:b0:7a9:a1b5:2711 with SMTP id af79cd13be357-7a9a1b52948mr1973472285a.54.1725972097550; Tue, 10 Sep 2024 05:41:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1725972097; cv=none; d=google.com; s=arc-20240605; b=Jg1mdjwMuvkcv1KdSDN2ucBeADD0VEk3y/KdQUBEGTWaeojpPbbJRvVdGQvMaBthn+ huGD/6ceW1Xr3s1zsP0fDR1onj79AmH2OIm+QUPS7hs6XyvafSSfLjPoG5zNW6JbDNey TJ6NMTIQTtg23KduN5ko5q7WvKg6djrw/twLJz/Xq0ftztlR7uDivcGAt9+cJNTIhoqs dVizvHvn04mMbZhW/vZKwa3yuI+DPDDsqDWi/QQNHzpb6EGZ7mm8Cr/DRDVlBxxV8e/i 4ayWBTw84PryxfVFw7hWincir9o+yvtB0GHyqXGiHEZvOwhuDtLo6cY0pcYjutUxaD/x 3hBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=rUPlNmswNBNwGGbdP+FKNLR2RiuR+lcerOVxdPuz66Y=; fh=tOREyZHlK9Diwyw/7bj5IUyLT4I5EVkj5DE8XDtMiTs=; b=DCSxgN1TBWEWuQV8pxQiqEycqqS2xIJ+BnayWHiPIfgDbQRcMmpWCxvgNDiI77F+qO 1PL39RC/dPMTCI2dGjP22BavEeOsTx96/Ll8OuRfBIWxtdB1W0HMOrsjlsuxUf9vpXTz 86bMtetU6cN9RrDEk2YjvwSts9MpdwSeUKIiRzylAkI7ODjvBqfHzeis4VCQaueKqbHu q/4tBS6tR4/87mpjCHS4N/eGGu1qqAjHI2cs+pi6Q2BsgUQbe+tWexytZW3eTHWScO/Z TRSakOIsRbaJlQkXGIpFd/Q6RD1hUKwxZbPBYuwMQ+GAVJ19OuFbfIE3fTMOLHqvYzKM s6bA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=gwkQbNER; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-45822f3eaf6si77984301cf.300.2024.09.10.05.41.37 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 10 Sep 2024 05:41:37 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=gwkQbNER; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1so08T-00043t-K2; Tue, 10 Sep 2024 08:38:21 -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 1so08J-0002rM-CT for qemu-devel@nongnu.org; Tue, 10 Sep 2024 08:38:11 -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 1so08A-0005Ak-0i for qemu-devel@nongnu.org; Tue, 10 Sep 2024 08:38:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1725971879; 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=rUPlNmswNBNwGGbdP+FKNLR2RiuR+lcerOVxdPuz66Y=; b=gwkQbNERtwFEKi9sHs0dGnFSp+n9lst6gNMC9iKFLQfp+Zki0kjDJYHrYunvRvZR2Z5ETl H5Rv2laj8YtLSgWRMFn8FfSd8rNS2Q79RDkR7lMsbP/Yu6Xv82U4WoJfTN2eHX7se94hIv 7PAqcHHoRb/55WYR7NP1yP13MLoTyU0= Received: from mx-prod-mc-03.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-694-yMBvp3hEM4qbzdzdTr8eWw-1; Tue, 10 Sep 2024 08:37:56 -0400 X-MC-Unique: yMBvp3hEM4qbzdzdTr8eWw-1 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (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-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 4A44C197701A; Tue, 10 Sep 2024 12:37:55 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.39.193.120]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 1C66519560AB; Tue, 10 Sep 2024 12:37:51 +0000 (UTC) From: Thomas Huth To: qemu-devel@nongnu.org Cc: Peter Maydell Subject: [PULL 12/22] tests/functional: Convert mips32el Malta YAMON avocado test Date: Tue, 10 Sep 2024 14:37:13 +0200 Message-ID: <20240910123726.182975-13-thuth@redhat.com> In-Reply-To: <20240910123726.182975-1-thuth@redhat.com> References: <20240910123726.182975-1-thuth@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 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: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.145, 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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Philippe Mathieu-Daudé Straight forward conversion using the Python standard zipfile module instead of avocado.utils package. Update the SHA1 hashes to SHA256 hashes since SHA1 should not be used anymore nowadays. Signed-off-by: Philippe Mathieu-Daudé Message-ID: <20240827094905.80648-6-philmd@linaro.org> Reviewed-by: Thomas Huth Message-ID: <20240906180549.792832-7-thuth@redhat.com> Signed-off-by: Thomas Huth --- MAINTAINERS | 2 +- tests/avocado/machine_mips_malta.py | 54 ------------------------- tests/functional/meson.build | 4 ++ tests/functional/test_mips64el_malta.py | 16 ++++---- tests/functional/test_mipsel_malta.py | 47 +++++++++++++++++++++ 5 files changed, 61 insertions(+), 62 deletions(-) delete mode 100644 tests/avocado/machine_mips_malta.py create mode 100755 tests/functional/test_mipsel_malta.py diff --git a/MAINTAINERS b/MAINTAINERS index dcf3823169..2f76098230 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1370,7 +1370,7 @@ F: hw/mips/malta.c F: hw/pci-host/gt64120.c F: include/hw/southbridge/piix.h F: tests/avocado/linux_ssh_mips_malta.py -F: tests/avocado/machine_mips_malta.py +F: tests/functional/test_mipsel_malta.py F: tests/functional/test_mips64el_malta.py Mipssim diff --git a/tests/avocado/machine_mips_malta.py b/tests/avocado/machine_mips_malta.py deleted file mode 100644 index 05c64e18c4..0000000000 --- a/tests/avocado/machine_mips_malta.py +++ /dev/null @@ -1,54 +0,0 @@ -# Functional tests for the MIPS Malta board -# -# Copyright (c) Philippe Mathieu-Daudé -# -# This work is licensed under the terms of the GNU GPL, version 2 or later. -# See the COPYING file in the top-level directory. -# -# SPDX-License-Identifier: GPL-2.0-or-later - -import os - -from avocado.utils import archive -from avocado_qemu import QemuSystemTest -from avocado_qemu import interrupt_interactive_console_until_pattern -from avocado_qemu import wait_for_console_pattern - - -class MaltaMachine(QemuSystemTest): - - def do_test_yamon(self): - rom_url = ('https://s3-eu-west-1.amazonaws.com/' - 'downloads-mips/mips-downloads/' - 'YAMON/yamon-bin-02.22.zip') - rom_hash = '8da7ecddbc5312704b8b324341ee238189bde480' - zip_path = self.fetch_asset(rom_url, asset_hash=rom_hash) - - archive.extract(zip_path, self.workdir) - yamon_path = os.path.join(self.workdir, 'yamon-02.22.bin') - - self.vm.set_console() - self.vm.add_args('-bios', yamon_path) - self.vm.launch() - - prompt = 'YAMON>' - pattern = 'YAMON ROM Monitor' - interrupt_interactive_console_until_pattern(self, pattern, prompt) - wait_for_console_pattern(self, prompt) - self.vm.shutdown() - - def test_mipsel_malta_yamon(self): - """ - :avocado: tags=arch:mipsel - :avocado: tags=machine:malta - :avocado: tags=endian:little - """ - self.do_test_yamon() - - def test_mips64el_malta_yamon(self): - """ - :avocado: tags=arch:mips64el - :avocado: tags=machine:malta - :avocado: tags=endian:little - """ - self.do_test_yamon() diff --git a/tests/functional/meson.build b/tests/functional/meson.build index 9baf903e39..daee61ec3c 100644 --- a/tests/functional/meson.build +++ b/tests/functional/meson.build @@ -69,6 +69,10 @@ tests_microblazeel_system_thorough = [ 'microblazeel_s3adsp1800' ] +tests_mipsel_system_thorough = [ + 'mipsel_malta', +] + tests_mips64el_system_quick = [ 'mips64el_fuloong2e', ] diff --git a/tests/functional/test_mips64el_malta.py b/tests/functional/test_mips64el_malta.py index 1be93d7ff0..6c6355b131 100755 --- a/tests/functional/test_mips64el_malta.py +++ b/tests/functional/test_mips64el_malta.py @@ -30,7 +30,7 @@ CV2_AVAILABLE = False -class MaltaMachineConsole(QemuSystemTest): +class MaltaMachineConsole(LinuxKernelTest): ASSET_KERNEL_2_63_2 = Asset( ('http://snapshot.debian.org/archive/debian/' @@ -52,17 +52,17 @@ def test_mips64el_malta(self): ch-common-tasks.html#s-common-official """ deb_path = self.ASSET_KERNEL_2_63_2.fetch() - kernel_path = extract_from_deb(deb_path, self.workdir, - '/boot/vmlinux-2.6.32-5-5kc-malta') + kernel_path = self.extract_from_deb(deb_path, + '/boot/vmlinux-2.6.32-5-5kc-malta') self.set_machine('malta') self.vm.set_console() - kernel_command_line = KERNEL_COMMON_COMMAND_LINE + 'console=ttyS0' + kernel_command_line = self.KERNEL_COMMON_COMMAND_LINE + 'console=ttyS0' self.vm.add_args('-kernel', kernel_path, '-append', kernel_command_line) self.vm.launch() console_pattern = 'Kernel command line: %s' % kernel_command_line - linux_kernel_wait_for_pattern(self, console_pattern) + self.wait_for_console_pattern(console_pattern) ASSET_KERNEL_3_19_3 = Asset( ('https://github.com/philmd/qemu-testing-blob/' @@ -85,7 +85,7 @@ def test_mips64el_malta_5KEc_cpio(self): self.set_machine('malta') self.vm.set_console() - kernel_command_line = (KERNEL_COMMON_COMMAND_LINE + kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE + 'console=ttyS0 console=tty ' + 'rdinit=/sbin/init noreboot') self.vm.add_args('-cpu', '5KEc', @@ -94,7 +94,7 @@ def test_mips64el_malta_5KEc_cpio(self): '-append', kernel_command_line, '-no-reboot') self.vm.launch() - linux_kernel_wait_for_pattern(self, 'Boot successful.') + self.wait_for_console_pattern('Boot successful.') exec_command_and_wait_for_pattern(self, 'cat /proc/cpuinfo', 'MIPS 5KE') @@ -180,5 +180,7 @@ def test_mips_malta_i6400_framebuffer_logo_8cores(self): self.do_test_i6400_framebuffer_logo(8) +from test_mipsel_malta import MaltaMachineYAMON + if __name__ == '__main__': LinuxKernelTest.main() diff --git a/tests/functional/test_mipsel_malta.py b/tests/functional/test_mipsel_malta.py new file mode 100755 index 0000000000..f31f96b012 --- /dev/null +++ b/tests/functional/test_mipsel_malta.py @@ -0,0 +1,47 @@ +#!/usr/bin/env python3 +# +# Functional tests for the little-endian 32-bit MIPS Malta board +# +# Copyright (c) Philippe Mathieu-Daudé +# +# This work is licensed under the terms of the GNU GPL, version 2 or later. +# See the COPYING file in the top-level directory. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +import os + +from qemu_test import QemuSystemTest, Asset +from qemu_test import interrupt_interactive_console_until_pattern +from qemu_test import wait_for_console_pattern +from zipfile import ZipFile + + +class MaltaMachineYAMON(QemuSystemTest): + + ASSET_YAMON_ROM = Asset( + ('https://s3-eu-west-1.amazonaws.com/downloads-mips/mips-downloads/' + 'YAMON/yamon-bin-02.22.zip'), + 'eef86f0eed0ef554f041dcd47b87eebea0e6f9f1184ed31f7e9e8b4a803860ab') + + def test_mipsel_malta_yamon(self): + yamon_bin = 'yamon-02.22.bin' + zip_path = self.ASSET_YAMON_ROM.fetch() + with ZipFile(zip_path, 'r') as zf: + zf.extract(yamon_bin, path=self.workdir) + yamon_path = os.path.join(self.workdir, yamon_bin) + + self.set_machine('malta') + self.vm.set_console() + self.vm.add_args('-bios', yamon_path) + self.vm.launch() + + prompt = 'YAMON>' + pattern = 'YAMON ROM Monitor' + interrupt_interactive_console_until_pattern(self, pattern, prompt) + wait_for_console_pattern(self, prompt) + self.vm.shutdown() + + +if __name__ == '__main__': + QemuSystemTest.main() From patchwork Tue Sep 10 12:37:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 826991 Delivered-To: patch@linaro.org Received: by 2002:adf:ab1c:0:b0:367:895a:4699 with SMTP id q28csp281088wrc; Tue, 10 Sep 2024 05:39:44 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCX6Li2uQ1DHeuT2bpNuDU7ebSAvArMTFm5Qo8T4HA3ca5+Del8Q1CerR2k6a7oqxB3bTzFE/w==@linaro.org X-Google-Smtp-Source: AGHT+IH/9Gtw/aIj0/OGHsl/mXXMP8E+uYfQVjJsPxfcQ7WI7DxEd3CPuEhf7f4/DeGMtzMDcL/G X-Received: by 2002:a05:622a:1313:b0:458:4465:d6b4 with SMTP id d75a77b69052e-4584465d962mr21644871cf.13.1725971984731; Tue, 10 Sep 2024 05:39:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1725971984; cv=none; d=google.com; s=arc-20240605; b=Iz4EDOFbWHKssmQ3as+mwQQ+R6so4eZq/CMNRI1CjXDA4W7VInyu1kXZyN7rsN/aXC NJX+VSSUEWSi6rljlor5aJzj6yXjP1TKuqjmXJ9p1UI/YQxL1Nx3QxXGgRBH4Ei8/qff Ip5iZbChB+NOHwaiTlGauo/HlATnU84mvVKToVRcfS+qUb8Vzway9ANaq+a2YMPCcALt gwXdtXcwlCyaLK0Wau7eKm/fis6bsIQBomNdeJeS/rO+bs+d81Erlw+5X4Y/jwgcPvA5 1GbTUn/PAAsnc/sYk8bhouQarTV1Q1A8Gq4og7Zpec4GmvhfbJ0QqJ0gYLwLyXZiSMVu xfuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Mu586OZHFIJ1e8Osbpcd5hXz6qgD9J7Ny2j/lHBXvSY=; fh=tOREyZHlK9Diwyw/7bj5IUyLT4I5EVkj5DE8XDtMiTs=; b=W8DBzGxVNe78n/X4ji1kWVxTZQR24yHKOBtxLbBV9+lt+8ec4UCsXznradGrFAC2b2 LN/6QD84OZ7wqLTGFDr0HsaS4jugtjyiOlIpjs9kVyEloYxDvurx/A0SvrdCKHY/bESf oBROsJg/3iCfJCQpnxvQQ/o2ZtzTwQPogiCfwOEWodvmBiGULaXfrdj+peIILic7XZG0 U7tGBwYb/scTirXKHRkwJa9KHtRBsrTueBjbyVjdmaDpQVyY92zCt+3zVtHlhJ2wNN9u 3PziBBEHI4JMuw8CxMKjAWTp9nGUha9U41XfAmbWG8YleP7AN6YWb+/768jk8JV2cUDa kNWQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=jPdPaL9x; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-45822fb039asi76557991cf.578.2024.09.10.05.39.44 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 10 Sep 2024 05:39:44 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=jPdPaL9x; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1so08V-0004OX-ID; Tue, 10 Sep 2024 08:38:23 -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 1so08O-0003RJ-1K for qemu-devel@nongnu.org; Tue, 10 Sep 2024 08:38:17 -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 1so08F-0005B4-UY for qemu-devel@nongnu.org; Tue, 10 Sep 2024 08:38:14 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1725971883; 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=Mu586OZHFIJ1e8Osbpcd5hXz6qgD9J7Ny2j/lHBXvSY=; b=jPdPaL9xM0rbohxitLSY+KI5IJ7Vy4OxhxgaP+2G236auyQP8reJwE+7ontzHtSApvCdMj ZhWZBFr0DBLNNgQCuYkvPgk0qS9WtFuV0r62+J6s3L1QdsLyNUnLuYkKbcObtNdGVTsaG5 xDSMsvKTaH0qCI4L1qM8AIiBCgDws8o= Received: from mx-prod-mc-02.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-392-lPetawyxP6Ohaqe8hr-nJA-1; Tue, 10 Sep 2024 08:38:00 -0400 X-MC-Unique: lPetawyxP6Ohaqe8hr-nJA-1 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (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-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 35C541944D3C; Tue, 10 Sep 2024 12:37:59 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.39.193.120]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 6006419560AB; Tue, 10 Sep 2024 12:37:55 +0000 (UTC) From: Thomas Huth To: qemu-devel@nongnu.org Cc: Peter Maydell Subject: [PULL 13/22] tests/functional: Convert nanomips Malta avocado tests Date: Tue, 10 Sep 2024 14:37:14 +0200 Message-ID: <20240910123726.182975-14-thuth@redhat.com> In-Reply-To: <20240910123726.182975-1-thuth@redhat.com> References: <20240910123726.182975-1-thuth@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 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: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.145, 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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Philippe Mathieu-Daudé Straight forward conversion. Update the SHA1 hashes to SHA256 hashes since SHA1 should not be used anymore nowadays. $ QEMU_TEST_ALLOW_UNTRUSTED_CODE=1 \ make check-functional-mipsel ... ▶ 4/4 test_mipsel_malta.MaltaMachineConsole.test_mips_malta32el_nanomips_16k_up OK ▶ 4/4 test_mipsel_malta.MaltaMachineConsole.test_mips_malta32el_nanomips_4k OK ▶ 4/4 test_mipsel_malta.MaltaMachineConsole.test_mips_malta32el_nanomips_64k_dbg OK ▶ 4/4 test_mipsel_malta.MaltaMachineYAMON.test_mipsel_malta_yamon OK 4/4 qemu:func-thorough+func-mipsel-thorough+thorough / func-mipsel-mipsel_malta OK 9.95s 4 subtests passed Signed-off-by: Philippe Mathieu-Daudé Message-ID: <20240827094905.80648-7-philmd@linaro.org> [thuth: Use LinuxKernelTest] Message-ID: <20240906180549.792832-8-thuth@redhat.com> Signed-off-by: Thomas Huth --- tests/avocado/boot_linux_console.py | 59 --------------------------- tests/functional/test_mipsel_malta.py | 51 ++++++++++++++++++++++- 2 files changed, 50 insertions(+), 60 deletions(-) diff --git a/tests/avocado/boot_linux_console.py b/tests/avocado/boot_linux_console.py index 84b31cb84e..34f4abadd0 100644 --- a/tests/avocado/boot_linux_console.py +++ b/tests/avocado/boot_linux_console.py @@ -179,65 +179,6 @@ def test_mips_malta_cpio(self): # Wait for VM to shut down gracefully self.vm.wait() - def do_test_mips_malta32el_nanomips(self, kernel_path_xz): - kernel_path = self.workdir + "kernel" - with lzma.open(kernel_path_xz, 'rb') as f_in: - with open(kernel_path, 'wb') as f_out: - shutil.copyfileobj(f_in, f_out) - - self.vm.set_console() - kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE - + 'mem=256m@@0x0 ' - + 'console=ttyS0') - self.vm.add_args('-no-reboot', - '-kernel', kernel_path, - '-append', kernel_command_line) - self.vm.launch() - console_pattern = 'Kernel command line: %s' % kernel_command_line - self.wait_for_console_pattern(console_pattern) - - def test_mips_malta32el_nanomips_4k(self): - """ - :avocado: tags=arch:mipsel - :avocado: tags=machine:malta - :avocado: tags=endian:little - :avocado: tags=cpu:I7200 - """ - kernel_url = ('http://mipsdistros.mips.com/LinuxDistro/nanomips/' - 'kernels/v4.15.18-432-gb2eb9a8b07a1-20180627102142/' - 'generic_nano32r6el_page4k.xz') - kernel_hash = '477456aafd2a0f1ddc9482727f20fe9575565dd6' - kernel_path_xz = self.fetch_asset(kernel_url, asset_hash=kernel_hash) - self.do_test_mips_malta32el_nanomips(kernel_path_xz) - - def test_mips_malta32el_nanomips_16k_up(self): - """ - :avocado: tags=arch:mipsel - :avocado: tags=machine:malta - :avocado: tags=endian:little - :avocado: tags=cpu:I7200 - """ - kernel_url = ('http://mipsdistros.mips.com/LinuxDistro/nanomips/' - 'kernels/v4.15.18-432-gb2eb9a8b07a1-20180627102142/' - 'generic_nano32r6el_page16k_up.xz') - kernel_hash = 'e882868f944c71c816e832e2303b7874d044a7bc' - kernel_path_xz = self.fetch_asset(kernel_url, asset_hash=kernel_hash) - self.do_test_mips_malta32el_nanomips(kernel_path_xz) - - def test_mips_malta32el_nanomips_64k_dbg(self): - """ - :avocado: tags=arch:mipsel - :avocado: tags=machine:malta - :avocado: tags=endian:little - :avocado: tags=cpu:I7200 - """ - kernel_url = ('http://mipsdistros.mips.com/LinuxDistro/nanomips/' - 'kernels/v4.15.18-432-gb2eb9a8b07a1-20180627102142/' - 'generic_nano32r6el_page64k_dbg.xz') - kernel_hash = '18d1c68f2e23429e266ca39ba5349ccd0aeb7180' - kernel_path_xz = self.fetch_asset(kernel_url, asset_hash=kernel_hash) - self.do_test_mips_malta32el_nanomips(kernel_path_xz) - def test_aarch64_xlnx_versal_virt(self): """ :avocado: tags=arch:aarch64 diff --git a/tests/functional/test_mipsel_malta.py b/tests/functional/test_mipsel_malta.py index f31f96b012..b8dfddd856 100755 --- a/tests/functional/test_mipsel_malta.py +++ b/tests/functional/test_mipsel_malta.py @@ -11,12 +11,61 @@ import os -from qemu_test import QemuSystemTest, Asset +from qemu_test import QemuSystemTest, LinuxKernelTest, Asset from qemu_test import interrupt_interactive_console_until_pattern from qemu_test import wait_for_console_pattern +from qemu_test.utils import lzma_uncompress from zipfile import ZipFile +class MaltaMachineConsole(LinuxKernelTest): + + ASSET_KERNEL_4K = Asset( + ('http://mipsdistros.mips.com/LinuxDistro/nanomips/' + 'kernels/v4.15.18-432-gb2eb9a8b07a1-20180627102142/' + 'generic_nano32r6el_page4k.xz'), + '019e034094ac6cf3aa77df5e130fb023ce4dbc804b04bfcc560c6403e1ae6bdb') + ASSET_KERNEL_16K = Asset( + ('http://mipsdistros.mips.com/LinuxDistro/nanomips/' + 'kernels/v4.15.18-432-gb2eb9a8b07a1-20180627102142/' + 'generic_nano32r6el_page16k_up.xz'), + '3a54a10b3108c16a448dca9ea3db378733a27423befc2a45a5bdf990bd85e12c') + ASSET_KERNEL_64K = Asset( + ('http://mipsdistros.mips.com/LinuxDistro/nanomips/' + 'kernels/v4.15.18-432-gb2eb9a8b07a1-20180627102142/' + 'generic_nano32r6el_page64k_dbg.xz'), + 'ce21ff4b07a981ecb8a39db2876616f5a2473eb2ab459c6f67465b9914b0c6b6') + + def do_test_mips_malta32el_nanomips(self, kernel_path_xz): + kernel_path = os.path.join(self.workdir, 'kernel') + lzma_uncompress(kernel_path_xz, kernel_path) + + self.set_machine('malta') + self.vm.set_console() + kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE + + 'mem=256m@@0x0 ' + + 'console=ttyS0') + self.vm.add_args('-cpu', 'I7200', + '-no-reboot', + '-kernel', kernel_path, + '-append', kernel_command_line) + self.vm.launch() + console_pattern = 'Kernel command line: %s' % kernel_command_line + self.wait_for_console_pattern(console_pattern) + + def test_mips_malta32el_nanomips_4k(self): + kernel_path_xz = self.ASSET_KERNEL_4K.fetch() + self.do_test_mips_malta32el_nanomips(kernel_path_xz) + + def test_mips_malta32el_nanomips_16k_up(self): + kernel_path_xz = self.ASSET_KERNEL_16K.fetch() + self.do_test_mips_malta32el_nanomips(kernel_path_xz) + + def test_mips_malta32el_nanomips_64k_dbg(self): + kernel_path_xz = self.ASSET_KERNEL_16K.fetch() + self.do_test_mips_malta32el_nanomips(kernel_path_xz) + + class MaltaMachineYAMON(QemuSystemTest): ASSET_YAMON_ROM = Asset( From patchwork Tue Sep 10 12:37:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 826994 Delivered-To: patch@linaro.org Received: by 2002:adf:ab1c:0:b0:367:895a:4699 with SMTP id q28csp281274wrc; Tue, 10 Sep 2024 05:40:15 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVgrzsQVIKr8VlKL7QaowuEvgm5l6ujmq2fH0R2vc3oCx6//L5rl32JAsw2RG27rHWhQnTZ+A==@linaro.org X-Google-Smtp-Source: AGHT+IGTHMOFawODUBvPFpuv6n/naZmPdT96jUYRspEVtVXCleUT40rBZUHO5fokKj2YNXrHln0t X-Received: by 2002:a05:620a:45a8:b0:7a1:d973:ca46 with SMTP id af79cd13be357-7a9a3969fa7mr1327759985a.61.1725972014520; Tue, 10 Sep 2024 05:40:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1725972014; cv=none; d=google.com; s=arc-20240605; b=MTOTxZirwNfg9N284Kr9AMDu276vktwjXoIORDkSVv+7KCJIzpQfOCvdGWae3IaKoU sWT7auoRmV32Me4j4TA2CBQIhkZQMUt64986HwGQfnRUogTPGEL7mOZURnHRJnFwARDu xiOCgTL+bcfNCYIfCqkHUPzw5eL1cpcERrODRAr4n+MOz90kugs8XhG1wnOiPtXgOM20 s+Mru+POKRl2DOH5dQc5UjDlKwnoTc4fgfAfa9PD9ITf0cIjPicybHXLQQPLqeOE4TD/ /YVf52hukXu9XLC9fcVEFyaXsZjg9IuiA1tRhbgCNeXAqBq+1aS/6Ruq5vX++EMkh9M9 9l1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=bMdOD3sPPSy1EnK30Zx5hlrtQNyWnAmBF/Lo0F4+p3A=; fh=tOREyZHlK9Diwyw/7bj5IUyLT4I5EVkj5DE8XDtMiTs=; b=PmQUqoAZQyXzVisnfJzmQlwQd8mzG/B1WSCFrtMV8h7ClwuwP19xq2hYFCxl0HdY4w dEPHlSS0KpxRV3vWbYN8I3dFzEhUvoz4KIsmfzT5VF5N7sJMpMIRYGwRSB8c6Fnkpcos 9u06OdvyHFKoBibMZ2GiU8X1RhZJYpqdz+iTWU2zxNaFvKR2qXxEv8zH4D7vb6cZk92A PUof+i1mZKXDuKHZtsKgQ67GDVzPdeHOxmJZGu2KbCBTnjO0as+u6pLhf7cc5Ow6pV5D D4b5oBHjBdfMHfimvjDhgRrojXnXRwvDO9Y3NGQW3XRdR2WwowsiTkqcjFsay7WWsvgC JAfA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=E3MTa6ql; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7a9a79cec3asi785097585a.99.2024.09.10.05.40.14 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 10 Sep 2024 05:40:14 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=E3MTa6ql; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1so08W-0004bD-No; Tue, 10 Sep 2024 08:38:24 -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 1so08Q-0003aA-2Q for qemu-devel@nongnu.org; Tue, 10 Sep 2024 08:38:19 -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 1so08K-0005BJ-8y for qemu-devel@nongnu.org; Tue, 10 Sep 2024 08:38:17 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1725971886; 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=bMdOD3sPPSy1EnK30Zx5hlrtQNyWnAmBF/Lo0F4+p3A=; b=E3MTa6qlfFLkyRSO3S1kqYIgQXsNddsSy5Pqf9pSrMb1gFPIetFcgOlQ/kKCt8Req09077 3i4gWpR3KU4dBv/VZ6bdxrfSR2/PD1SfG9bBylR0AJPjV72M+fUAZGsbJ+ytZNRT1InrDi GiKmzNr4A2X1TsHBbnmVf29CHomr7tA= Received: from mx-prod-mc-03.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-614-x_4KqeQMMAu9h3iKLDM80Q-1; Tue, 10 Sep 2024 08:38:03 -0400 X-MC-Unique: x_4KqeQMMAu9h3iKLDM80Q-1 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (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-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 52EC41955D44; Tue, 10 Sep 2024 12:38:02 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.39.193.120]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 16E9419560AB; Tue, 10 Sep 2024 12:37:59 +0000 (UTC) From: Thomas Huth To: qemu-devel@nongnu.org Cc: Peter Maydell Subject: [PULL 14/22] tests/functional: Convert mips32eb 4Kc Malta avocado tests Date: Tue, 10 Sep 2024 14:37:15 +0200 Message-ID: <20240910123726.182975-15-thuth@redhat.com> In-Reply-To: <20240910123726.182975-1-thuth@redhat.com> References: <20240910123726.182975-1-thuth@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 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: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.145, 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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Philippe Mathieu-Daudé Straight forward conversion. Update the SHA1 hashes to SHA256 hashes since SHA1 should not be used anymore nowadays. Signed-off-by: Philippe Mathieu-Daudé Message-ID: <20240827094905.80648-8-philmd@linaro.org> [thuth: Use LinuxKernelTest class] Message-ID: <20240906180549.792832-9-thuth@redhat.com> Signed-off-by: Thomas Huth --- MAINTAINERS | 1 + tests/avocado/boot_linux_console.py | 63 ---------------------- tests/functional/meson.build | 4 ++ tests/functional/test_mips_malta.py | 81 +++++++++++++++++++++++++++++ 4 files changed, 86 insertions(+), 63 deletions(-) create mode 100755 tests/functional/test_mips_malta.py diff --git a/MAINTAINERS b/MAINTAINERS index 2f76098230..6e0044ab58 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1370,6 +1370,7 @@ F: hw/mips/malta.c F: hw/pci-host/gt64120.c F: include/hw/southbridge/piix.h F: tests/avocado/linux_ssh_mips_malta.py +F: tests/functional/test_mips_malta.py F: tests/functional/test_mipsel_malta.py F: tests/functional/test_mips64el_malta.py diff --git a/tests/avocado/boot_linux_console.py b/tests/avocado/boot_linux_console.py index 34f4abadd0..e3e4576099 100644 --- a/tests/avocado/boot_linux_console.py +++ b/tests/avocado/boot_linux_console.py @@ -116,69 +116,6 @@ def test_x86_64_pc(self): console_pattern = 'Kernel command line: %s' % kernel_command_line self.wait_for_console_pattern(console_pattern) - def test_mips_malta(self): - """ - :avocado: tags=arch:mips - :avocado: tags=machine:malta - :avocado: tags=endian:big - """ - deb_url = ('http://snapshot.debian.org/archive/debian/' - '20130217T032700Z/pool/main/l/linux-2.6/' - 'linux-image-2.6.32-5-4kc-malta_2.6.32-48_mips.deb') - deb_hash = 'a8cfc28ad8f45f54811fc6cf74fc43ffcfe0ba04' - deb_path = self.fetch_asset(deb_url, asset_hash=deb_hash) - kernel_path = self.extract_from_deb(deb_path, - '/boot/vmlinux-2.6.32-5-4kc-malta') - - self.vm.set_console() - kernel_command_line = self.KERNEL_COMMON_COMMAND_LINE + 'console=ttyS0' - self.vm.add_args('-kernel', kernel_path, - '-append', kernel_command_line) - self.vm.launch() - console_pattern = 'Kernel command line: %s' % kernel_command_line - self.wait_for_console_pattern(console_pattern) - - def test_mips_malta_cpio(self): - """ - :avocado: tags=arch:mips - :avocado: tags=machine:malta - :avocado: tags=endian:big - """ - deb_url = ('http://snapshot.debian.org/archive/debian/' - '20160601T041800Z/pool/main/l/linux/' - 'linux-image-4.5.0-2-4kc-malta_4.5.5-1_mips.deb') - deb_hash = 'a3c84f3e88b54e06107d65a410d1d1e8e0f340f8' - deb_path = self.fetch_asset(deb_url, asset_hash=deb_hash) - kernel_path = self.extract_from_deb(deb_path, - '/boot/vmlinux-4.5.0-2-4kc-malta') - initrd_url = ('https://github.com/groeck/linux-build-test/raw/' - '8584a59ed9e5eb5ee7ca91f6d74bbb06619205b8/rootfs/' - 'mips/rootfs.cpio.gz') - initrd_hash = 'bf806e17009360a866bf537f6de66590de349a99' - initrd_path_gz = self.fetch_asset(initrd_url, asset_hash=initrd_hash) - initrd_path = self.workdir + "rootfs.cpio" - archive.gzip_uncompress(initrd_path_gz, initrd_path) - - self.vm.set_console() - kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE - + 'console=ttyS0 console=tty ' - + 'rdinit=/sbin/init noreboot') - self.vm.add_args('-kernel', kernel_path, - '-initrd', initrd_path, - '-append', kernel_command_line, - '-no-reboot') - self.vm.launch() - self.wait_for_console_pattern('Boot successful.') - - exec_command_and_wait_for_pattern(self, 'cat /proc/cpuinfo', - 'BogoMIPS') - exec_command_and_wait_for_pattern(self, 'uname -a', - 'Debian') - exec_command_and_wait_for_pattern(self, 'reboot', - 'reboot: Restarting system') - # Wait for VM to shut down gracefully - self.vm.wait() - def test_aarch64_xlnx_versal_virt(self): """ :avocado: tags=arch:aarch64 diff --git a/tests/functional/meson.build b/tests/functional/meson.build index daee61ec3c..eb2de2a8fd 100644 --- a/tests/functional/meson.build +++ b/tests/functional/meson.build @@ -69,6 +69,10 @@ tests_microblazeel_system_thorough = [ 'microblazeel_s3adsp1800' ] +tests_mips_system_thorough = [ + 'mips_malta', +] + tests_mipsel_system_thorough = [ 'mipsel_malta', ] diff --git a/tests/functional/test_mips_malta.py b/tests/functional/test_mips_malta.py new file mode 100755 index 0000000000..a012081382 --- /dev/null +++ b/tests/functional/test_mips_malta.py @@ -0,0 +1,81 @@ +#!/usr/bin/env python3 +# +# Functional tests for the little-endian 32-bit MIPS Malta board +# +# Copyright (c) Philippe Mathieu-Daudé +# +# SPDX-License-Identifier: GPL-2.0-or-later + +import os + +from qemu_test import LinuxKernelTest, Asset +from qemu_test import exec_command_and_wait_for_pattern +from qemu_test.utils import gzip_uncompress + + +class MaltaMachineConsole(LinuxKernelTest): + + ASSET_KERNEL_2_63_2 = Asset( + ('http://snapshot.debian.org/archive/debian/' + '20130217T032700Z/pool/main/l/linux-2.6/' + 'linux-image-2.6.32-5-4kc-malta_2.6.32-48_mips.deb'), + '16ca524148afb0626f483163e5edf352bc1ab0e4fc7b9f9d473252762f2c7a43') + + def test_mips_malta(self): + deb_path = self.ASSET_KERNEL_2_63_2.fetch() + kernel_path = self.extract_from_deb(deb_path, + '/boot/vmlinux-2.6.32-5-4kc-malta') + + self.set_machine('malta') + self.vm.set_console() + kernel_command_line = self.KERNEL_COMMON_COMMAND_LINE + 'console=ttyS0' + self.vm.add_args('-kernel', kernel_path, + '-append', kernel_command_line) + self.vm.launch() + console_pattern = 'Kernel command line: %s' % kernel_command_line + self.wait_for_console_pattern(console_pattern) + + ASSET_KERNEL_4_5_0 = Asset( + ('http://snapshot.debian.org/archive/debian/' + '20160601T041800Z/pool/main/l/linux/' + 'linux-image-4.5.0-2-4kc-malta_4.5.5-1_mips.deb'), + '526b17d5889840888b76fc2c36a0ebde182c9b1410a3a1e68203c3b160eb2027') + + ASSET_INITRD = Asset( + ('https://github.com/groeck/linux-build-test/raw/' + '8584a59ed9e5eb5ee7ca91f6d74bbb06619205b8/rootfs/' + 'mips/rootfs.cpio.gz'), + 'dcfe3a7fe3200da3a00d176b95caaa086495eb158f2bff64afc67d7e1eb2cddc') + + def test_mips_malta_cpio(self): + deb_path = self.ASSET_KERNEL_4_5_0.fetch() + kernel_path = self.extract_from_deb(deb_path, + '/boot/vmlinux-4.5.0-2-4kc-malta') + initrd_path_gz = self.ASSET_INITRD.fetch() + initrd_path = os.path.join(self.workdir, 'rootfs.cpio') + gzip_uncompress(initrd_path_gz, initrd_path) + + self.set_machine('malta') + self.vm.set_console() + kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE + + 'console=ttyS0 console=tty ' + + 'rdinit=/sbin/init noreboot') + self.vm.add_args('-kernel', kernel_path, + '-initrd', initrd_path, + '-append', kernel_command_line, + '-no-reboot') + self.vm.launch() + self.wait_for_console_pattern('Boot successful.') + + exec_command_and_wait_for_pattern(self, 'cat /proc/cpuinfo', + 'BogoMIPS') + exec_command_and_wait_for_pattern(self, 'uname -a', + 'Debian') + exec_command_and_wait_for_pattern(self, 'reboot', + 'reboot: Restarting system') + # Wait for VM to shut down gracefully + self.vm.wait() + + +if __name__ == '__main__': + LinuxKernelTest.main() From patchwork Tue Sep 10 12:37:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 826990 Delivered-To: patch@linaro.org Received: by 2002:adf:ab1c:0:b0:367:895a:4699 with SMTP id q28csp280954wrc; Tue, 10 Sep 2024 05:39:23 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWQgGj8MPThhsPLqnxJuXqKsTcndKBMEp4LIFLgMn9S8g/DrAuYe9WDHJggjScLCb+ffMJUHg==@linaro.org X-Google-Smtp-Source: AGHT+IGQJQ3bcGlPDdbgaBaT3cAaKHPocDmtb4Mxh3p6GaKiimX5bcLadPcyQ5Wb2XeSDYUWNdsw X-Received: by 2002:a05:6102:e07:b0:49b:dfaa:c768 with SMTP id ada2fe7eead31-49beccbb931mr8026175137.1.1725971963107; Tue, 10 Sep 2024 05:39:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1725971963; cv=none; d=google.com; s=arc-20240605; b=OnHh3fgaUmip+RCxbbtySYFD0wxza8wYKTQnLUkLOesBPFdzJ1mjEWoMa9Nunwee0E 2M4dQbnqquRkbEXRXc+teCO2y1uh4LZNcb4Mc1UXXBKmUZTDm7itUwG5a/fmyVkJFIVZ D9JGl1PtH99Fv8RVg5JMnxm6B+hBr0d2S/BgZE7ucNY7c7SJ2qDRWLLuOOIE4LagTS0M SUONyWlyfWWyQKCLKXHAQy93O0JW/IW95dC/2Z+bUlZU23AaX0U7T/DRAx44mRrAYOk2 S6vHV/ahK61tiFVSsSK+o8R4nI+kYAME4goQGovUlTA5uYgeeTjM+ctyEbbKH2dwlBAg PEDA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=gYCAB72LIDObuhz/xyvGtFtfuzS2OWK9xytfOq+zwyI=; fh=tOREyZHlK9Diwyw/7bj5IUyLT4I5EVkj5DE8XDtMiTs=; b=O+7AFSEqkmezX02TdSP6GfkBiO3CaWVLTMWVyWoHQ2hrvLGOfbiuRAdWHciq9jRHrL lE3yiLEGhSTj6RTKdsxTgcOoHaNDDoVepxDCLTZ7UzBBxjGKvvoA/nO7PigHBEDEBDyD 7dB6MgOkV0+htX0+1t1ReYemh9BE+jgN9WinPRzx/a1g8mSihyGWct/uHt8ZZ5+pqc08 PbdmorXDZ76mV0t41NC8IdrI/EfVrL/ENC/5e2aHIh7/fYECOr3z1vCSCYzwEZibdIBV RFsL2TV/Pvhg0nYpoXylaQ24dw1suyTjoA8rZlkSIzsUPWxeDUdZLgYCV4PO4x50h0N/ B22w==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=aX1lMYak; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id ada2fe7eead31-49c16e0fcd9si271786137.601.2024.09.10.05.39.22 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 10 Sep 2024 05:39:23 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=aX1lMYak; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1so08V-0004Nz-Hw; Tue, 10 Sep 2024 08:38:24 -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 1so08S-0003ya-Ru for qemu-devel@nongnu.org; Tue, 10 Sep 2024 08:38:21 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1so08K-0005BX-UM for qemu-devel@nongnu.org; Tue, 10 Sep 2024 08:38:20 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1725971888; 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=gYCAB72LIDObuhz/xyvGtFtfuzS2OWK9xytfOq+zwyI=; b=aX1lMYakjX1anN8GouJGUQuRWPljr9A3nObAs4pInPBQ4lIpK4G5VouZblCvhMBCPNELYP UGDCLOWWEpffbBoZ+aVc94fne2nR0tOvBZBMwOql85Es+dKPBMaCA7mn1egBKlgu2+ry14 MdQTONVeLL6dxsJNAs6aXXaXhGGkmL0= Received: from mx-prod-mc-05.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-605-fePW1AxgNJedXonqmtbv8Q-1; Tue, 10 Sep 2024 08:38:05 -0400 X-MC-Unique: fePW1AxgNJedXonqmtbv8Q-1 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (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-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id AB0991956083; Tue, 10 Sep 2024 12:38:04 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.39.193.120]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id E51B219560AD; Tue, 10 Sep 2024 12:38:02 +0000 (UTC) From: Thomas Huth To: qemu-devel@nongnu.org Cc: Peter Maydell Subject: [PULL 15/22] tests/functional: Convert ARM Raspi2 avocado tests Date: Tue, 10 Sep 2024 14:37:16 +0200 Message-ID: <20240910123726.182975-16-thuth@redhat.com> In-Reply-To: <20240910123726.182975-1-thuth@redhat.com> References: <20240910123726.182975-1-thuth@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 Received-SPF: pass client-ip=170.10.129.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.145, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, T_SPF_TEMPERROR=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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Philippe Mathieu-Daudé Straight forward conversion. Update the SHA1 hashes to SHA256 hashes since SHA1 should not be used anymore nowadays. Signed-off-by: Philippe Mathieu-Daudé Message-ID: <20240826221058.75126-3-philmd@linaro.org> [thuth: Use LinuxKernelTest class] Message-ID: <20240906180549.792832-10-thuth@redhat.com> Signed-off-by: Thomas Huth --- MAINTAINERS | 1 + tests/avocado/boot_linux_console.py | 85 -------------------------- tests/functional/meson.build | 1 + tests/functional/test_arm_raspi2.py | 95 +++++++++++++++++++++++++++++ 4 files changed, 97 insertions(+), 85 deletions(-) create mode 100755 tests/functional/test_arm_raspi2.py diff --git a/MAINTAINERS b/MAINTAINERS index 6e0044ab58..3cc9c19d02 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -911,6 +911,7 @@ F: hw/*/bcm283* F: include/hw/arm/rasp* F: include/hw/*/bcm283* F: docs/system/arm/raspi.rst +F: tests/functional/test_arm_raspi2.py Real View M: Peter Maydell diff --git a/tests/avocado/boot_linux_console.py b/tests/avocado/boot_linux_console.py index e3e4576099..827a286429 100644 --- a/tests/avocado/boot_linux_console.py +++ b/tests/avocado/boot_linux_console.py @@ -203,91 +203,6 @@ def test_arm_emcraft_sf2(self): exec_command_and_wait_for_pattern(self, 'ping -c 3 10.0.2.2', '3 packets transmitted, 3 packets received, 0% packet loss') - def do_test_arm_raspi2(self, uart_id): - """ - :avocado: tags=accel:tcg - - The kernel can be rebuilt using the kernel source referenced - and following the instructions on the on: - https://www.raspberrypi.org/documentation/linux/kernel/building.md - """ - serial_kernel_cmdline = { - 0: 'earlycon=pl011,0x3f201000 console=ttyAMA0', - } - deb_url = ('http://archive.raspberrypi.org/debian/' - 'pool/main/r/raspberrypi-firmware/' - 'raspberrypi-kernel_1.20190215-1_armhf.deb') - deb_hash = 'cd284220b32128c5084037553db3c482426f3972' - deb_path = self.fetch_asset(deb_url, asset_hash=deb_hash) - kernel_path = self.extract_from_deb(deb_path, '/boot/kernel7.img') - dtb_path = self.extract_from_deb(deb_path, '/boot/bcm2709-rpi-2-b.dtb') - - self.vm.set_console() - kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE + - serial_kernel_cmdline[uart_id] + - ' root=/dev/mmcblk0p2 rootwait ' + - 'dwc_otg.fiq_fsm_enable=0') - self.vm.add_args('-kernel', kernel_path, - '-dtb', dtb_path, - '-append', kernel_command_line, - '-device', 'usb-kbd') - self.vm.launch() - console_pattern = 'Kernel command line: %s' % kernel_command_line - self.wait_for_console_pattern(console_pattern) - console_pattern = 'Product: QEMU USB Keyboard' - self.wait_for_console_pattern(console_pattern) - - def test_arm_raspi2_uart0(self): - """ - :avocado: tags=arch:arm - :avocado: tags=machine:raspi2b - :avocado: tags=device:pl011 - :avocado: tags=accel:tcg - """ - self.do_test_arm_raspi2(0) - - def test_arm_raspi2_initrd(self): - """ - :avocado: tags=arch:arm - :avocado: tags=machine:raspi2b - """ - deb_url = ('http://archive.raspberrypi.org/debian/' - 'pool/main/r/raspberrypi-firmware/' - 'raspberrypi-kernel_1.20190215-1_armhf.deb') - deb_hash = 'cd284220b32128c5084037553db3c482426f3972' - deb_path = self.fetch_asset(deb_url, asset_hash=deb_hash) - kernel_path = self.extract_from_deb(deb_path, '/boot/kernel7.img') - dtb_path = self.extract_from_deb(deb_path, '/boot/bcm2709-rpi-2-b.dtb') - - initrd_url = ('https://github.com/groeck/linux-build-test/raw/' - '2eb0a73b5d5a28df3170c546ddaaa9757e1e0848/rootfs/' - 'arm/rootfs-armv7a.cpio.gz') - initrd_hash = '604b2e45cdf35045846b8bbfbf2129b1891bdc9c' - initrd_path_gz = self.fetch_asset(initrd_url, asset_hash=initrd_hash) - initrd_path = os.path.join(self.workdir, 'rootfs.cpio') - archive.gzip_uncompress(initrd_path_gz, initrd_path) - - self.vm.set_console() - kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE + - 'earlycon=pl011,0x3f201000 console=ttyAMA0 ' - 'panic=-1 noreboot ' + - 'dwc_otg.fiq_fsm_enable=0') - self.vm.add_args('-kernel', kernel_path, - '-dtb', dtb_path, - '-initrd', initrd_path, - '-append', kernel_command_line, - '-no-reboot') - self.vm.launch() - self.wait_for_console_pattern('Boot successful.') - - exec_command_and_wait_for_pattern(self, 'cat /proc/cpuinfo', - 'BCM2835') - exec_command_and_wait_for_pattern(self, 'cat /proc/iomem', - '/soc/cprman@7e101000') - exec_command_and_wait_for_pattern(self, 'halt', 'reboot: System halted') - # Wait for VM to shut down gracefully - self.vm.wait() - def test_arm_raspi4(self): """ :avocado: tags=arch:aarch64 diff --git a/tests/functional/meson.build b/tests/functional/meson.build index eb2de2a8fd..ff3fe7981e 100644 --- a/tests/functional/meson.build +++ b/tests/functional/meson.build @@ -42,6 +42,7 @@ tests_aarch64_system_thorough = [ tests_arm_system_thorough = [ 'arm_canona1100', 'arm_integratorcp', + 'arm_raspi2', ] tests_arm_linuxuser_thorough = [ diff --git a/tests/functional/test_arm_raspi2.py b/tests/functional/test_arm_raspi2.py new file mode 100755 index 0000000000..3bf079dc4d --- /dev/null +++ b/tests/functional/test_arm_raspi2.py @@ -0,0 +1,95 @@ +#!/usr/bin/env python3 +# +# Functional test that boots a Linux kernel on a Raspberry Pi machine +# and checks the console +# +# Copyright (c) 2019 Philippe Mathieu-Daudé +# +# SPDX-License-Identifier: GPL-2.0-or-later + +import os + +from qemu_test import LinuxKernelTest, Asset +from qemu_test import exec_command_and_wait_for_pattern +from qemu_test.utils import gzip_uncompress + + +class ArmRaspi2Machine(LinuxKernelTest): + + ASSET_KERNEL_20190215 = Asset( + ('http://archive.raspberrypi.org/debian/' + 'pool/main/r/raspberrypi-firmware/' + 'raspberrypi-kernel_1.20190215-1_armhf.deb'), + '9f1759f7228113da24f5ee2aa6312946ec09a83e076aba9406c46ff776dfb291') + + ASSET_INITRD = Asset( + ('https://github.com/groeck/linux-build-test/raw/' + '2eb0a73b5d5a28df3170c546ddaaa9757e1e0848/rootfs/' + 'arm/rootfs-armv7a.cpio.gz'), + '2c8dbdb16ea7af2dfbcbea96044dde639fb07d09fd3c4fb31f2027ef71e55ddd') + + def do_test_arm_raspi2(self, uart_id): + """ + The kernel can be rebuilt using the kernel source referenced + and following the instructions on the on: + https://www.raspberrypi.org/documentation/linux/kernel/building.md + """ + serial_kernel_cmdline = { + 0: 'earlycon=pl011,0x3f201000 console=ttyAMA0', + } + deb_path = self.ASSET_KERNEL_20190215.fetch() + kernel_path = self.extract_from_deb(deb_path, '/boot/kernel7.img') + dtb_path = self.extract_from_deb(deb_path, '/boot/bcm2709-rpi-2-b.dtb') + + self.set_machine('raspi2b') + self.vm.set_console() + kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE + + serial_kernel_cmdline[uart_id] + + ' root=/dev/mmcblk0p2 rootwait ' + + 'dwc_otg.fiq_fsm_enable=0') + self.vm.add_args('-kernel', kernel_path, + '-dtb', dtb_path, + '-append', kernel_command_line, + '-device', 'usb-kbd') + self.vm.launch() + + console_pattern = 'Kernel command line: %s' % kernel_command_line + self.wait_for_console_pattern(console_pattern) + self.wait_for_console_pattern('Product: QEMU USB Keyboard') + + def test_arm_raspi2_uart0(self): + self.do_test_arm_raspi2(0) + + def test_arm_raspi2_initrd(self): + deb_path = self.ASSET_KERNEL_20190215.fetch() + kernel_path = self.extract_from_deb(deb_path, '/boot/kernel7.img') + dtb_path = self.extract_from_deb(deb_path, '/boot/bcm2709-rpi-2-b.dtb') + initrd_path_gz = self.ASSET_INITRD.fetch() + initrd_path = os.path.join(self.workdir, 'rootfs.cpio') + gzip_uncompress(initrd_path_gz, initrd_path) + + self.set_machine('raspi2b') + self.vm.set_console() + kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE + + 'earlycon=pl011,0x3f201000 console=ttyAMA0 ' + 'panic=-1 noreboot ' + + 'dwc_otg.fiq_fsm_enable=0') + self.vm.add_args('-kernel', kernel_path, + '-dtb', dtb_path, + '-initrd', initrd_path, + '-append', kernel_command_line, + '-no-reboot') + self.vm.launch() + self.wait_for_console_pattern('Boot successful.') + + exec_command_and_wait_for_pattern(self, 'cat /proc/cpuinfo', + 'BCM2835') + exec_command_and_wait_for_pattern(self, 'cat /proc/iomem', + '/soc/cprman@7e101000') + exec_command_and_wait_for_pattern(self, 'halt', 'reboot: System halted') + # Wait for VM to shut down gracefully + self.vm.wait() + + +if __name__ == '__main__': + LinuxKernelTest.main() From patchwork Tue Sep 10 12:37:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 826996 Delivered-To: patch@linaro.org Received: by 2002:adf:ab1c:0:b0:367:895a:4699 with SMTP id q28csp281812wrc; Tue, 10 Sep 2024 05:41:41 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWlKg79LJYhbOxEcxkmLLKGIV5zx6JpUhVuyuiU+YehFNcNXluPi1cyRcZnMmiAYQ0p81Ml2g==@linaro.org X-Google-Smtp-Source: AGHT+IHjWskekQb8MAIh+5wykH9oQg8teAXxgspDbnOT7B2Kl7EFgCfyuptkeEMlWdlHqP+SRJEp X-Received: by 2002:a05:6214:5983:b0:6c1:6a57:e7ee with SMTP id 6a1803df08f44-6c5282fdd17mr218365776d6.16.1725972100682; Tue, 10 Sep 2024 05:41:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1725972100; cv=none; d=google.com; s=arc-20240605; b=ZZITC77GcA19oD+9ENBv5ZSer2MgDHlWxM6VNClOQ64NtF5MZ9PuoZkAgISc6fEt2I B1e3+WxNcJvcRZcT06OOm7CRDEExPr6FLn3eroV0Ff6oXuLjdV9VNnyckpOJzc49vfsf cVVNgFrihjTGTqNiLdtIk4UVK7v9FuCt1RNkqvEwEOXwCYfLXttOQG6PPh5py5pdgJzz 3hkjLqd+oLyeNtLyWsB5ng/QZOom5Vy0T6n5BAsWU7+zRJaLSrev4mIRTtAp0kT13WOZ IxT51l8RiyAXXPhTrc0cIgUODPwBCDWsH3RCzh8GF5xIx9heWQ/x0zke88/QcVmaHcqh P7Fg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=SwPTIzHpUeoFawqSwrNeTP5ILEUDpSh3nsV9yz+gTEc=; fh=tOREyZHlK9Diwyw/7bj5IUyLT4I5EVkj5DE8XDtMiTs=; b=OK11fLBVCNBRBGWcX7J0tjtUjHKuTRXYSygOKUfMRe0T1ru9f0iip+5XDete0a9VFn 84WtoUw3/kB3WDqEF6Vny5fq7GrX/+eWY7VdfuhuN+1McoufL7ykSUlD0Uw3UgIbHW+w Di0Fu77xO1pi0CWRDnTlMhgN5mQS1tmvzb1aTRAgOC/LQOinzBkuXbS+jteauUA+koYJ 1Y/hkFvQg+LInekVgwPRoKaeu/1AupeR6SJcgcDTU2ry6d7PfWGy9p1A/t+m8VLxYufh q8TrpsdznjpXVMdAak/JQmvguw9+X8w2gR/c2PwXiq0DkNt+hQKhf/9dPU7cWPdhazQE TEpw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=IZipdZE4; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 6a1803df08f44-6c53433d8f6si75845486d6.138.2024.09.10.05.41.40 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 10 Sep 2024 05:41:40 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=IZipdZE4; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1so08X-0004oW-PJ; Tue, 10 Sep 2024 08:38:25 -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 1so08T-00048j-Ol for qemu-devel@nongnu.org; Tue, 10 Sep 2024 08:38:21 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1so08L-0005Br-SA for qemu-devel@nongnu.org; Tue, 10 Sep 2024 08:38:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1725971891; 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=SwPTIzHpUeoFawqSwrNeTP5ILEUDpSh3nsV9yz+gTEc=; b=IZipdZE4S5tdnS9Dh9fz6P/iLX1YjyR2FzniZJlLdZavYStq9ZmobJgCHCddhpGJM2BdYE R26VALM/1wz/CButXcL69La0S3NvUFPqVqGx9irDLXKJOBMhgC7wdSa77aIhw/s+qQg/PL LlvD3zcG9LCQvqsGdA5GchB0eYRJfhs= 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-119-efpwD4y9MfiHJyMqozripg-1; Tue, 10 Sep 2024 08:38:08 -0400 X-MC-Unique: efpwD4y9MfiHJyMqozripg-1 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (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 429B01955D62; Tue, 10 Sep 2024 12:38:07 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.39.193.120]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 66C3019560B0; Tue, 10 Sep 2024 12:38:04 +0000 (UTC) From: Thomas Huth To: qemu-devel@nongnu.org Cc: Peter Maydell Subject: [PULL 16/22] tests/functional: Convert Aarch64 Raspi3 avocado tests Date: Tue, 10 Sep 2024 14:37:17 +0200 Message-ID: <20240910123726.182975-17-thuth@redhat.com> In-Reply-To: <20240910123726.182975-1-thuth@redhat.com> References: <20240910123726.182975-1-thuth@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 Received-SPF: pass client-ip=170.10.129.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.145, 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_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Philippe Mathieu-Daudé Straight forward conversion. Update the SHA1 hashes to SHA256 hashes since SHA1 should not be used anymore nowadays. Signed-off-by: Philippe Mathieu-Daudé Message-ID: <20240826221058.75126-4-philmd@linaro.org> [thuth: Use the LinuxKernelTest class] Message-ID: <20240906180549.792832-11-thuth@redhat.com> Signed-off-by: Thomas Huth --- MAINTAINERS | 1 + tests/avocado/boot_linux_console.py | 23 -------------- tests/functional/meson.build | 1 + tests/functional/test_aarch64_raspi3.py | 41 +++++++++++++++++++++++++ 4 files changed, 43 insertions(+), 23 deletions(-) create mode 100755 tests/functional/test_aarch64_raspi3.py diff --git a/MAINTAINERS b/MAINTAINERS index 3cc9c19d02..828c469478 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -912,6 +912,7 @@ F: include/hw/arm/rasp* F: include/hw/*/bcm283* F: docs/system/arm/raspi.rst F: tests/functional/test_arm_raspi2.py +F: tests/functional/test_aarch64_raspi3.py Real View M: Peter Maydell diff --git a/tests/avocado/boot_linux_console.py b/tests/avocado/boot_linux_console.py index 827a286429..e4caf34379 100644 --- a/tests/avocado/boot_linux_console.py +++ b/tests/avocado/boot_linux_console.py @@ -979,29 +979,6 @@ def test_arm_orangepi_uboot_netbsd9(self): # Wait for user-space wait_for_console_pattern(self, 'Starting root file system check') - def test_aarch64_raspi3_atf(self): - """ - :avocado: tags=accel:tcg - :avocado: tags=arch:aarch64 - :avocado: tags=machine:raspi3b - :avocado: tags=cpu:cortex-a53 - :avocado: tags=device:pl011 - :avocado: tags=atf - """ - zip_url = ('https://github.com/pbatard/RPi3/releases/download/' - 'v1.15/RPi3_UEFI_Firmware_v1.15.zip') - zip_hash = '74b3bd0de92683cadb14e008a7575e1d0c3cafb9' - zip_path = self.fetch_asset(zip_url, asset_hash=zip_hash) - - archive.extract(zip_path, self.workdir) - efi_fd = os.path.join(self.workdir, 'RPI_EFI.fd') - - self.vm.set_console(console_index=1) - self.vm.add_args('-nodefaults', - '-device', 'loader,file=%s,force-raw=true' % efi_fd) - self.vm.launch() - self.wait_for_console_pattern('version UEFI Firmware v1.15') - def test_alpha_clipper(self): """ :avocado: tags=arch:alpha diff --git a/tests/functional/meson.build b/tests/functional/meson.build index ff3fe7981e..35eebbe9b9 100644 --- a/tests/functional/meson.build +++ b/tests/functional/meson.build @@ -35,6 +35,7 @@ tests_generic_bsduser = [ ] tests_aarch64_system_thorough = [ + 'aarch64_raspi3', 'aarch64_sbsaref', 'aarch64_virt', ] diff --git a/tests/functional/test_aarch64_raspi3.py b/tests/functional/test_aarch64_raspi3.py new file mode 100755 index 0000000000..369f95a3d9 --- /dev/null +++ b/tests/functional/test_aarch64_raspi3.py @@ -0,0 +1,41 @@ +#!/usr/bin/env python3 +# +# Functional test that boots a Linux kernel on a Raspberry Pi machine +# and checks the console +# +# Copyright (c) 2020 Philippe Mathieu-Daudé +# +# SPDX-License-Identifier: GPL-2.0-or-later + +import os +from zipfile import ZipFile + +from qemu_test import LinuxKernelTest, Asset + + +class Aarch64Raspi3Machine(LinuxKernelTest): + + ASSET_RPI3_UEFI = Asset( + ('https://github.com/pbatard/RPi3/releases/download/' + 'v1.15/RPi3_UEFI_Firmware_v1.15.zip'), + '8cff2e979560048b4c84921f41a91893240b9fb71a88f0b5c5d6c8edd994bd5b') + + def test_aarch64_raspi3_atf(self): + efi_name = 'RPI_EFI.fd' + zip_path = self.ASSET_RPI3_UEFI.fetch() + + with ZipFile(zip_path, 'r') as zf: + zf.extract(efi_name, path=self.workdir) + efi_fd = os.path.join(self.workdir, efi_name) + + self.set_machine('raspi3b') + self.vm.set_console(console_index=1) + self.vm.add_args('-cpu', 'cortex-a53', + '-nodefaults', + '-device', f'loader,file={efi_fd},force-raw=true') + self.vm.launch() + self.wait_for_console_pattern('version UEFI Firmware v1.15') + + +if __name__ == '__main__': + LinuxKernelTest.main() From patchwork Tue Sep 10 12:37:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 826993 Delivered-To: patch@linaro.org Received: by 2002:adf:ab1c:0:b0:367:895a:4699 with SMTP id q28csp281131wrc; Tue, 10 Sep 2024 05:39:51 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXrg0vjzus+zqe62DCiMih86lL6sX5saFsiuIU1ZSR/9TM245je53n91kL6FlMv4gh+vIYHkA==@linaro.org X-Google-Smtp-Source: AGHT+IGjRtd25yMZpvaiSR2FrgvVjhUc9n8LNICs+oa6Sszy2uiCyxld2zbh1tmLdRAZVI/Ixlzg X-Received: by 2002:a05:620a:2548:b0:7a1:df6f:4374 with SMTP id af79cd13be357-7a9973325eamr2350371185a.16.1725971990935; Tue, 10 Sep 2024 05:39:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1725971990; cv=none; d=google.com; s=arc-20240605; b=Pn6EwmoI+TKcUqk9t53NE7g7AWrYL2F/QgGGjIpuCDpbAY3Iyz7fZitIOEtuKq11e3 BMoCFlX+g/dK1cdnXQd0g/wjQ+Bzymz76XYOwhaqQweGaiZIxGFh4/nSSKBMIUSqDzHE Gjuq9Xpw1fTvSVSHciOqgkIDnmhfyd6NIFabnu/aTiDoc0Ye+yqchP6tPM8H+d537swo odz9ZAWllwkM8+QWDjBkIrXVVP5Wzde9ySmR8c/MZl/RILRr1jbjXqYmw4bXYxwZZuZc WMB+Z8MS+CB3xp83if1zJ/ws2kvjmEOcqhkR4DQYx33qNRpDr1RtH3TQ5eIiL80S+JXM kELA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=LVaaTJLyg1RTdI2f1wGKW2XRJiJ9kTbEGsOe2P0JmTg=; fh=tOREyZHlK9Diwyw/7bj5IUyLT4I5EVkj5DE8XDtMiTs=; b=F/warATFeXxRf42IQCJu3PNXVpXbNPqsbcDeZi4iGUH/1JBnIp8Ud4oKJyM9Sqaesn PXcllxoOMSEf4mRaL1F7xqOM69Vpf8jlWvHBkNPOEzpLKV6aoIvPy7sEVKCgboBZyr0E qic+hsYlma8FafjrK4D2H5iskyrBCyttGLC/Amrpu96dNRgDq2BV8DrGECErr07UlvN3 6INfwhyK0Wo0KcF60H2wRJj4UXmb91oPK91rA7LzFBYmnyxSrt1I/SJh4SiIT1J9BIg0 VdnJwJowIB1O5e0Xny8bay8WziT1oN84hsfL9Plr9wyXJxMkORTtqpp34T92btHZOCXo KO+g==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=XvzRfRGF; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7a9a79c6aa2si793560185a.88.2024.09.10.05.39.50 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 10 Sep 2024 05:39:50 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=XvzRfRGF; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1so08a-00050O-23; Tue, 10 Sep 2024 08:38:29 -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 1so08W-0004XP-0g for qemu-devel@nongnu.org; Tue, 10 Sep 2024 08:38:24 -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 1so08N-0005Bv-Ne for qemu-devel@nongnu.org; Tue, 10 Sep 2024 08:38:23 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1725971891; 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=LVaaTJLyg1RTdI2f1wGKW2XRJiJ9kTbEGsOe2P0JmTg=; b=XvzRfRGF5oOqVhLIhWkLpvHLb17nbeKRaJCZ5p8u7/Ob0h+uMrLUDyKgKASzknedEdjGZ/ ntFWEZjlPtoGlJxXnIxK1MJBlNzJTG+cBtQVIsw6EWjpTxNIc/X5QbfZu016dahacCZugU YQS+DrNakz9R9t1RmP1sH15NVw7XdB4= 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-508-iZPSThNEPEe1-aIs8CG02w-1; Tue, 10 Sep 2024 08:38:10 -0400 X-MC-Unique: iZPSThNEPEe1-aIs8CG02w-1 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (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 56BBB1954233; Tue, 10 Sep 2024 12:38:09 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.39.193.120]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id C474B19560AB; Tue, 10 Sep 2024 12:38:07 +0000 (UTC) From: Thomas Huth To: qemu-devel@nongnu.org Cc: Peter Maydell Subject: [PULL 17/22] tests/functional: Convert Aarch64 Raspi4 avocado tests Date: Tue, 10 Sep 2024 14:37:18 +0200 Message-ID: <20240910123726.182975-18-thuth@redhat.com> In-Reply-To: <20240910123726.182975-1-thuth@redhat.com> References: <20240910123726.182975-1-thuth@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 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: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.145, 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, SPF_HELO_NONE=0.001, T_SPF_TEMPERROR=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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Philippe Mathieu-Daudé Straight forward conversion. Update the SHA1 hashes to SHA256 hashes since SHA1 should not be used anymore nowadays. Signed-off-by: Philippe Mathieu-Daudé Message-ID: <20240826221058.75126-5-philmd@linaro.org> [thuth: Use LinuxKernelTest class] Message-ID: <20240906180549.792832-12-thuth@redhat.com> Signed-off-by: Thomas Huth --- MAINTAINERS | 1 + tests/avocado/boot_linux_console.py | 97 ------------------------ tests/functional/meson.build | 1 + tests/functional/test_aarch64_raspi4.py | 99 +++++++++++++++++++++++++ 4 files changed, 101 insertions(+), 97 deletions(-) create mode 100755 tests/functional/test_aarch64_raspi4.py diff --git a/MAINTAINERS b/MAINTAINERS index 828c469478..c59f7b2538 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -913,6 +913,7 @@ F: include/hw/*/bcm283* F: docs/system/arm/raspi.rst F: tests/functional/test_arm_raspi2.py F: tests/functional/test_aarch64_raspi3.py +F: tests/functional/test_aarch64_raspi4.py Real View M: Peter Maydell diff --git a/tests/avocado/boot_linux_console.py b/tests/avocado/boot_linux_console.py index e4caf34379..a8eac44d9f 100644 --- a/tests/avocado/boot_linux_console.py +++ b/tests/avocado/boot_linux_console.py @@ -203,103 +203,6 @@ def test_arm_emcraft_sf2(self): exec_command_and_wait_for_pattern(self, 'ping -c 3 10.0.2.2', '3 packets transmitted, 3 packets received, 0% packet loss') - def test_arm_raspi4(self): - """ - :avocado: tags=arch:aarch64 - :avocado: tags=machine:raspi4b - :avocado: tags=device:pl011 - :avocado: tags=accel:tcg - :avocado: tags=rpi4b - - The kernel can be rebuilt using the kernel source referenced - and following the instructions on the on: - https://www.raspberrypi.org/documentation/linux/kernel/building.md - """ - - deb_url = ('http://archive.raspberrypi.org/debian/' - 'pool/main/r/raspberrypi-firmware/' - 'raspberrypi-kernel_1.20230106-1_arm64.deb') - deb_hash = '08dc55696535b18a6d4fe6fa10d4c0d905cbb2ed' - deb_path = self.fetch_asset(deb_url, asset_hash=deb_hash) - kernel_path = self.extract_from_deb(deb_path, '/boot/kernel8.img') - dtb_path = self.extract_from_deb(deb_path, '/boot/bcm2711-rpi-4-b.dtb') - - self.vm.set_console() - kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE + - 'earlycon=pl011,mmio32,0xfe201000 ' + - 'console=ttyAMA0,115200 ' + - 'root=/dev/mmcblk1p2 rootwait ' + - 'dwc_otg.fiq_fsm_enable=0') - self.vm.add_args('-kernel', kernel_path, - '-dtb', dtb_path, - '-append', kernel_command_line) - # When PCI is supported we can add a USB controller: - # '-device', 'qemu-xhci,bus=pcie.1,id=xhci', - # '-device', 'usb-kbd,bus=xhci.0', - self.vm.launch() - console_pattern = 'Kernel command line: %s' % kernel_command_line - self.wait_for_console_pattern(console_pattern) - # When USB is enabled we can look for this - # console_pattern = 'Product: QEMU USB Keyboard' - # self.wait_for_console_pattern(console_pattern) - console_pattern = 'Waiting for root device' - self.wait_for_console_pattern(console_pattern) - - - def test_arm_raspi4_initrd(self): - """ - :avocado: tags=arch:aarch64 - :avocado: tags=machine:raspi4b - :avocado: tags=device:pl011 - :avocado: tags=accel:tcg - :avocado: tags=rpi4b - - The kernel can be rebuilt using the kernel source referenced - and following the instructions on the on: - https://www.raspberrypi.org/documentation/linux/kernel/building.md - """ - deb_url = ('http://archive.raspberrypi.org/debian/' - 'pool/main/r/raspberrypi-firmware/' - 'raspberrypi-kernel_1.20230106-1_arm64.deb') - deb_hash = '08dc55696535b18a6d4fe6fa10d4c0d905cbb2ed' - deb_path = self.fetch_asset(deb_url, asset_hash=deb_hash) - kernel_path = self.extract_from_deb(deb_path, '/boot/kernel8.img') - dtb_path = self.extract_from_deb(deb_path, '/boot/bcm2711-rpi-4-b.dtb') - - initrd_url = ('https://github.com/groeck/linux-build-test/raw/' - '86b2be1384d41c8c388e63078a847f1e1c4cb1de/rootfs/' - 'arm64/rootfs.cpio.gz') - initrd_hash = 'f3d4f9fa92a49aa542f1b44d34be77bbf8ca5b9d' - initrd_path_gz = self.fetch_asset(initrd_url, asset_hash=initrd_hash) - initrd_path = os.path.join(self.workdir, 'rootfs.cpio') - archive.gzip_uncompress(initrd_path_gz, initrd_path) - - self.vm.set_console() - kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE + - 'earlycon=pl011,mmio32,0xfe201000 ' + - 'console=ttyAMA0,115200 ' + - 'panic=-1 noreboot ' + - 'dwc_otg.fiq_fsm_enable=0') - self.vm.add_args('-kernel', kernel_path, - '-dtb', dtb_path, - '-initrd', initrd_path, - '-append', kernel_command_line, - '-no-reboot') - # When PCI is supported we can add a USB controller: - # '-device', 'qemu-xhci,bus=pcie.1,id=xhci', - # '-device', 'usb-kbd,bus=xhci.0', - self.vm.launch() - self.wait_for_console_pattern('Boot successful.') - - exec_command_and_wait_for_pattern(self, 'cat /proc/cpuinfo', - 'BCM2835') - exec_command_and_wait_for_pattern(self, 'cat /proc/iomem', - 'cprman@7e101000') - exec_command_and_wait_for_pattern(self, 'halt', 'reboot: System halted') - # TODO: Raspberry Pi4 doesn't shut down properly with recent kernels - # Wait for VM to shut down gracefully - #self.vm.wait() - def test_arm_exynos4210_initrd(self): """ :avocado: tags=arch:arm diff --git a/tests/functional/meson.build b/tests/functional/meson.build index 35eebbe9b9..a79083b0f9 100644 --- a/tests/functional/meson.build +++ b/tests/functional/meson.build @@ -36,6 +36,7 @@ tests_generic_bsduser = [ tests_aarch64_system_thorough = [ 'aarch64_raspi3', + 'aarch64_raspi4', 'aarch64_sbsaref', 'aarch64_virt', ] diff --git a/tests/functional/test_aarch64_raspi4.py b/tests/functional/test_aarch64_raspi4.py new file mode 100755 index 0000000000..e5c9f77479 --- /dev/null +++ b/tests/functional/test_aarch64_raspi4.py @@ -0,0 +1,99 @@ +#!/usr/bin/env python3 +# +# Functional test that boots a Linux kernel on a Raspberry Pi machine +# and checks the console +# +# SPDX-License-Identifier: GPL-2.0-or-later + +import os + +from qemu_test import LinuxKernelTest, Asset +from qemu_test import exec_command_and_wait_for_pattern +from qemu_test.utils import gzip_uncompress + + +class Aarch64Raspi4Machine(LinuxKernelTest): + + """ + The kernel can be rebuilt using the kernel source referenced + and following the instructions on the on: + https://www.raspberrypi.org/documentation/linux/kernel/building.md + """ + ASSET_KERNEL_20190215 = Asset( + ('http://archive.raspberrypi.org/debian/' + 'pool/main/r/raspberrypi-firmware/' + 'raspberrypi-kernel_1.20230106-1_arm64.deb'), + '56d5713c8f6eee8a0d3f0e73600ec11391144fef318b08943e9abd94c0a9baf7') + + ASSET_INITRD = Asset( + ('https://github.com/groeck/linux-build-test/raw/' + '86b2be1384d41c8c388e63078a847f1e1c4cb1de/rootfs/' + 'arm64/rootfs.cpio.gz'), + '7c0b16d1853772f6f4c3ca63e789b3b9ff4936efac9c8a01fb0c98c05c7a7648') + + def test_arm_raspi4(self): + deb_path = self.ASSET_KERNEL_20190215.fetch() + kernel_path = self.extract_from_deb(deb_path, '/boot/kernel8.img') + dtb_path = self.extract_from_deb(deb_path, '/boot/bcm2711-rpi-4-b.dtb') + + self.set_machine('raspi4b') + self.vm.set_console() + kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE + + 'earlycon=pl011,mmio32,0xfe201000 ' + + 'console=ttyAMA0,115200 ' + + 'root=/dev/mmcblk1p2 rootwait ' + + 'dwc_otg.fiq_fsm_enable=0') + self.vm.add_args('-kernel', kernel_path, + '-dtb', dtb_path, + '-append', kernel_command_line) + # When PCI is supported we can add a USB controller: + # '-device', 'qemu-xhci,bus=pcie.1,id=xhci', + # '-device', 'usb-kbd,bus=xhci.0', + self.vm.launch() + console_pattern = 'Kernel command line: %s' % kernel_command_line + self.wait_for_console_pattern(console_pattern) + # When USB is enabled we can look for this + # console_pattern = 'Product: QEMU USB Keyboard' + # self.wait_for_console_pattern(console_pattern) + console_pattern = 'Waiting for root device' + self.wait_for_console_pattern(console_pattern) + + + def test_arm_raspi4_initrd(self): + deb_path = self.ASSET_KERNEL_20190215.fetch() + kernel_path = self.extract_from_deb(deb_path, '/boot/kernel8.img') + dtb_path = self.extract_from_deb(deb_path, '/boot/bcm2711-rpi-4-b.dtb') + initrd_path_gz = self.ASSET_INITRD.fetch() + initrd_path = os.path.join(self.workdir, 'rootfs.cpio') + gzip_uncompress(initrd_path_gz, initrd_path) + + self.set_machine('raspi4b') + self.vm.set_console() + kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE + + 'earlycon=pl011,mmio32,0xfe201000 ' + + 'console=ttyAMA0,115200 ' + + 'panic=-1 noreboot ' + + 'dwc_otg.fiq_fsm_enable=0') + self.vm.add_args('-kernel', kernel_path, + '-dtb', dtb_path, + '-initrd', initrd_path, + '-append', kernel_command_line, + '-no-reboot') + # When PCI is supported we can add a USB controller: + # '-device', 'qemu-xhci,bus=pcie.1,id=xhci', + # '-device', 'usb-kbd,bus=xhci.0', + self.vm.launch() + self.wait_for_console_pattern('Boot successful.') + + exec_command_and_wait_for_pattern(self, 'cat /proc/cpuinfo', + 'BCM2835') + exec_command_and_wait_for_pattern(self, 'cat /proc/iomem', + 'cprman@7e101000') + exec_command_and_wait_for_pattern(self, 'halt', 'reboot: System halted') + # TODO: Raspberry Pi4 doesn't shut down properly with recent kernels + # Wait for VM to shut down gracefully + #self.vm.wait() + + +if __name__ == '__main__': + LinuxKernelTest.main()