Page MenuHomeFreeBSD

kyua: Pass unprivileged user config prop to ATF using all known names
AcceptedPublic

Authored by igoro on Mon, Feb 17, 11:16 PM.
Tags
None
Referenced Files
F110708680: D49039.diff
Sat, Feb 22, 4:00 AM
F110700329: D49039.diff
Sat, Feb 22, 1:41 AM
Unknown Object (File)
Thu, Feb 20, 4:24 PM
Unknown Object (File)
Thu, Feb 20, 3:43 PM
Unknown Object (File)
Thu, Feb 20, 12:43 PM
Unknown Object (File)
Thu, Feb 20, 12:40 PM
Unknown Object (File)
Thu, Feb 20, 11:05 AM
Unknown Object (File)
Thu, Feb 20, 7:43 AM

Details

Reviewers
asomers
ngie
Group Reviewers
tests
Summary

Kyua and ATF speak different naming styles. In this case, an
unprivileged user property can be named with underscore on the Kyua
side, and with a minus on the ATF side. Sometimes it is not obvious
which style should be used in which situation. For instance, a test case
may require this configuration property being set using require.config.
Also, a test case may want to read the property using something like
atf_tc_get_config_var(). Which names should be used in these cases?
From the perspective of the original code, it is expected to be this:

require.config unprivileged-user
atf_tc_get_config_var(tc, "unprivileged-user")

But, as long as Kyua is the main interface, its users expect to work
with kyua.conf(5), which says that it must be named as uprivileged_user
(with underscore). As a result, test authors tend to this instead:

require.config unprivileged_user
atf_tc_get_config_var(tc, "unprivileged_user")

Kyua already has hacks to understand both unprivileged_user and
unprivileged-user coming from require.config. And this patch covers the
missing second part -- make Kyua pass both names back to ATF as two
identical configuration properties named different ways.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 62512
Build 59396: arc lint + arc unit

Event Timeline

I guess it could be helpful for a couple of test cases from tests/sys/netinet/fibs_multibind_test.c and/or tests/sys/netinet/socket_afinet.c.

asomers added a subscriber: asomers.

LGTM. Except that the commit message contains a typo: "uprivileged_user" => "unprivileged_user"

This revision is now accepted and ready to land.Mon, Feb 17, 11:26 PM

It's worth a comment in the src as well

LGTM. Except that the commit message contains a typo: "uprivileged_user" => "unprivileged_user"

Nice catch! Thank you.

It's worth a comment in the src as well

The whole if block has a comment since 2014, but here we have, kind of, two separate hacks at the same time, so, indeed, it's much better to provide explicit confirmation that it is duplicated on purpose. Many thanks!

Add the respective code comment

This revision now requires review to proceed.Tue, Feb 18, 11:22 PM
This revision is now accepted and ready to land.Fri, Feb 21, 1:34 AM

This ideally should have a test added for it (along with the other ATF <-> Kyua variable parity improvements you made).