From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by passt.top (Postfix) with ESMTP id 848D55A026E for ; Thu, 25 Apr 2024 00:01:53 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1713996112; 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=C08sD9Eqt6xWIRz2P5dHep2OfrR1R8XoU+c+z9TvXKs=; b=ILlQ3j0d2NNuKUmHir3sLQjyd7fwqVMPuI/VlYdqyd8a1PKi02LD4ft8SMnTFGPSYpocGo b2eZVg+TK00GdYUcfL4lpBiwoJbzINHYGDZaUwZRYUluEdzvbGzJcCgpi4TnSH/q2JYGdG f6rIct5mxc6kqgufNUYYa+Trkj/7CRI= Received: from mail-ed1-f69.google.com (mail-ed1-f69.google.com [209.85.208.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-513-WqGgooejPPWfVJpooavd1Q-1; Wed, 24 Apr 2024 18:01:50 -0400 X-MC-Unique: WqGgooejPPWfVJpooavd1Q-1 Received: by mail-ed1-f69.google.com with SMTP id 4fb4d7f45d1cf-5684bf1440dso58122a12.3 for ; Wed, 24 Apr 2024 15:01:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713996109; x=1714600909; h=content-transfer-encoding:mime-version:organization:references :in-reply-to:message-id:subject:cc:to:from:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=C08sD9Eqt6xWIRz2P5dHep2OfrR1R8XoU+c+z9TvXKs=; b=cQMa2mhX5KP50FwwyDMGlqgRBJI4wMc2jNtRJDp0WFDEPh968vjZDYR8zCGwr063ft VbQ3KRgaMqwMwqIwB8/0AD5r/j8cWbCat5tX3mdMHzKtuWXj+gBdWOitAgPSmaM23HbY ISiw5IlVWUOIAF4PLCyAiUbt0RJanTA7D7vGxe/vC8tVwj5VFBCSajuKlPbpp7+bt0r9 RUcOXBdivmyBSSeWxjItBw44+GgeBE+ON39pLVN6jRFAjmHyqEEoEn3jK9EbfDwMxZLO LR6s7j5m6G3EfOJAMNi6wD4/CSw2PFtGo2KGVTFUYQ+o42lne6I7QAGLjFZE0E6xSSSa /abA== X-Gm-Message-State: AOJu0YyXcxrUKDzUSM9AJLDKyH1951TIkttvx6ZSZmc1hkQNZ7JHK2X2 DCidODAk/UL8zNCgqExdYnk2mw0zz647ICLjpeN21d2/7WmKqQp1jRYids0iICVoSs1l8bzkLwI hSBI4WKF3pmavfR6pqv4Z7w7GQXxwfo1dknZAo+pcbR5DXemEi3ECyElccqwl X-Received: by 2002:a50:cdc3:0:b0:56e:22b6:d924 with SMTP id h3-20020a50cdc3000000b0056e22b6d924mr2463968edj.13.1713996108929; Wed, 24 Apr 2024 15:01:48 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH3yJa3aa8sV/VLWDG550pGlssQZSrhEGq+wP9gRZFY43bSdveQF/Rm80qbcLQQ2z57+Rkcag== X-Received: by 2002:a50:cdc3:0:b0:56e:22b6:d924 with SMTP id h3-20020a50cdc3000000b0056e22b6d924mr2463950edj.13.1713996108279; Wed, 24 Apr 2024 15:01:48 -0700 (PDT) Received: from maya.cloud.tilaa.com (maya.cloud.tilaa.com. [164.138.29.33]) by smtp.gmail.com with ESMTPSA id h25-20020a0564020e9900b0056bc0c44f02sm8251370eda.96.2024.04.24.15.01.47 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 24 Apr 2024 15:01:47 -0700 (PDT) Date: Thu, 25 Apr 2024 00:01:00 +0200 From: Stefano Brivio To: David Gibson Subject: Re: [PATCH 2/2] test: Make log truncation test more robust Message-ID: <20240425000100.23624505@elisabeth> In-Reply-To: <20240424043000.1485776-3-david@gibson.dropbear.id.au> References: <20240424043000.1485776-1-david@gibson.dropbear.id.au> <20240424043000.1485776-3-david@gibson.dropbear.id.au> Organization: Red Hat X-Mailer: Claws Mail 4.2.0 (GTK 3.24.36; x86_64-pc-linux-gnu) MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-ID-Hash: Q4DN4ECPZATYIG5CZVHCN5BCJFMJSLPD X-Message-ID-Hash: Q4DN4ECPZATYIG5CZVHCN5BCJFMJSLPD X-MailFrom: sbrivio@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: passt-dev@passt.top X-Mailman-Version: 3.3.8 Precedence: list List-Id: Development discussion and patches for passt Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On Wed, 24 Apr 2024 14:30:00 +1000 David Gibson wrote: > test/pasta_options/log_to_file checks that pasta truncates its log file > when started. It does that by starting pasta with a log file once, then > starting it again and checking that after the second round, the log file > has only one line: the startup banner from the second invocation. > > However, this test will break if the second invocation logs any additional > messages at startup. This can easily happen on a host with multiple > network interfaces due to the "Multiple default route" informational > messages added in 639fdf06e ("netlink: Fix selection of template > interface"). I believe it could also happen on a host without IPv6 > connectivity due to the "Couldn't pick external interface" messages, though > I haven't confirmed this. > > Make the log file test more robust, by not testing for a single line, but > instead explicitly testing for the PID of the second pasta invocation in > the banner line. > > Link: https://bugs.passt.top/show_bug.cgi?id=88 > > Signed-off-by: David Gibson > --- > test/pasta_options/log_to_file | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > > diff --git a/test/pasta_options/log_to_file b/test/pasta_options/log_to_file > index f1002167..fe50e50b 100644 > --- a/test/pasta_options/log_to_file > +++ b/test/pasta_options/log_to_file > @@ -37,8 +37,9 @@ passt ./pasta -l __LOG_FILE__ -- /bin/true > check [ -s __LOG_FILE__ ] > > test Log truncated on creation > -passt ./pasta -l __LOG_FILE__ -- /bin/true > -check [ $(cat __LOG_FILE__ | wc -l) -eq 1 ] > +passt ./pasta -l __LOG_FILE__ -- /bin/true & wait > +pout PID2 echo $! > +check head -1 __LOG_FILE__ | grep '^pasta .* [(]__PID2__[)]$' ^^^^^^^^^^^^^^ I'm mildly amused that this actually works. :) -- Stefano