Remove BpfBaseTest processgroup test.

In practice this has to pass already due to netd_updatable
init attaching BPF_CGROUP_INET_{E,IN}GRESS programs.

This allows removing the processgroup shared lib dependency,
which should allow switching it from C to C++ mangling.

Thus we might be able to revert the revert (ie. reapply):
  https://android-review.googlesource.com/c/platform/system/core/+/3366140
in
  https://android-review.googlesource.com/c/platform/system/core/+/3369297

Test: TreeHugger
Bug: 379796721
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I865d6705e4a6477d428261ef182173df1f5b4672
This commit is contained in:
Maciej Żenczykowski 2024-11-20 19:32:07 +00:00
commit eb85ea5f2a
3 changed files with 1 additions and 9 deletions

View file

@ -82,7 +82,6 @@ cc_test {
"libcutils",
"liblog",
"libnetdutils",
"libprocessgroup",
],
compile_multilib: "both",
multilib: {

View file

@ -29,7 +29,6 @@
#include <gtest/gtest.h>
#include <cutils/qtaguid.h>
#include <processgroup/processgroup.h>
#include <android-base/stringprintf.h>
#include <android-base/strings.h>
@ -54,13 +53,6 @@ class BpfBasicTest : public NetNativeTestBase {
BpfBasicTest() {}
};
TEST_F(BpfBasicTest, TestCgroupMounted) {
std::string cg2_path;
ASSERT_EQ(true, CgroupGetControllerPath(CGROUPV2_HIERARCHY_NAME, &cg2_path));
ASSERT_EQ(0, access(cg2_path.c_str(), R_OK));
ASSERT_EQ(0, access((cg2_path + "/cgroup.controllers").c_str(), R_OK));
}
TEST_F(BpfBasicTest, TestTagSocket) {
BpfMap<uint64_t, UidTagValue> cookieTagMap(COOKIE_TAG_MAP_PATH);
ASSERT_TRUE(cookieTagMap.isValid());

View file

@ -97,6 +97,7 @@ static Status initPrograms(const char* cg2_path) {
ALOGE("Failed to open the cgroup directory: %s", strerror(err));
return statusFromErrno(err, "Open the cgroup directory failed");
}
RETURN_IF_NOT_OK(checkProgramAccessible(XT_BPF_ALLOWLIST_PROG_PATH));
RETURN_IF_NOT_OK(checkProgramAccessible(XT_BPF_DENYLIST_PROG_PATH));
RETURN_IF_NOT_OK(checkProgramAccessible(XT_BPF_EGRESS_PROG_PATH));