add getClatEgressProgFd() with tests
Test: atest
Bug: 139396664
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I966c873e1dd46dc1030cbbdb14d1b2f4640ec1ae
diff --git a/server/ClatUtilsTest.cpp b/server/ClatUtilsTest.cpp
index 77b22a1..b1a265b 100644
--- a/server/ClatUtilsTest.cpp
+++ b/server/ClatUtilsTest.cpp
@@ -73,6 +73,22 @@
close(fd);
}
+TEST_F(ClatUtilsTest, GetClatEgressRawIpProgFd) {
+ SKIP_IF_BPF_NOT_SUPPORTED;
+
+ int fd = getClatEgressProgFd(false);
+ ASSERT_LE(3, fd);
+ close(fd);
+}
+
+TEST_F(ClatUtilsTest, GetClatEgressEtherProgFd) {
+ SKIP_IF_BPF_NOT_SUPPORTED;
+
+ int fd = getClatEgressProgFd(true);
+ ASSERT_LE(3, fd);
+ close(fd);
+}
+
TEST_F(ClatUtilsTest, GetClatIngressMapFd) {
SKIP_IF_BPF_NOT_SUPPORTED;
@@ -81,7 +97,7 @@
close(fd);
}
-TEST_F(ClatUtilsTest, GetClatRawIpProgFd) {
+TEST_F(ClatUtilsTest, GetClatIngressRawIpProgFd) {
SKIP_IF_BPF_NOT_SUPPORTED;
int fd = getClatIngressProgFd(false);
@@ -89,7 +105,7 @@
close(fd);
}
-TEST_F(ClatUtilsTest, GetClatEtherProgFd) {
+TEST_F(ClatUtilsTest, GetClatIngressEtherProgFd) {
SKIP_IF_BPF_NOT_SUPPORTED;
int fd = getClatIngressProgFd(true);