Re: [PATCH bpf-next v2 5/5] selftests/bpf: Add test for "bpftool feature" command

From: Quentin Monnet
Date: Tue Feb 25 2020 - 09:54:48 EST


2020-02-25 14:55 UTC+0100 ~ Michal Rostecki <mrostecki@xxxxxxxxxxxx>
On 2/21/20 12:28 PM, Quentin Monnet wrote:
+ÂÂÂ @default_iface
+ÂÂÂ def test_feature_dev(self, iface):
+ÂÂÂÂÂÂÂ expected_patterns = [
+ÂÂÂÂÂÂÂÂÂÂÂ SECTION_SYSCALL_CONFIG_PATTERN,
+ÂÂÂÂÂÂÂÂÂÂÂ SECTION_PROGRAM_TYPES_PATTERN,
+ÂÂÂÂÂÂÂÂÂÂÂ SECTION_MAP_TYPES_PATTERN,
+ÂÂÂÂÂÂÂÂÂÂÂ SECTION_HELPERS_PATTERN,
+ÂÂÂÂÂÂÂÂÂÂÂ SECTION_MISC_PATTERN,
+ÂÂÂÂÂÂÂ ]

Mixed feeling on the tests with plain output, as we keep telling people
that plain output should not be parsed (not reliable, may change). But
if you want to run one or two tests with it, why not, I guess.

I thought about that and yes, testing the plain output is probably
redundant and makes those tests less readable. However, the only plain
output test which I would like to keep there is test_feature_macros -
because I guess that we are not planning to change names or patterns of
generated macros (or if so, we should test that change).


I did not mentally include the header/macros output in âplain outputâ, but yeah I guess I was not explicit on this one. So: Agreed, with âmacrosâ it should not change and it is welcome in the tests, feel free to keep it :)

Quentin