NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: lib/55452: ATF should not call clean-up routines for skipped tests



On Fri, Jul 03, 2020 at 08:39:48AM -0700, Paul Goyette wrote:
> >...  the same
> > skip-declarations need to be duplicated to the clean-up routines.
> 
> You still need to clean-up anything that might have been done
> in the test-case's *_head() routine...

True enough, and the noted sysctl/random_garbage is one such case. Though, 
I wonder why the skip-declarations are not done in the head-routines? Well,
the answer is simple at least for atf-sh-api(3):

atf_test_case random_garbage cleanup
random_garbage_head() {
        sysctl -a > $tmp
        atf_set "require.user" "root"
        atf_set "descr" "Test writing random garbage " \
                "to sysctl nodes (PR kern/55451)"
}

So perhaps the correct approach would be to declare these in the
init-routine; cf. the following or something alike:

atf_init_test_cases() {
        atf_add_test_case random_garbage atf_skip "PR kern/55451"
}

But I guess it is easier to just duplicate the skip-declarations for the
time being.

- Jukka

PS. It would be nice to also have a field in the API for PR-references.


Home | Main Index | Thread Index | Old Index