On Tue, Aug 26, 2014 at 3:32 PM, Garrett Cooper <yaneurab...@gmail.com> wrote:
> On Tue, Aug 26, 2014 at 1:51 PM, Alan Somers <asom...@freebsd.org> wrote:
>> On Tue, Aug 26, 2014 at 1:48 PM, Garrett Cooper <yaneurab...@gmail.com> 
>> wrote:
>>>
>>>> On Aug 26, 2014, at 12:45, Alan Somers <asom...@freebsd.org> wrote:
>>>>
>>>>> On Tue, Aug 26, 2014 at 1:39 PM, Mark Felder <f...@freebsd.org> wrote:
>>>>> August 26 2014 10:21 AM, "Alan Somers" <asom...@freebsd.org> 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
_______________________________________________
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"

Reply via email to