From owner-freebsd-current@FreeBSD.ORG Tue Aug 26 21:43:22 2014 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3371AC1B; Tue, 26 Aug 2014 21:43:22 +0000 (UTC) Received: from mail-wg0-x22a.google.com (mail-wg0-x22a.google.com [IPv6:2a00:1450:400c:c00::22a]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 042163248; Tue, 26 Aug 2014 21:43:20 +0000 (UTC) Received: by mail-wg0-f42.google.com with SMTP id l18so14894332wgh.1 for ; Tue, 26 Aug 2014 14:43:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=rpQwY8SC6sgiBDuUNk7iu8fscLdTepdERe0PKJ81kFY=; b=jVKOo2NvwOzdE8bG20pMOC5hy6+YqOWAPd9NVrDQvp7G0WpafjmTs2Glkxu7DsHMAG HubL50fqhOhJJGJ/IcgkuRj5mU63yNKAZ+PAQ2lk+lfb/IHP1XTuVzi2JfQbNk+jhi6W 9j6iTUZRmcQKBxFSpH3TRDsYrpCGw+1C3R5sNI9Q4RwycpJfBSj191VXUsUXL+rcBzua yYzM0afZlfBDCNSo3ZJufrmCzI/03u3J5m42uRPwotG5YJacaX7ZQUIzmTYGt2Q/B6DB VtG0lFOSJ6ECmrjqNiSoVxu0lG42sG7CRsPzxfDTepDANqZ56wG3NvyUHiZ8jjN4dNZI CuJA== MIME-Version: 1.0 X-Received: by 10.180.14.74 with SMTP id n10mr19793266wic.50.1409089399138; Tue, 26 Aug 2014 14:43:19 -0700 (PDT) Sender: asomers@gmail.com Received: by 10.194.126.1 with HTTP; Tue, 26 Aug 2014 14:43:19 -0700 (PDT) In-Reply-To: References: <5256B761.4050301@gmail.com> <1381421583.19140.32451849.084D8E32@webmail.messagingengine.com> <5256E2D5.4060101@allanjude.com> <1387388390.28188.61199633.413D38F8@webmail.messagingengine.com> <53A7CE1B.7090400@gmail.com> <8e598a07cf5bc8690749120295936c40@mail.feld.me> <73E03261-8087-415A-BD04-EAADFF90C080@gmail.com> Date: Tue, 26 Aug 2014 15:43:19 -0600 X-Google-Sender-Auth: qepXNefodEErOgQeTrG4yx3KZ88 Message-ID: Subject: Re: FreeBSD 10 and zfsd From: Alan Somers To: Garrett Cooper Content-Type: text/plain; charset=UTF-8 Cc: Johan Hendriks , Julio Merino , FreeBSD CURRENT , Alan Somers X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Aug 2014 21:43:22 -0000 On Tue, Aug 26, 2014 at 3:32 PM, Garrett Cooper wrote: > On Tue, Aug 26, 2014 at 1:51 PM, Alan Somers wrote: >> On Tue, Aug 26, 2014 at 1:48 PM, Garrett Cooper wrote: >>> >>>> On Aug 26, 2014, at 12:45, Alan Somers wrote: >>>> >>>>> On Tue, Aug 26, 2014 at 1:39 PM, Mark Felder wrote: >>>>> August 26 2014 10:21 AM, "Alan Somers" wrote: >>>>>> >>>>>> Merged into the projects/zfsd/head branch by change 270604. Merging >>>>>> to head is blocked by three issues: >>>>>> a) The atf-ksh93 hack. The correct solution is to modify all the test >>>>>> programs (not the test cases) so they can run under /bin/sh. That >>>>>> will take some effort. >>>>> >>>>> Can you provide a link to the atf-ksh93 code? >>>> >>>> There's not much to it. It simply sets an environment variable and >>>> calls atf-sh. What's more interesting is libtest.kshlib. In order to >>>> eliminate atf-ksh93, we would need to modify libtest.kshlib to run >>>> under /bin/sh. Alternatively, it may be easier to split >>>> libtest.kshlib into two files: a small /bin/sh-compatible that can be >>>> sourced by the ATF test programs, and a ksh93 script that only needs >>>> to be sourced by the ATF test cases. >>> >>> I'm working on integrating the dtrace testcases into kyua, then atf under Kyua as time permits, but I'm not rewriting the core test code (yet), because I want to reduce divergence with upstream. >>> >>> Why not just require ksh93 from ports? >> >> It's not that simple. It's certainly possible to put a "require.progs >> ksh93" in the test case header. But you also need to use ksh93 >> features before invoking the test case script. For example, see >> zpool_upgrade_004_pos_body in >> tests/sys/cddl/zfs/tests/cli_root/zpool_upgrade/zpool_upgrade_test.sh >> . Notice how it sources some .kshlib scripts, then checks the $KEEP >> variable. Other tests do similar things. Perhaps they could be fixed >> by wrapping those lines in a here document that gets fed to ksh93. >> But that's very ugly. I'd rather fix all the tests to not require >> ksh93 before invoking the separate test case script. >> >> If you change the interpreter script from atf-ksh93 to atf-sh, you'll >> see errors like this: >> >> # kyua debug zfsd_test:zfsd_import_001_pos >> set: Illegal option -A >> set: Illegal option -A >> zfsd_test:zfsd_import_001_pos -> broken: Premature exit; test case >> exited with code 2 > > This should be plugged into kyua-testers though instead of hacking > around ATF -- even if it's mostly a thin layer on top of the ATF > tester; we should work towards a common goal with the DTrace/ZFS > testing though because they sort of follow the same design patterns. > My mentor jmmv@ might have valuable input to provide here in what > should be done (I've CCed him). Adding a ksh93 tester to Kyua was previously discussed on kyua-discuss. But it was basically shot down. https://groups.google.com/forum/#!topic/kyua-discuss/w8oJHeZXuro Porting, in whole or in part, the tests to /bin/sh is time consuming, but it's the only option that satisfies everyone. -Alan