From patchwork Mon Sep 28 17:49:48 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 11804407 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 97CF1618 for ; Mon, 28 Sep 2020 17:50:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 717042083B for ; Mon, 28 Sep 2020 17:50:15 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="F0WFuG4s" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726566AbgI1RuO (ORCPT ); Mon, 28 Sep 2020 13:50:14 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:45087 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726548AbgI1RuN (ORCPT ); Mon, 28 Sep 2020 13:50:13 -0400 Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1601315413; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:in-reply-to:in-reply-to:references:references; bh=DOZfFRPVyC+pOeVZsy5QetzWnL2NYBRY8w0e8CElX6k=; b=F0WFuG4so93hQd+QyF71UN/yAioBSekyrHXHok0er5sQXPwVFZepQlR8CcOQBwyTPnAKya 6Q5ikEogYKVThyCQ+i1BkSd7YjsLG2xNrK3UCJWSx3GfifuPeeOu7kbW7YTatiS8SY3jTG 0TP4GXwE66SrLhFO52ImRpmCQSPqGeM= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-128-VqaATA2QMX67L2vkEzNuzw-1; Mon, 28 Sep 2020 13:50:08 -0400 X-MC-Unique: VqaATA2QMX67L2vkEzNuzw-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C27CF801AB1; Mon, 28 Sep 2020 17:50:04 +0000 (UTC) Received: from thuth.com (unknown [10.40.192.131]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8576510013C0; Mon, 28 Sep 2020 17:50:03 +0000 (UTC) From: Thomas Huth To: kvm@vger.kernel.org, Paolo Bonzini Cc: Janosch Frank Subject: [kvm-unit-tests PULL 01/11] runtime.bash: remove outdated comment Date: Mon, 28 Sep 2020 19:49:48 +0200 Message-Id: <20200928174958.26690-2-thuth@redhat.com> In-Reply-To: <20200928174958.26690-1-thuth@redhat.com> References: <20200928174958.26690-1-thuth@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org From: Marc Hartmayer Since commit 6e1d3752d7ca ("tap13: list testcases individually") the comment is no longer valid. Therefore let's remove it. Reviewed-by: Andrew Jones Reviewed-by: Cornelia Huck Signed-off-by: Marc Hartmayer Message-Id: <20200825102036.17232-2-mhartmay@linux.ibm.com> Reviewed-by: Thomas Huth Signed-off-by: Thomas Huth --- scripts/runtime.bash | 3 --- 1 file changed, 3 deletions(-) diff --git a/scripts/runtime.bash b/scripts/runtime.bash index c88e246..caa4c5b 100644 --- a/scripts/runtime.bash +++ b/scripts/runtime.bash @@ -53,9 +53,6 @@ skip_nodefault() function print_result() { - # output test results in a TAP format - # https://testanything.org/tap-version-13-specification.html - local status="$1" local testname="$2" local summary="$3" From patchwork Mon Sep 28 17:49:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 11804403 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1C2D16CA for ; Mon, 28 Sep 2020 17:50:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id F265E2100A for ; Mon, 28 Sep 2020 17:50:12 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="K7B1rTkm" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726513AbgI1RuM (ORCPT ); Mon, 28 Sep 2020 13:50:12 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:50278 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726310AbgI1RuL (ORCPT ); Mon, 28 Sep 2020 13:50:11 -0400 Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1601315410; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:in-reply-to:in-reply-to:references:references; bh=bPuzcrXA+QedfFcsSU+I+K2bCWBlmWFD4+SCNXa3vrc=; b=K7B1rTkmbOORZ3XjF32POSz6av3Ti5XKrQMrJR4OsIrd9KfKkJ1V6pd6XAUaxbwtIsgZbh v+a1MFPCslI6Xrt1viLsTk4XnMN855p2G24RiDqY6WqhMb2weHAsD3Gy9Y7JVyD5dt3QC+ ksvO3FLnZNa8Wzcmsnw3FMDyqMAmHNE= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-223-Fsv7P-UkP0ShJtDEzwRn2Q-1; Mon, 28 Sep 2020 13:50:07 -0400 X-MC-Unique: Fsv7P-UkP0ShJtDEzwRn2Q-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B257D801AE3; Mon, 28 Sep 2020 17:50:06 +0000 (UTC) Received: from thuth.com (unknown [10.40.192.131]) by smtp.corp.redhat.com (Postfix) with ESMTP id 46742100238C; Mon, 28 Sep 2020 17:50:04 +0000 (UTC) From: Thomas Huth To: kvm@vger.kernel.org, Paolo Bonzini Cc: Janosch Frank Subject: [kvm-unit-tests PULL 02/11] Use same test names in the default and the TAP13 output format Date: Mon, 28 Sep 2020 19:49:49 +0200 Message-Id: <20200928174958.26690-3-thuth@redhat.com> In-Reply-To: <20200928174958.26690-1-thuth@redhat.com> References: <20200928174958.26690-1-thuth@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org From: Marc Hartmayer Use the same test names in the TAP13 output as in the default output format. This makes the output more consistent. To achieve this, we need to pass the test name as an argument to the function `process_test_output`. Before this change: $ ./run_tests.sh PASS selftest-setup (14 tests) ... vs. $ ./run_tests.sh -t TAP version 13 ok 1 - selftest: true ok 2 - selftest: argc == 3 ... After this change: $ ./run_tests.sh PASS selftest-setup (14 tests) ... vs. $ ./run_tests.sh -t TAP version 13 ok 1 - selftest-setup: selftest: true ok 2 - selftest-setup: selftest: argc == 3 ... While at it, introduce a local variable `kernel` in `RUNTIME_log_stdout` since this makes the function easier to read. Signed-off-by: Marc Hartmayer Message-Id: <20200825102036.17232-3-mhartmay@linux.ibm.com> Reviewed-by: Cornelia Huck Reviewed-by: Thomas Huth Signed-off-by: Thomas Huth --- run_tests.sh | 15 +++++++++------ scripts/runtime.bash | 6 +++--- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/run_tests.sh b/run_tests.sh index fc4b3c2..d7cad9b 100755 --- a/run_tests.sh +++ b/run_tests.sh @@ -88,18 +88,19 @@ if [[ $tap_output == "no" ]]; then postprocess_suite_output() { cat; } else process_test_output() { + local testname="$1" CR=$'\r' while read -r line; do line="${line%$CR}" case "${line:0:4}" in PASS) - echo "ok TEST_NUMBER - ${line#??????}" >&3 + echo "ok TEST_NUMBER - ${testname}: ${line#??????}" >&3 ;; FAIL) - echo "not ok TEST_NUMBER - ${line#??????}" >&3 + echo "not ok TEST_NUMBER - ${testname}: ${line#??????}" >&3 ;; SKIP) - echo "ok TEST_NUMBER - ${line#??????} # skip" >&3 + echo "ok TEST_NUMBER - ${testname}: ${line#??????} # skip" >&3 ;; *) ;; @@ -121,12 +122,14 @@ else } fi -RUNTIME_log_stderr () { process_test_output; } +RUNTIME_log_stderr () { process_test_output "$1"; } RUNTIME_log_stdout () { + local testname="$1" if [ "$PRETTY_PRINT_STACKS" = "yes" ]; then - ./scripts/pretty_print_stacks.py $1 | process_test_output + local kernel="$2" + ./scripts/pretty_print_stacks.py "$kernel" | process_test_output "$testname" else - process_test_output + process_test_output "$testname" fi } diff --git a/scripts/runtime.bash b/scripts/runtime.bash index caa4c5b..294e6b1 100644 --- a/scripts/runtime.bash +++ b/scripts/runtime.bash @@ -140,10 +140,10 @@ function run() # extra_params in the config file may contain backticks that need to be # expanded, so use eval to start qemu. Use "> >(foo)" instead of a pipe to # preserve the exit status. - summary=$(eval $cmdline 2> >(RUNTIME_log_stderr) \ - > >(tee >(RUNTIME_log_stdout $kernel) | extract_summary)) + summary=$(eval $cmdline 2> >(RUNTIME_log_stderr $testname) \ + > >(tee >(RUNTIME_log_stdout $testname $kernel) | extract_summary)) ret=$? - [ "$STANDALONE" != "yes" ] && echo > >(RUNTIME_log_stdout $kernel) + [ "$STANDALONE" != "yes" ] && echo > >(RUNTIME_log_stdout $testname $kernel) if [ $ret -eq 0 ]; then print_result "PASS" $testname "$summary" From patchwork Mon Sep 28 17:49:50 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 11804409 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 841A06CA for ; Mon, 28 Sep 2020 17:50:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5F1242083B for ; Mon, 28 Sep 2020 17:50:17 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="DYVDu5vn" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726621AbgI1RuQ (ORCPT ); Mon, 28 Sep 2020 13:50:16 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:21416 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726548AbgI1RuP (ORCPT ); Mon, 28 Sep 2020 13:50:15 -0400 Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1601315414; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:in-reply-to:in-reply-to:references:references; bh=79YO6fZ0Yrs5YdJ8AKm+SuqO4tnr4tmPibQXRa3Gx68=; b=DYVDu5vnCgQEVKGAbTFnCtwJFZfq1Nd5vNF9uxBmvXYHq57yQ6inwwi7FwQSAK9VrICkjb s8nUieLpDdosqc4phXAbtYCf9UMWkpZduMhSjRTlEllzjoinsfjl13yBcp2ZwIGVK0mnfJ wuAlnumeb1lN0bfszlDyCNX8tKOjPi4= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-386-oChg-JtBPVa8oSWNenBlgA-1; Mon, 28 Sep 2020 13:50:09 -0400 X-MC-Unique: oChg-JtBPVa8oSWNenBlgA-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 8F35E425D5; Mon, 28 Sep 2020 17:50:08 +0000 (UTC) Received: from thuth.com (unknown [10.40.192.131]) by smtp.corp.redhat.com (Postfix) with ESMTP id 38DD510013C0; Mon, 28 Sep 2020 17:50:06 +0000 (UTC) From: Thomas Huth To: kvm@vger.kernel.org, Paolo Bonzini Cc: Janosch Frank Subject: [kvm-unit-tests PULL 03/11] configure: Add a check for the bash version Date: Mon, 28 Sep 2020 19:49:50 +0200 Message-Id: <20200928174958.26690-4-thuth@redhat.com> In-Reply-To: <20200928174958.26690-1-thuth@redhat.com> References: <20200928174958.26690-1-thuth@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Our scripts do not work with older versions of the bash, like the default Bash 3 from macOS (e.g. we use the "|&" operator which has been introduced in Bash 4.0). Add a check to make sure that we use at least version 4 to avoid that the users run into problems later. Message-Id: <20200925143852.227908-1-thuth@redhat.com> Signed-off-by: Thomas Huth --- configure | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/configure b/configure index f930543..39b63ae 100755 --- a/configure +++ b/configure @@ -1,5 +1,10 @@ #!/usr/bin/env bash +if [ -z "${BASH_VERSINFO[0]}" ] || [ "${BASH_VERSINFO[0]}" -lt 4 ] ; then + echo "Error: Bash version 4 or newer is required for the kvm-unit-tests" + exit 1 +fi + srcdir=$(cd "$(dirname "$0")"; pwd) prefix=/usr/local cc=gcc From patchwork Mon Sep 28 17:49:51 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 11804411 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B16E0618 for ; Mon, 28 Sep 2020 17:50:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 955A9214D8 for ; Mon, 28 Sep 2020 17:50:18 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="QdQimiFN" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726573AbgI1RuS (ORCPT ); Mon, 28 Sep 2020 13:50:18 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:30650 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726548AbgI1RuR (ORCPT ); Mon, 28 Sep 2020 13:50:17 -0400 Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1601315416; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:in-reply-to:in-reply-to:references:references; bh=8s73DBEwfUJyOef9kIF/6IX60LH6lIK9HLhlRVM93Mk=; b=QdQimiFNBdmD0Hd3BoR9MReCWKDBJaWMyFI0Y7gZvN2cpOxcXVBJ3qnD6wwmNToKA+Ie3K BqxSwrKP1GpSuTsWhEAmwXavZSBVBmy7B13JKuGTSR5GcbHZ/OqUKW4T2hjnuDhQPBLKyW TvJ63e5cgGBh7TvM7XPPzc/Z/MgBNeM= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-485-oYQU8qBpOiu14DrlP8OAAQ-1; Mon, 28 Sep 2020 13:50:11 -0400 X-MC-Unique: oYQU8qBpOiu14DrlP8OAAQ-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 855791019632; Mon, 28 Sep 2020 17:50:10 +0000 (UTC) Received: from thuth.com (unknown [10.40.192.131]) by smtp.corp.redhat.com (Postfix) with ESMTP id 10BF710013C0; Mon, 28 Sep 2020 17:50:08 +0000 (UTC) From: Thomas Huth To: kvm@vger.kernel.org, Paolo Bonzini Cc: Janosch Frank Subject: [kvm-unit-tests PULL 04/11] travis.yml: Update from Bionic to Focal Date: Mon, 28 Sep 2020 19:49:51 +0200 Message-Id: <20200928174958.26690-5-thuth@redhat.com> In-Reply-To: <20200928174958.26690-1-thuth@redhat.com> References: <20200928174958.26690-1-thuth@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org The newer version of QEMU in Focal should help to run more tests with TCG (which will be enabled in later patches). Message-Id: <20200924161612.144549-2-thuth@redhat.com> Signed-off-by: Thomas Huth --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index b497264..4b7947c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,4 @@ -dist: bionic +dist: focal language: c cache: ccache git: From patchwork Mon Sep 28 17:49:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 11804417 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 79B55618 for ; Mon, 28 Sep 2020 17:50:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 54BF6214D8 for ; Mon, 28 Sep 2020 17:50:23 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="fQQ8kRBX" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726638AbgI1RuV (ORCPT ); Mon, 28 Sep 2020 13:50:21 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:22985 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726607AbgI1RuU (ORCPT ); Mon, 28 Sep 2020 13:50:20 -0400 Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1601315419; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:in-reply-to:in-reply-to:references:references; bh=ScRS1N9ncw9iH/y+t8MQfMg5kqk17o/Y7KYIPkdo1yw=; b=fQQ8kRBXAUNiGQNpQ6VkMmcWRSYawTW601oH7sV5ny3lNH+7EjdaEhZKLPvQ50l2hwdWI9 UHZkjK0q/tgkFkgjhi0hUzBEjsruh+CLR11AwZ/SQOoNz1904sCr3e7+6ly5Bj4T1bUbez J1Up9qLVhptF74hcWnY2uRU8furZMv4= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-555-voasKWDDP32khQQM8Z5vPg-1; Mon, 28 Sep 2020 13:50:13 -0400 X-MC-Unique: voasKWDDP32khQQM8Z5vPg-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A73931019626; Mon, 28 Sep 2020 17:50:12 +0000 (UTC) Received: from thuth.com (unknown [10.40.192.131]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1EB88100238C; Mon, 28 Sep 2020 17:50:10 +0000 (UTC) From: Thomas Huth To: kvm@vger.kernel.org, Paolo Bonzini Cc: Janosch Frank Subject: [kvm-unit-tests PULL 05/11] travis.yml: Update the list of s390x tests Date: Mon, 28 Sep 2020 19:49:52 +0200 Message-Id: <20200928174958.26690-6-thuth@redhat.com> In-Reply-To: <20200928174958.26690-1-thuth@redhat.com> References: <20200928174958.26690-1-thuth@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org With the new QEMU from Ubuntu Focal, we can now run more tests with TCG. Message-Id: <20200924161612.144549-10-thuth@redhat.com> Acked-by: Cornelia Huck Acked-by: David Hildenbrand Signed-off-by: Thomas Huth --- .travis.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 4b7947c..ef3cc40 100644 --- a/.travis.yml +++ b/.travis.yml @@ -106,7 +106,8 @@ jobs: env: - CONFIG="--arch=s390x --cross-prefix=s390x-linux-gnu-" - BUILD_DIR="." - - TESTS="diag10 diag308" + - TESTS="cpumodel css diag10 diag288 diag308 emulator intercept sclp-1g + sclp-3g selftest-setup" - ACCEL="tcg,firmware=s390x/run" - addons: @@ -114,7 +115,7 @@ jobs: env: - CONFIG="--arch=s390x --cross-prefix=s390x-linux-gnu-" - BUILD_DIR="s390x-builddir" - - TESTS="sieve" + - TESTS="sieve skey stsi vector" - ACCEL="tcg,firmware=s390x/run" - os: osx From patchwork Mon Sep 28 17:49:53 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 11804413 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 38305618 for ; Mon, 28 Sep 2020 17:50:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1BBC1214D8 for ; Mon, 28 Sep 2020 17:50:21 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="U78fSbMi" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726635AbgI1RuU (ORCPT ); Mon, 28 Sep 2020 13:50:20 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:36037 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726548AbgI1RuT (ORCPT ); Mon, 28 Sep 2020 13:50:19 -0400 Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1601315418; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:in-reply-to:in-reply-to:references:references; bh=rbk1bd/7lqywfI5yBzrlH96ni1KcOagDbEDVefpwTVo=; b=U78fSbMi/mCLZuWk8rtupbGQcuCz2zaEitcvpMWvUy8lkfLVesiOZxodHl8S3iJQtCh8Zq +O5o702ts2yt4zIa3pOup/ZxqAnqgBw5veuoWsd82C7g/pllnrPZiE8Dg8025W6ShqDiL+ byTgC8BJTeaCsvIuzAYFwFCJ4gqoYzc= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-492-Iq5dPd32Pvqd-bZ8KBVZWQ-1; Mon, 28 Sep 2020 13:50:15 -0400 X-MC-Unique: Iq5dPd32Pvqd-bZ8KBVZWQ-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B1F21188C137; Mon, 28 Sep 2020 17:50:14 +0000 (UTC) Received: from thuth.com (unknown [10.40.192.131]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4309E10013C0; Mon, 28 Sep 2020 17:50:12 +0000 (UTC) From: Thomas Huth To: kvm@vger.kernel.org, Paolo Bonzini Cc: Janosch Frank Subject: [kvm-unit-tests PULL 06/11] common.bash: run `cmd` only if a test case was found Date: Mon, 28 Sep 2020 19:49:53 +0200 Message-Id: <20200928174958.26690-7-thuth@redhat.com> In-Reply-To: <20200928174958.26690-1-thuth@redhat.com> References: <20200928174958.26690-1-thuth@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org From: Marc Hartmayer It's only useful to run `cmd` in `for_each_unittest` if a test case was found. This change allows us to remove the guards from the functions `run_task` and `mkstandalone`. Reviewed-by: Andrew Jones Reviewed-by: Cornelia Huck Reviewed-by: David Hildenbrand Signed-off-by: Marc Hartmayer Message-Id: <20200923134758.19354-2-mhartmay@linux.ibm.com> Signed-off-by: Thomas Huth --- run_tests.sh | 3 --- scripts/common.bash | 8 ++++++-- scripts/mkstandalone.sh | 4 ---- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/run_tests.sh b/run_tests.sh index d7cad9b..65108e7 100755 --- a/run_tests.sh +++ b/run_tests.sh @@ -136,9 +136,6 @@ RUNTIME_log_stdout () { function run_task() { local testname="$1" - if [ -z "$testname" ]; then - return - fi while (( $(jobs | wc -l) == $unittest_run_queues )); do # wait for any background test to finish diff --git a/scripts/common.bash b/scripts/common.bash index 9a6ebbd..96655c9 100644 --- a/scripts/common.bash +++ b/scripts/common.bash @@ -17,7 +17,9 @@ function for_each_unittest() while read -r -u $fd line; do if [[ "$line" =~ ^\[(.*)\]$ ]]; then - "$cmd" "$testname" "$groups" "$smp" "$kernel" "$opts" "$arch" "$check" "$accel" "$timeout" + if [ -n "${testname}" ]; then + "$cmd" "$testname" "$groups" "$smp" "$kernel" "$opts" "$arch" "$check" "$accel" "$timeout" + fi testname=${BASH_REMATCH[1]} smp=1 kernel="" @@ -45,6 +47,8 @@ function for_each_unittest() timeout=${BASH_REMATCH[1]} fi done - "$cmd" "$testname" "$groups" "$smp" "$kernel" "$opts" "$arch" "$check" "$accel" "$timeout" + if [ -n "${testname}" ]; then + "$cmd" "$testname" "$groups" "$smp" "$kernel" "$opts" "$arch" "$check" "$accel" "$timeout" + fi exec {fd}<&- } diff --git a/scripts/mkstandalone.sh b/scripts/mkstandalone.sh index 9d506cc..cefdec3 100755 --- a/scripts/mkstandalone.sh +++ b/scripts/mkstandalone.sh @@ -83,10 +83,6 @@ function mkstandalone() { local testname="$1" - if [ -z "$testname" ]; then - return - fi - if [ -n "$one_testname" ] && [ "$testname" != "$one_testname" ]; then return fi From patchwork Mon Sep 28 17:49:54 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 11804415 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 51A92618 for ; Mon, 28 Sep 2020 17:50:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 319572100A for ; Mon, 28 Sep 2020 17:50:22 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="Lek2MRwD" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726645AbgI1RuV (ORCPT ); Mon, 28 Sep 2020 13:50:21 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:50412 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726634AbgI1RuU (ORCPT ); Mon, 28 Sep 2020 13:50:20 -0400 Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1601315419; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:in-reply-to:in-reply-to:references:references; bh=8BnjV1darUb7iNhMu3VTT/BEIzy2CJpD03okKRb3uyY=; b=Lek2MRwDuQlr4PW6VuCaK03fyYdIzxSbS5sTiJU695q7WRGFjvc6RI4owoZEVz3nlDlbV1 Ju5EOkWlJR8fiGnWTvDqfpXAAPKK5ufDLpllBGlj63NNeU+zhnM4KBsaVGX/4q03kLIQc3 e4yYIocsoaObtqyQjZG7uAvnD9f/dTw= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-556-Ro-a9WNHOnmnWKsUzEYxeA-1; Mon, 28 Sep 2020 13:50:17 -0400 X-MC-Unique: Ro-a9WNHOnmnWKsUzEYxeA-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 8B9A01019629; Mon, 28 Sep 2020 17:50:16 +0000 (UTC) Received: from thuth.com (unknown [10.40.192.131]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1CCF510013C0; Mon, 28 Sep 2020 17:50:14 +0000 (UTC) From: Thomas Huth To: kvm@vger.kernel.org, Paolo Bonzini Cc: Janosch Frank Subject: [kvm-unit-tests PULL 07/11] scripts: add support for architecture dependent functions Date: Mon, 28 Sep 2020 19:49:54 +0200 Message-Id: <20200928174958.26690-8-thuth@redhat.com> In-Reply-To: <20200928174958.26690-1-thuth@redhat.com> References: <20200928174958.26690-1-thuth@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org From: Marc Hartmayer This is necessary to keep architecture dependent code separate from common code. Reviewed-by: Andrew Jones Reviewed-by: Cornelia Huck Reviewed-by: David Hildenbrand Signed-off-by: Marc Hartmayer Message-Id: <20200923134758.19354-3-mhartmay@linux.ibm.com> Signed-off-by: Thomas Huth --- README.md | 3 ++- scripts/common.bash | 8 ++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 48be206..24d4bda 100644 --- a/README.md +++ b/README.md @@ -134,7 +134,8 @@ all unit tests. ## Directory structure .: configure script, top-level Makefile, and run_tests.sh - ./scripts: helper scripts for building and running tests + ./scripts: general architecture neutral helper scripts for building and running tests + ./scripts/: architecture dependent helper scripts for building and running tests ./lib: general architecture neutral services for the tests ./lib/: architecture dependent services for the tests ./: the sources of the tests and the created objects/images diff --git a/scripts/common.bash b/scripts/common.bash index 96655c9..c7acdf1 100644 --- a/scripts/common.bash +++ b/scripts/common.bash @@ -1,3 +1,4 @@ +source config.mak function for_each_unittest() { @@ -52,3 +53,10 @@ function for_each_unittest() fi exec {fd}<&- } + +# The current file has to be the only file sourcing the arch helper +# file +ARCH_FUNC=scripts/${ARCH}/func.bash +if [ -f "${ARCH_FUNC}" ]; then + source "${ARCH_FUNC}" +fi From patchwork Mon Sep 28 17:49:55 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 11804419 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C92826CA for ; Mon, 28 Sep 2020 17:50:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id AE1B5214D8 for ; Mon, 28 Sep 2020 17:50:24 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="d5BQLHNp" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726659AbgI1RuX (ORCPT ); Mon, 28 Sep 2020 13:50:23 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:32297 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726648AbgI1RuW (ORCPT ); Mon, 28 Sep 2020 13:50:22 -0400 Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1601315421; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:in-reply-to:in-reply-to:references:references; bh=CsHCQ6zqnhsBmNQoKLpNTTHjsBNXMnS9r1fYUgjBzBE=; b=d5BQLHNp6HbqThktIK0gc6w78nklQ9p/iHAdrw/zqpEaeNOZWqSUDjRgePsqrtBYPR3KIf SIx4IOdt7y2I44rcJytNG1qragpf2kFIlz406Bq40HdtXiuPxug7OQFkOpOt9cNbDAf39F YNnVtUt5lreQr1H5jqyEzYwBOsoS8ys= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-13-JmGs5MryMl6Jlm0orTJTUw-1; Mon, 28 Sep 2020 13:50:19 -0400 X-MC-Unique: JmGs5MryMl6Jlm0orTJTUw-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 477E41084D75; Mon, 28 Sep 2020 17:50:18 +0000 (UTC) Received: from thuth.com (unknown [10.40.192.131]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2812510013C0; Mon, 28 Sep 2020 17:50:16 +0000 (UTC) From: Thomas Huth To: kvm@vger.kernel.org, Paolo Bonzini Cc: Janosch Frank Subject: [kvm-unit-tests PULL 08/11] run_tests/mkstandalone: add arch_cmd hook Date: Mon, 28 Sep 2020 19:49:55 +0200 Message-Id: <20200928174958.26690-9-thuth@redhat.com> In-Reply-To: <20200928174958.26690-1-thuth@redhat.com> References: <20200928174958.26690-1-thuth@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org From: Marc Hartmayer This allows us, for example, to auto generate a new test case based on an existing test case. Reviewed-by: Andrew Jones Reviewed-by: Cornelia Huck Reviewed-by: David Hildenbrand Signed-off-by: Marc Hartmayer Message-Id: <20200923134758.19354-4-mhartmay@linux.ibm.com> Signed-off-by: Thomas Huth --- scripts/common.bash | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/scripts/common.bash b/scripts/common.bash index c7acdf1..a6044b7 100644 --- a/scripts/common.bash +++ b/scripts/common.bash @@ -19,7 +19,7 @@ function for_each_unittest() while read -r -u $fd line; do if [[ "$line" =~ ^\[(.*)\]$ ]]; then if [ -n "${testname}" ]; then - "$cmd" "$testname" "$groups" "$smp" "$kernel" "$opts" "$arch" "$check" "$accel" "$timeout" + $(arch_cmd) "$cmd" "$testname" "$groups" "$smp" "$kernel" "$opts" "$arch" "$check" "$accel" "$timeout" fi testname=${BASH_REMATCH[1]} smp=1 @@ -49,11 +49,16 @@ function for_each_unittest() fi done if [ -n "${testname}" ]; then - "$cmd" "$testname" "$groups" "$smp" "$kernel" "$opts" "$arch" "$check" "$accel" "$timeout" + $(arch_cmd) "$cmd" "$testname" "$groups" "$smp" "$kernel" "$opts" "$arch" "$check" "$accel" "$timeout" fi exec {fd}<&- } +function arch_cmd() +{ + [ "${ARCH_CMD}" ] && echo "${ARCH_CMD}" +} + # The current file has to be the only file sourcing the arch helper # file ARCH_FUNC=scripts/${ARCH}/func.bash From patchwork Mon Sep 28 17:49:56 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 11804423 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D827A618 for ; Mon, 28 Sep 2020 17:50:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BD82A214D8 for ; Mon, 28 Sep 2020 17:50:29 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="ExHH5/B4" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726668AbgI1Ru0 (ORCPT ); Mon, 28 Sep 2020 13:50:26 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:54308 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726657AbgI1Ru0 (ORCPT ); Mon, 28 Sep 2020 13:50:26 -0400 Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1601315424; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:in-reply-to:in-reply-to:references:references; bh=l9HYw2Bbon6wcPzRXVYSoU9Z3H0BBZQjJDN+mJGq7kc=; b=ExHH5/B4sLzCcTXNuOU7kX3t5NRiqJgdX9hA1XAa7Yj8JDX8rvQkG02PhjmD6qPfF1GwA0 mnvb8n06EpZeA+f55Znkz8pFef+0JGgFTq6suDS0hIpjbmP/cVMJcpMa07aPJ5yKjR/P2H vHjXmCLnXZ1ELQB/g/V6SpVjrKRipXo= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-329-91Q1usWpPPeCpCaJ7YjEmA-1; Mon, 28 Sep 2020 13:50:20 -0400 X-MC-Unique: 91Q1usWpPPeCpCaJ7YjEmA-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id CF4688014D8; Mon, 28 Sep 2020 17:50:19 +0000 (UTC) Received: from thuth.com (unknown [10.40.192.131]) by smtp.corp.redhat.com (Postfix) with ESMTP id C4523100238C; Mon, 28 Sep 2020 17:50:18 +0000 (UTC) From: Thomas Huth To: kvm@vger.kernel.org, Paolo Bonzini Cc: Janosch Frank Subject: [kvm-unit-tests PULL 09/11] s390x: add Protected VM support Date: Mon, 28 Sep 2020 19:49:56 +0200 Message-Id: <20200928174958.26690-10-thuth@redhat.com> In-Reply-To: <20200928174958.26690-1-thuth@redhat.com> References: <20200928174958.26690-1-thuth@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org From: Marc Hartmayer Add support for Protected Virtual Machine (PVM) tests. For starting a PVM guest we must be able to generate a PVM image by using the `genprotimg` tool from the s390-tools collection. This requires the ability to pass a machine-specific host-key document, so the option `--host-key-document` is added to the configure script. Reviewed-by: Janosch Frank Signed-off-by: Marc Hartmayer Message-Id: <20200923134758.19354-5-mhartmay@linux.ibm.com> Reviewed-by: Cornelia Huck [thuth: Drop the verbose "SKIP ... (no host-key document specified)" output] Signed-off-by: Thomas Huth --- configure | 9 +++++++++ s390x/Makefile | 15 ++++++++++++++- s390x/selftest.parmfile | 1 + s390x/unittests.cfg | 1 + scripts/s390x/func.bash | 35 +++++++++++++++++++++++++++++++++++ 5 files changed, 60 insertions(+), 1 deletion(-) create mode 100644 s390x/selftest.parmfile create mode 100644 scripts/s390x/func.bash diff --git a/configure b/configure index 39b63ae..706aab5 100755 --- a/configure +++ b/configure @@ -24,6 +24,7 @@ wa_divide= vmm="qemu" errata_force=0 erratatxt="$srcdir/errata.txt" +host_key_document= usage() { cat <<-EOF @@ -46,6 +47,9 @@ usage() { no environ is provided by the user (enabled by default) --erratatxt=FILE specify a file to use instead of errata.txt. Use '--erratatxt=' to ensure no file is used. + --host-key-document=HOST_KEY_DOCUMENT + Specify the machine-specific host-key document for creating + a PVM image with 'genprotimg' (s390x only) EOF exit 1 } @@ -98,6 +102,9 @@ while [[ "$1" = -* ]]; do erratatxt= [ "$arg" ] && erratatxt=$(eval realpath "$arg") ;; + --host-key-document) + host_key_document="$arg" + ;; --help) usage ;; @@ -229,6 +236,8 @@ ENVIRON_DEFAULT=$environ_default ERRATATXT=$erratatxt U32_LONG_FMT=$u32_long WA_DIVIDE=$wa_divide +GENPROTIMG=${GENPROTIMG-genprotimg} +HOST_KEY_DOCUMENT=$host_key_document EOF cat < lib/config.h diff --git a/s390x/Makefile b/s390x/Makefile index c2213ad..b079a26 100644 --- a/s390x/Makefile +++ b/s390x/Makefile @@ -19,12 +19,19 @@ tests += $(TEST_DIR)/smp.elf tests += $(TEST_DIR)/sclp.elf tests += $(TEST_DIR)/css.elf tests += $(TEST_DIR)/uv-guest.elf + tests_binary = $(patsubst %.elf,%.bin,$(tests)) +ifneq ($(HOST_KEY_DOCUMENT),) +tests_pv_binary = $(patsubst %.bin,%.pv.bin,$(tests_binary)) +else +tests_pv_binary = +endif -all: directories test_cases test_cases_binary +all: directories test_cases test_cases_binary test_cases_pv test_cases: $(tests) test_cases_binary: $(tests_binary) +test_cases_pv: $(tests_pv_binary) CFLAGS += -std=gnu99 CFLAGS += -ffreestanding @@ -73,6 +80,12 @@ FLATLIBS = $(libcflat) %.bin: %.elf $(OBJCOPY) -O binary $< $@ +%selftest.pv.bin: %selftest.bin $(HOST_KEY_DOCUMENT) $(patsubst %.pv.bin,%.parmfile,$@) + $(GENPROTIMG) --host-key-document $(HOST_KEY_DOCUMENT) --parmfile $(patsubst %.pv.bin,%.parmfile,$@) --no-verify --image $< -o $@ + +%.pv.bin: %.bin $(HOST_KEY_DOCUMENT) + $(GENPROTIMG) --host-key-document $(HOST_KEY_DOCUMENT) --no-verify --image $< -o $@ + arch_clean: asm_offsets_clean $(RM) $(TEST_DIR)/*.{o,elf,bin} $(TEST_DIR)/.*.d lib/s390x/.*.d diff --git a/s390x/selftest.parmfile b/s390x/selftest.parmfile new file mode 100644 index 0000000..5613931 --- /dev/null +++ b/s390x/selftest.parmfile @@ -0,0 +1 @@ +test 123 \ No newline at end of file diff --git a/s390x/unittests.cfg b/s390x/unittests.cfg index 6d50c63..3feb8bc 100644 --- a/s390x/unittests.cfg +++ b/s390x/unittests.cfg @@ -21,6 +21,7 @@ [selftest-setup] file = selftest.elf groups = selftest +# please keep the kernel cmdline in sync with $(TEST_DIR)/selftest.parmfile extra_params = -append 'test 123' [intercept] diff --git a/scripts/s390x/func.bash b/scripts/s390x/func.bash new file mode 100644 index 0000000..b391208 --- /dev/null +++ b/scripts/s390x/func.bash @@ -0,0 +1,35 @@ +# The file scripts/common.bash has to be the only file sourcing this +# arch helper file +source config.mak + +ARCH_CMD=arch_cmd_s390x + +function arch_cmd_s390x() +{ + local cmd=$1 + local testname=$2 + local groups=$3 + local smp=$4 + local kernel=$5 + local opts=$6 + local arch=$7 + local check=$8 + local accel=$9 + local timeout=${10} + + # run the normal test case + "$cmd" "$testname" "$groups" "$smp" "$kernel" "$opts" "$arch" "$check" "$accel" "$timeout" + + # run PV test case + kernel=${kernel%.elf}.pv.bin + testname=${testname}_PV + if [ ! -f "${kernel}" ]; then + if [ -z "${HOST_KEY_DOCUMENT}" ]; then + return 2 + fi + + print_result 'SKIP' $testname '' 'PVM image was not created' + return 2 + fi + "$cmd" "$testname" "$groups pv" "$smp" "$kernel" "$opts" "$arch" "$check" "$accel" "$timeout" +} From patchwork Mon Sep 28 17:49:57 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 11804425 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 37216618 for ; Mon, 28 Sep 2020 17:50:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1C895205ED for ; Mon, 28 Sep 2020 17:50:31 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="OD+9p70r" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726682AbgI1Rua (ORCPT ); Mon, 28 Sep 2020 13:50:30 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:59108 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726685AbgI1Ru3 (ORCPT ); Mon, 28 Sep 2020 13:50:29 -0400 Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1601315428; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:in-reply-to:in-reply-to:references:references; bh=5pzSOmdwNBbWykFB5gvwfruiXYEsFxeeh3MH2ruHvNg=; b=OD+9p70rmkqObe2/YM8bXEj2jspX5wNbLngXLuNhFP3KALQ5T//G/0O1qfQEMTjzIoWfSb dKzpIjgYPdgUzTT84dgb+4z0Z63jExDKnsh/oYNB1qva4cliuFu0WKHYjKgwnXjRJF63Lj VweKdWpA303sDoPtXoKtoafAVRyMgHo= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-367-ailEwMcOOvi5MxXDwx_wpA-1; Mon, 28 Sep 2020 13:50:23 -0400 X-MC-Unique: ailEwMcOOvi5MxXDwx_wpA-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A6B67425D0; Mon, 28 Sep 2020 17:50:21 +0000 (UTC) Received: from thuth.com (unknown [10.40.192.131]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6C20B10013C0; Mon, 28 Sep 2020 17:50:20 +0000 (UTC) From: Thomas Huth To: kvm@vger.kernel.org, Paolo Bonzini Cc: Janosch Frank Subject: [kvm-unit-tests PULL 10/11] s390x/selftest: Fix constraint of inline assembly Date: Mon, 28 Sep 2020 19:49:57 +0200 Message-Id: <20200928174958.26690-11-thuth@redhat.com> In-Reply-To: <20200928174958.26690-1-thuth@redhat.com> References: <20200928174958.26690-1-thuth@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Clang on s390x compains: /home/thuth/devel/kvm-unit-tests/s390x/selftest.c:39:15: error: %r0 used in an address asm volatile(" stg %0,0(%0)\n" : : "r"(-1L)); ^ :1:13: note: instantiated into assembly here stg %r0,0(%r0) ^ Right it is. We should not use address register 0 for STG. Thus let's use the "a" constraint to avoid register 0 here. Message-Id: <20200924111746.131633-1-thuth@redhat.com> Reviewed-by: David Hildenbrand Signed-off-by: Thomas Huth --- s390x/selftest.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/s390x/selftest.c b/s390x/selftest.c index 4c16646..eaf5b18 100644 --- a/s390x/selftest.c +++ b/s390x/selftest.c @@ -36,7 +36,7 @@ static void test_pgm_int(void) check_pgm_int_code(PGM_INT_CODE_OPERATION); expect_pgm_int(); - asm volatile(" stg %0,0(%0)\n" : : "r"(-1L)); + asm volatile(" stg %0,0(%0)\n" : : "a"(-1L)); check_pgm_int_code(PGM_INT_CODE_ADDRESSING); } From patchwork Mon Sep 28 17:49:58 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 11804427 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D6A3F6CA for ; Mon, 28 Sep 2020 17:50:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BBA242080C for ; Mon, 28 Sep 2020 17:50:31 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="G9ZCyG11" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726583AbgI1Rua (ORCPT ); Mon, 28 Sep 2020 13:50:30 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:58100 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726684AbgI1Ru3 (ORCPT ); Mon, 28 Sep 2020 13:50:29 -0400 Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1601315427; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:in-reply-to:in-reply-to:references:references; bh=TIgRicJInSQvZMzAg3zt8cELNWrV41FAFENuoCLRHIw=; b=G9ZCyG11h4s0BCpyXljsoRJSPELl0n47HwfZunCG2149VmeufZkzP+CUueb1fOtiusBqcH V3WNioQAJqVAVHBu0py1zVpLwzDqR1VRs+t1jsd+oAAbVmJkrtfJUJkJNixCrUjoxwCDPM CsUFWiooCXMZdhtn3OrndKscD4to0Y8= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-57-2V1VY3mtOViM3SLe5ZHUmw-1; Mon, 28 Sep 2020 13:50:24 -0400 X-MC-Unique: 2V1VY3mtOViM3SLe5ZHUmw-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B502B1084D61; Mon, 28 Sep 2020 17:50:23 +0000 (UTC) Received: from thuth.com (unknown [10.40.192.131]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2CF9210013C0; Mon, 28 Sep 2020 17:50:21 +0000 (UTC) From: Thomas Huth To: kvm@vger.kernel.org, Paolo Bonzini Cc: Janosch Frank Subject: [kvm-unit-tests PULL 11/11] scripts/arch-run: use ncat rather than nc. Date: Mon, 28 Sep 2020 19:49:58 +0200 Message-Id: <20200928174958.26690-12-thuth@redhat.com> In-Reply-To: <20200928174958.26690-1-thuth@redhat.com> References: <20200928174958.26690-1-thuth@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org From: Jamie Iles On Red Hat 7+ and derived distributions, 'nc' is nmap-ncat, but on Debian based distributions this is often netcat-openbsd. Both are mostly compatible with the important distinction that netcat-openbsd does not shutdown the socket on stdin EOF without also passing '-N' as an argument which is not supported on nmap-ncat. This has the unfortunate consequence of hanging qmp calls so tests like aarch64 its-migration never complete. We're depending on ncat behaviour and nmap-ncat is available in all major distributions. Signed-off-by: Jamie Iles Message-Id: <20200921103644.1718058-1-jamie@nuviainc.com> Tested-by: Thomas Huth Signed-off-by: Thomas Huth --- scripts/arch-run.bash | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/arch-run.bash b/scripts/arch-run.bash index 660f1b7..5997e38 100644 --- a/scripts/arch-run.bash +++ b/scripts/arch-run.bash @@ -101,13 +101,13 @@ timeout_cmd () qmp () { - echo '{ "execute": "qmp_capabilities" }{ "execute":' "$2" '}' | nc -U $1 + echo '{ "execute": "qmp_capabilities" }{ "execute":' "$2" '}' | ncat -U $1 } run_migration () { - if ! command -v nc >/dev/null 2>&1; then - echo "${FUNCNAME[0]} needs nc (netcat)" >&2 + if ! command -v ncat >/dev/null 2>&1; then + echo "${FUNCNAME[0]} needs ncat (netcat)" >&2 return 2 fi