Received: by 2002:a05:6a10:6006:0:0:0:0 with SMTP id w6csp436529pxa; Thu, 27 Aug 2020 06:33:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyGFaDlFBSBb3vtc9lZF0k+SmlrbHdJpVI8IbApIfopvvU4GmLOUH8+Kn0nBVKZPeZs0t7S X-Received: by 2002:a17:906:2a0d:: with SMTP id j13mr21980732eje.474.1598535184897; Thu, 27 Aug 2020 06:33:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598535184; cv=none; d=google.com; s=arc-20160816; b=ZP5XAx7zpw79T6TQjvQ0d/PoUZE1EGMAmmeCisnkcNaWVHY6cUwHfA9nBhaiAhHhHm UJwKgwP1GbrPar+chyjRaP2pty+jKcO4XqnukHZvR6CDdwbTvLSibV8dWu0mSvVrBrW9 SodTMIHbbcgdwHbmrkalrOrWNTOFldipYgipS1Pp1plNCjQItqG9/5bJdq6htybq3MK+ Wl4w6UuKiAPiuhTnAuAhq4LwB2M0AKcPqYGOhBeWeXDWDC9ynzlWN9Diyvsn3rx1Wd2n rLcC5ZFVXXe8g2BvIStk8ffQdYoNfDfuvCYlz3wtcFgRZi7dRKaO4wTtwQnpwPVFEIRq z3qA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=zxj3/pnEKNdJXQYKt9vOuqr1Pjo+7bDlTiGFlo7k2bk=; b=LSSJCu+X/kxeDpitIAXR0Qyng/gbH447b13PS9z4eZTC5veT5JwVT6xKmgzWE+zfFF /fW2sinjW0sLXWMB4Tj4hrCf7lmpNO58huqZZVKhANFYsSPJcp6aJdtyucB8UMsDVm3J lzWVy4aQxfCZHyYvbDT0lfkqnms3fDFn3lLc1BlAs111ZQkcCcOzYXqnre/4wk4bRA4s Q30pbqoizTSKsrtY+cUlx4suWGHxGjvvsOawTna57tA0wEPmXoGN53I2QQe0cwbQ0wvp 6B1/BIKAXsx+FPZUIrfX/+6bxoobIpud6w0l3GVFna8uNGLOnnAWaHiCrwFzns6q30TN NfPg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=AdhY35Ul; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id jo12si1390693ejb.99.2020.08.27.06.32.41; Thu, 27 Aug 2020 06:33:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=AdhY35Ul; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727817AbgH0Naw (ORCPT + 99 others); Thu, 27 Aug 2020 09:30:52 -0400 Received: from us-smtp-2.mimecast.com ([207.211.31.81]:56018 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727992AbgH0NVT (ORCPT ); Thu, 27 Aug 2020 09:21:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1598534464; 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: in-reply-to:in-reply-to:references:references; bh=zxj3/pnEKNdJXQYKt9vOuqr1Pjo+7bDlTiGFlo7k2bk=; b=AdhY35Ul5Ut+0CwcMY+3YmEM3gx2B2w/Qgna0lmpKg9KDgpG+2nf4e17ozmYUhSPQFWUxe syfZzW0jyrxWKjTi9x787U3hQBDvzCZMwEcvoi7qHEQRmim3q6wCOJN3kc6EXx6oT/62y/ 6yFWJ883rf5m2myJ6qoT/LtYBKHnAq0= 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-567-Kv9Ig1K7NFS8Ya33PNgGOQ-1; Thu, 27 Aug 2020 09:21:02 -0400 X-MC-Unique: Kv9Ig1K7NFS8Ya33PNgGOQ-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id DEE83189E60D; Thu, 27 Aug 2020 13:21:00 +0000 (UTC) Received: from redhat.com (ovpn-114-28.rdu2.redhat.com [10.10.114.28]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E8FB61972A; Thu, 27 Aug 2020 13:20:59 +0000 (UTC) Date: Thu, 27 Aug 2020 09:20:58 -0400 From: Joe Lawrence To: Miroslav Benes Cc: jpoimboe@redhat.com, jikos@kernel.org, pmladek@suse.com, shuah@kernel.org, live-patching@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] selftests/livepatch: Do not check order when using "comm" for dmesg checking Message-ID: <20200827132058.GA24622@redhat.com> References: <20200827110709.26824-1-mbenes@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200827110709.26824-1-mbenes@suse.cz> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Aug 27, 2020 at 01:07:09PM +0200, Miroslav Benes wrote: > check_result() uses "comm" to check expected results of selftests output > in dmesg. Everything works fine if timestamps in dmesg are unique. If > not, like in this example > > [ 86.844422] test_klp_callbacks_demo: pre_unpatch_callback: test_klp_callbacks_mod -> [MODULE_STATE_LIVE] Normal state > [ 86.844422] livepatch: 'test_klp_callbacks_demo': starting unpatching transition > Heh, our assumption that the timestamps would provide sorting wasn't true after all. > , "comm" fails with "comm: file 2 is not in sorted order". Suppress the > order checking with --nocheck-order option. > > Signed-off-by: Miroslav Benes Acked-by: Joe Lawrence And not so important for selftests, but helpful for backporting efforts: Fixes: 2f3f651f3756 ("selftests/livepatch: Use "comm" instead of "diff" for dmesg") > --- > > The strange thing is, I can reproduce the issue easily and reliably on > older codestreams (4.12) but not on current upstream in my testing > environment. I think the change makes sense regardless though. > We haven't backported v5.8 changes just yet, so thanks for finding this one and posting a fix. -- Joe > tools/testing/selftests/livepatch/functions.sh | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/tools/testing/selftests/livepatch/functions.sh b/tools/testing/selftests/livepatch/functions.sh > index 1aba83c87ad3..846c7ed71556 100644 > --- a/tools/testing/selftests/livepatch/functions.sh > +++ b/tools/testing/selftests/livepatch/functions.sh > @@ -278,7 +278,7 @@ function check_result { > # help differentiate repeated testing runs. Remove them with a > # post-comparison sed filter. > > - result=$(dmesg | comm -13 "$SAVED_DMESG" - | \ > + result=$(dmesg | comm --nocheck-order -13 "$SAVED_DMESG" - | \ > grep -e 'livepatch:' -e 'test_klp' | \ > grep -v '\(tainting\|taints\) kernel' | \ > sed 's/^\[[ 0-9.]*\] //') > -- > 2.28.0 >