From patchwork Wed Apr 19 12:44:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xavier Simonart X-Patchwork-Id: 1770721 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=2605:bc80:3010::136; helo=smtp3.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=DG2TWqFi; dkim-atps=neutral Received: from smtp3.osuosl.org (smtp3.osuosl.org [IPv6:2605:bc80:3010::136]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Q1gTq6SC1z1ybF for ; Wed, 19 Apr 2023 22:44:31 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 30BFF6165E; Wed, 19 Apr 2023 12:44:30 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 30BFF6165E Authentication-Results: smtp3.osuosl.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=DG2TWqFi X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id R_6qR8xQ68S0; Wed, 19 Apr 2023 12:44:29 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp3.osuosl.org (Postfix) with ESMTPS id 6337E6164B; Wed, 19 Apr 2023 12:44:28 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 6337E6164B Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 233AFC0036; Wed, 19 Apr 2023 12:44:28 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by lists.linuxfoundation.org (Postfix) with ESMTP id 4C1D8C002A for ; Wed, 19 Apr 2023 12:44:26 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 1A61483C5E for ; Wed, 19 Apr 2023 12:44:26 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 1A61483C5E Authentication-Results: smtp1.osuosl.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=DG2TWqFi X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 4ZZ-P70ZUQnO for ; Wed, 19 Apr 2023 12:44:25 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 52F7581EE8 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by smtp1.osuosl.org (Postfix) with ESMTPS id 52F7581EE8 for ; Wed, 19 Apr 2023 12:44:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1681908264; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pUaQ9u/DhYY6cpJATX4euI1ug0aw2Km6eljNB7aGZgg=; b=DG2TWqFiqh+pQJqmV5e2k6x1jpFp4NaEjDnFNocD6H0tLwKV4/WMiVZETvNkjeOHWMXt+4 HaLalxe8eIJv7chjy2fiQ0rumf3BCHd8wJn0NXp+l0cBvP3bVo0SkdX/GVFBe5yu/is3CP 8Mbhw0tf9535hI4g8uLgDhhjwCATEMY= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-448-oYwRb7gJNbKawULzbhS19g-1; Wed, 19 Apr 2023 08:44:23 -0400 X-MC-Unique: oYwRb7gJNbKawULzbhS19g-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id C88A63C16E83 for ; Wed, 19 Apr 2023 12:44:22 +0000 (UTC) Received: from wsfd-netdev90.ntdv.lab.eng.bos.redhat.com (wsfd-netdev90.ntdv.lab.eng.bos.redhat.com [10.19.188.196]) by smtp.corp.redhat.com (Postfix) with ESMTP id B0B491121314; Wed, 19 Apr 2023 12:44:22 +0000 (UTC) From: Xavier Simonart To: xsimonar@redhat.com, dev@openvswitch.org Date: Wed, 19 Apr 2023 14:44:22 +0200 Message-Id: <20230419124422.3576765-1-xsimonar@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Subject: [ovs-dev] [PATCH ovn] tests: update OVS_PAUSE_TEST behavior X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" User has an option to leave the test environment in error state so that system can be poked around to get more information. User can enable this option by setting environment variable OVS_PAUSE_TEST=1. User needs to press CTRL-D to resume the cleanup operation. When OVS_PAUSE_TEST=1 and the test succeeds, system is still waiting for CTRL-D to resume. However, there is no added value to this behavior, as cleanup is already complete (the only potential added value could be to keep the logs, which can be achieved using -d option). This patch causes OVS_PAUSE_TEST=1 to wait for CTRL-D before cleanup only for failed tests. For successful tests, the test completes as if no OVS_PAUSE_TEST=1. This new behavior helps in running the same test in loop, with OVS_PAUSE_TEST=1, and stopping when it fails, and keep environment in error state. This is useful in trying to reproduce some flaky tests. Note that the same macro exists in OVS tree. It could be updated there as well if/once the patch is accepted. ovs-macros are however already slighly different in OVS and OVN subtrees. Signed-off-by: Xavier Simonart Acked-by: Ales Musil --- Documentation/topics/testing.rst | 3 +++ tests/ovs-macros.at | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Documentation/topics/testing.rst b/Documentation/topics/testing.rst index db265344a..14dbaa2cb 100644 --- a/Documentation/topics/testing.rst +++ b/Documentation/topics/testing.rst @@ -113,6 +113,9 @@ And from another window, one can execute ovs-xxx commands like:: Once done with investigation, press ENTER to perform cleanup operation. +OVS_PAUSE_TEST=1 only pauses failed tests when run with '-v' option. +Tests run without '-v', or successful tests, are not paused. + .. _testing-coverage: Coverage diff --git a/tests/ovs-macros.at b/tests/ovs-macros.at index 36b58b5ae..d3e6c7ab5 100644 --- a/tests/ovs-macros.at +++ b/tests/ovs-macros.at @@ -68,7 +68,8 @@ ovs_pause() { } ovs_on_exit () { - if [ ! -z "${OVS_PAUSE_TEST}" ] && [ -z $at_verbose ]; then + rv=$? + if [ ! -z "${OVS_PAUSE_TEST}" ] && [ -z $at_verbose ] && [ $rv != 0 ]; then trap '' INT ovs_pause fi