Commit cef064fd authored by Rae Moar's avatar Rae Moar Committed by Greg Kroah-Hartman
Browse files

apparmor: test: make static symbols visible during kunit testing



[ Upstream commit b11e51dd ]

Use macros, VISIBLE_IF_KUNIT and EXPORT_SYMBOL_IF_KUNIT, to allow
static symbols to be conditionally set to be visible during
apparmor_policy_unpack_test, which removes the need to include the testing
file in the implementation file.

Change the namespace of the symbols that are now conditionally visible (by
adding the prefix aa_) to avoid confusion with symbols of the same name.

Allow the test to be built as a module and namespace the module name from
policy_unpack_test to apparmor_policy_unpack_test to improve clarity of
the module name.

Provide an example of how static symbols can be dealt with in testing.

Signed-off-by: default avatarRae Moar <rmoar@google.com>
Reviewed-by: default avatarDavid Gow <davidgow@google.com>
Acked-by: default avatarJohn Johansen <john.johansen@canonical.com>
Signed-off-by: default avatarShuah Khan <skhan@linuxfoundation.org>
Stable-dep-of: 8884ba07 ("apparmor: fix invalid reference on profile->disconnected")
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent cfce1e26
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment