From patchwork Thu Apr 23 17:05:50 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 185731 Delivered-To: patch@linaro.org Received: by 2002:a92:3d9a:0:0:0:0:0 with SMTP id k26csp2294344ilf; Thu, 23 Apr 2020 10:06:57 -0700 (PDT) X-Google-Smtp-Source: APiQypKL4akj0cLIwqMcvKKwwMqZgDLis5g5Fscqk7NF14aBUvK+mwBKTAtod/LKQ4CiKh0CywFL X-Received: by 2002:a05:620a:13e1:: with SMTP id h1mr4689779qkl.10.1587661617084; Thu, 23 Apr 2020 10:06:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587661617; cv=none; d=google.com; s=arc-20160816; b=Qv3vnVWB5nuqIXx0uCeeQebkJE8LgulBYbeynXOpJ9gNCh9eyUCeO7zT1DkcdwRoEQ HnvY0TT4ES7A6OAOmvKRJGQWJt5Tm/2wxmLdxrAEoJ9cmEsz7PVVXxob8VlFKgwwkaXj zrZrIFtNbmqYmMelfo1eC+//UcFa1jBPv0qGk8FlP6RRyvTU4ixIESCUs08Me2KXKOWh vPDHiwRlNDNSiR9RC8ZxmuxEQ4oR4XzSN8gY/FYvdhqwMnJlW4LKlPmIi1yIWQXbBy13 mEQxXwgT8BawkjpdUfGExOUMC67KGb4UsGy5As8dfLjDoZTRRHbkXQw6Fj4ewhZf/FS4 F8BQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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:to:from :dkim-signature; bh=0Xn/wGLfgFLD46kRhQwU2daT/QhgqlaCuFRqlRFnVf8=; b=mCrZt/91S9g+Kc3k1O9Z+r2JSJs4PyR/+Tn79JS9xhrm0LoL0dqr5b8hvkympQhPO+ ln8ATZks/N7qTHqbHInWLcD3o1wiA/xVDkMus+B9hSxvAPq34I30Gti1/clMlttz8Oap urYqCHr4spxgRWPNk3wohYFgeDT+eEwOdwyKy9YMvvZ+byUjXCSJpWrvihSy7z91uBKi T5KguVlfAECutK103YlobzwwGlBJNcCK+/KqKN+FFzVCWwKj4zWwFaYrDWzqgzpNwx4t ZtZZUVGxPtlSvCSpJXbiBBCePonrYlM6lXVuB4aCZpcZJL3LFhGL7G3xOgpfdSFaxCte 7i0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=DRPoJNbC; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id i4si1897599qvr.23.2020.04.23.10.06.57 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 23 Apr 2020 10:06:57 -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=fail header.i=@linaro.org header.s=google header.b=DRPoJNbC; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:60338 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jRfJQ-00018y-El for patch@linaro.org; Thu, 23 Apr 2020 13:06:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44634) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jRfIg-00013y-MI for qemu-devel@nongnu.org; Thu, 23 Apr 2020 13:06:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jRfIf-0005Ve-Rr for qemu-devel@nongnu.org; Thu, 23 Apr 2020 13:06:10 -0400 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]:33411) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jRfIf-0005Uh-Az for qemu-devel@nongnu.org; Thu, 23 Apr 2020 13:06:09 -0400 Received: by mail-wm1-x333.google.com with SMTP id v8so7927696wma.0 for ; Thu, 23 Apr 2020 10:06:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=0Xn/wGLfgFLD46kRhQwU2daT/QhgqlaCuFRqlRFnVf8=; b=DRPoJNbCfoD7YP8g55X7LdkmXphvibqng/WH+lcvTZr++fsfa7LlEL87NiZHdtHceP P16Op08PVs+04nxv069zTiCW/i6g92cjHmPryOVuhZVaymEhzKS/slqeZuNfSBtNT5Mt Nb8F9+lLHLdE0TvVKBzcklCs3cFgFvWQ3vgUGRVFT4emayoEYSrd/zlJvoG4PlXjhnen D6SRCldiWgcCaXEKAf6Js1jwY/HTIZ99zuOWTTTRslL/VHVUnFmEITjKiL2j8UqrJX/U gDUUYlpqEk0dTPv/J91iK695XdFkYNH7APz/d2yh2RHH7a6pStfzZWZoXD6s0jCty9Pq F9HA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=0Xn/wGLfgFLD46kRhQwU2daT/QhgqlaCuFRqlRFnVf8=; b=F3KjE2rrGLI3UCew3XlLb9viGnv0IUWAuG7+P6htVKuDR0SUGATdHHgOSEeEdvY0No N4M4A++cE5VlSGorBQpcG6MEI1dKPvQbUKLPr9ubyKOrm6+3wb1tm2HPDVtgq8Matyis 6S20QCl8KiyjurDof63/3Bm2xkBJnlpVV2RvRm3Uz4VqMj3OJdSFNYWToyq1CCs1krut uCIeEQuEMLOBRnAdQ3wXqoWBQyT0YLSnRr/yjze4qXjNw0EjOgxWjW5cV2dw4juk3dDl khTmzEc+qBYUeIElQECAq98aE43zORKZlGyiijqHK8/PFzyb8f750KWG/a1TcbA+74RB Qnog== X-Gm-Message-State: AGi0PuYicFLjZjAGRRA9QQ2QmutLnYhbcNoHCo481Ndw8h7ZH7KYPOD7 Qj14KEz6MFIrThToFUvHmmLxzA== X-Received: by 2002:a05:600c:22d3:: with SMTP id 19mr5348534wmg.110.1587661567859; Thu, 23 Apr 2020 10:06:07 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id 17sm4396657wmo.2.2020.04.23.10.06.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Apr 2020 10:06:04 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id E34F61FF93; Thu, 23 Apr 2020 18:05:57 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v1 07/14] tests/tcg: better trap gdb failures Date: Thu, 23 Apr 2020 18:05:50 +0100 Message-Id: <20200423170557.31106-8-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200423170557.31106-1-alex.bennee@linaro.org> References: <20200423170557.31106-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::333; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x333.google.com X-detected-operating-system: by eggs.gnu.org: Error: [-] PROGRAM ABORT : Malformed IPv6 address (bad octet value). Location : parse_addr6(), p0f-client.c:67 X-Received-From: 2a00:1450:4864:20::333 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , "open list:ARM TCG CPUs" , =?utf-8?q?Alex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" It seems older and non-multiarach aware GDBs might not fail gracefully when faced with something they don't know. For example when faced with a target XML for s390x the Ubuntu 18.04 gdb will generate an internal fault and prompt for a core dump. Work around this by invoking GDB in a more batch orientated way and then trying to filter out between test failures and gdb failures. Signed-off-by: Alex Bennée --- tests/guest-debug/run-test.py | 19 ++++++++++++++++++- tests/tcg/aarch64/gdbstub/test-sve-ioctl.py | 1 - tests/tcg/aarch64/gdbstub/test-sve.py | 1 - 3 files changed, 18 insertions(+), 3 deletions(-) -- 2.20.1 diff --git a/tests/guest-debug/run-test.py b/tests/guest-debug/run-test.py index 8c49ee2f22..2bbb8fbaa3 100755 --- a/tests/guest-debug/run-test.py +++ b/tests/guest-debug/run-test.py @@ -50,8 +50,25 @@ if __name__ == '__main__': inferior = subprocess.Popen(shlex.split(cmd)) # Now launch gdb with our test and collect the result - gdb_cmd = "%s %s -ex 'target remote localhost:1234' -x %s" % (args.gdb, args.binary, args.test) + gdb_cmd = "%s %s" % (args.gdb, args.binary) + # run quietly and ignore .gdbinit + gdb_cmd += " -q -n -batch" + # disable prompts in case of crash + gdb_cmd += " -ex 'set confirm off'" + # connect to remote + gdb_cmd += " -ex 'target remote localhost:1234'" + # finally the test script itself + gdb_cmd += " -x %s" % (args.test) + + print("GDB CMD: %s" % (gdb_cmd)) result = subprocess.call(gdb_cmd, shell=True); + # A negative result is the result of an internal gdb failure like + # a crash. We force a return of 0 so we don't fail the test on + # account of broken external tools. + if result < 0: + print("GDB crashed? SKIPPING") + exit(0) + exit(result) diff --git a/tests/tcg/aarch64/gdbstub/test-sve-ioctl.py b/tests/tcg/aarch64/gdbstub/test-sve-ioctl.py index 984fbeb277..387b2fc20a 100644 --- a/tests/tcg/aarch64/gdbstub/test-sve-ioctl.py +++ b/tests/tcg/aarch64/gdbstub/test-sve-ioctl.py @@ -70,7 +70,6 @@ except (gdb.error, AttributeError): try: # These are not very useful in scripts gdb.execute("set pagination off") - gdb.execute("set confirm off") # Run the actual tests run_test() diff --git a/tests/tcg/aarch64/gdbstub/test-sve.py b/tests/tcg/aarch64/gdbstub/test-sve.py index dbe7f2aa93..5995689625 100644 --- a/tests/tcg/aarch64/gdbstub/test-sve.py +++ b/tests/tcg/aarch64/gdbstub/test-sve.py @@ -71,7 +71,6 @@ except (gdb.error, AttributeError): try: # These are not very useful in scripts gdb.execute("set pagination off") - gdb.execute("set confirm off") # Run the actual tests run_test()