From owner-svn-src-all@freebsd.org Tue Sep 3 10:42:14 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 77B66D5E80; Tue, 3 Sep 2019 10:42:14 +0000 (UTC) (envelope-from lwhsu.freebsd@gmail.com) Received: from mail-yw1-f48.google.com (mail-yw1-f48.google.com [209.85.161.48]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N3Rp2Qr9z48yx; Tue, 3 Sep 2019 10:42:13 +0000 (UTC) (envelope-from lwhsu.freebsd@gmail.com) Received: by mail-yw1-f48.google.com with SMTP id 129so4983952ywb.8; Tue, 03 Sep 2019 03:42:13 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=SBvS1/j76CcIiPu14OTGanQa2aZPyrXsrPE+ELIbHLs=; b=CXKqGDGr7Y1nWgq47LCD7nYFFw1qMOpvBE8OelEk7y4n4grqBceSW9FinWuMEEKh6l abN0Sqe2BgPRIGPMNm9fXU52IG1Z2Q2y7R//v5I2DBeb+3RGhQI4hB6byuEM4WOHCyY3 Q+wJSUQVmgezTSYL2jYkqcQoIlOrPsr4PzX3hJ82hOcWGfaGHw3DA550mjUQXKlColin 5HqI/vKCbIZEBlEit6vZeAhJloFC9bsvrFdJlYftcfVGKx8QL4/IVxnDkt8aaJFhHROr HF10LylhsWT9yTBXSAMfXxIAFKLQnqy+ez3vr8D2NIzYFSLlUJQKZCO9dF7lUWzxymtL 3KIA== X-Gm-Message-State: APjAAAXYlJxg/dxzACOAzIDP4QYHljEgCSxXxVqGKhNkNZCMbSLEfCpk fskIrTepmpkRvVPkTicQBtAbsXX4xx0N8UOBQYS5g/C+ X-Google-Smtp-Source: APXvYqzb9ef+3ltFEwk4beDbroF5Ih4+FTusxtiou2YAHGDjNuq0lhC3QdOUE8g7BCRgqYdzYwqsMyqKYi1Et9rTG7c= X-Received: by 2002:a81:9885:: with SMTP id p127mr25387221ywg.380.1567507332454; Tue, 03 Sep 2019 03:42:12 -0700 (PDT) MIME-Version: 1.0 References: <201909021549.x82FndM9009860@gndrsh.dnsmgr.net> In-Reply-To: <201909021549.x82FndM9009860@gndrsh.dnsmgr.net> From: Li-Wen Hsu Date: Tue, 3 Sep 2019 18:42:00 +0800 Message-ID: Subject: Re: svn commit: r351643 - in head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common: dtraceUtil speculation To: rgrimes@freebsd.org Cc: Enji Cooper , Warner Losh , "Conrad E. Meyer" , src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 46N3Rp2Qr9z48yx X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.980,0]; REPLY(-4.00)[]; TAGGED_FROM(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] 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 10:42:14 -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` ? Best, Li-Wen