From owner-svn-src-all@freebsd.org Tue Sep 3 14:42:08 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id ED24DCDAD0; Tue, 3 Sep 2019 14:42:08 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 46N8mb49wXz47Hd; Tue, 3 Sep 2019 14:42:07 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x83Eg25h015456; Tue, 3 Sep 2019 07:42:02 -0700 (PDT) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id x83Eg2eq015455; Tue, 3 Sep 2019 07:42:02 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201909031442.x83Eg2eq015455@gndrsh.dnsmgr.net> Subject: Re: svn commit: r351643 - in head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common: dtraceUtil speculation In-Reply-To: To: Li-Wen Hsu Date: Tue, 3 Sep 2019 07:42:02 -0700 (PDT) CC: rgrimes@freebsd.org, Enji Cooper , Warner Losh , "Conrad E. Meyer" , src-committers , svn-src-all , svn-src-head Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 46N8mb49wXz47Hd X-Spamd-Bar: + Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of freebsd@gndrsh.dnsmgr.net has no SPF policy when checking 69.59.192.140) smtp.mailfrom=freebsd@gndrsh.dnsmgr.net X-Spamd-Result: default: False [1.60 / 15.00]; ARC_NA(0.00)[]; HAS_REPLYTO(0.00)[rgrimes@freebsd.org]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; NEURAL_SPAM_SHORT(0.48)[0.483,0]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; DMARC_NA(0.00)[dnsmgr.net]; AUTH_NA(1.00)[]; REPLYTO_DOM_NEQ_FROM_DOM(0.00)[]; NEURAL_SPAM_MEDIUM(0.06)[0.061,0]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_SPAM_LONG(0.11)[0.110,0]; RCPT_COUNT_SEVEN(0.00)[8]; R_SPF_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:13868, ipnet:69.59.192.0/19, country:US]; MID_RHS_MATCH_FROM(0.00)[]; IP_SCORE(0.04)[ip: (0.15), ipnet: 69.59.192.0/19(0.07), asn: 13868(0.05), country: US(-0.05)]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Sep 2019 14:42:09 -0000 > On Mon, Sep 2, 2019 at 11:49 PM Rodney W. Grimes > wrote: > > > > > > > > > On Aug 31, 2019, at 16:29, Warner Losh wrote: > > > > > > > > > > > > > > > >> On Sat, Aug 31, 2019 at 5:29 PM Conrad Meyer wrote: > > > >> Thanks Li-Wen! Might it be less fragile to have the test fixture > > > >> create a file, if the test(s) will expect one to be present to read? > > > > > > > > Or just use the realpath $0, which you know has to exist :) > > > > > > I don?t know if this would work, with other some of the dtrace tests are called. Plus, that relies on a FreeBSD utility which doesn?t necessarily exist on Linux and I don?t think exists on IllumOS. > > > > > > It makes more sense to create a file with mktemp and test for it in the loop to make the tests portable over to IllumOS, since that?s where they originally came from and can be contributed back to. > > > > Agreed, especially if these tests are expected to be portable the > > assumption of existance of /COPYRIGHT is a mistake/bug. > > Thanks for the inputs. Indeed, depending on any irrelevant files or > FreeBSD specified tools both do not sound a good solution. After > reading these test cases again, I feel that creating a temp file might > be slightly over engineering because in the end we also need to take > care of cleaning, in normal and abnormal exiting cases. In these > tests, we only need someone calls open(2) and read(2). > > How about changing them to `cat / > /dev/null` ? Does it have to be cat? dd if=/dev/zero count=1 >/dev/null seems far more portable to me. Permissions may not allow cat /, it is valid to run chmod 511 / > Best, > Li-Wen > -- Rod Grimes rgrimes@freebsd.org