Automated rollback of changelist 536743330

PiperOrigin-RevId: 563224104
This commit is contained in:
Ghanan Gowripalan
2023-09-06 14:58:03 -07:00
committed by gVisor bot
parent 8aee177900
commit 2319f958fc
3 changed files with 20 additions and 2 deletions
+2
View File
@@ -1506,6 +1506,7 @@ cc_binary(
"@com_google_absl//absl/base:core_headers",
"@com_google_absl//absl/base:endian",
gtest,
"//test/util:posix_error",
"//test/util:test_main",
"//test/util:test_util",
],
@@ -1526,6 +1527,7 @@ cc_binary(
"@com_google_absl//absl/base:core_headers",
"@com_google_absl//absl/base:endian",
gtest,
"//test/util:posix_error",
"//test/util:test_main",
"//test/util:test_util",
],
+9 -1
View File
@@ -13,6 +13,7 @@
// limitations under the License.
#include <arpa/inet.h>
#include <errno.h>
#include <ifaddrs.h>
#include <net/ethernet.h>
#include <net/if.h>
@@ -34,6 +35,7 @@
#include "test/util/capability_util.h"
#include "test/util/cleanup.h"
#include "test/util/file_descriptor.h"
#include "test/util/posix_error.h"
#include "test/util/socket_util.h"
#include "test/util/test_util.h"
@@ -137,7 +139,13 @@ void CookedPacketTest::SetUp() {
ASSERT_THAT(socket_ = socket(AF_PACKET, SOCK_DGRAM, htons(GetParam())),
SyscallSucceeds());
restore_config_ = ASSERT_NO_ERRNO_AND_VALUE(AllowMartianPacketsOnLoopback());
auto restore_config = AllowMartianPacketsOnLoopback();
if (restore_config.ok()) {
restore_config_ = restore_config.ValueOrDie();
} else {
ASSERT_THAT(restore_config.error(), PosixErrorIs(EACCES));
GTEST_SKIP();
}
}
void CookedPacketTest::TearDown() {
+9 -1
View File
@@ -13,6 +13,7 @@
// limitations under the License.
#include <arpa/inet.h>
#include <errno.h>
#include <net/ethernet.h>
#include <net/if_arp.h>
#include <netinet/in.h>
@@ -34,6 +35,7 @@
#include "test/util/capability_util.h"
#include "test/util/cleanup.h"
#include "test/util/file_descriptor.h"
#include "test/util/posix_error.h"
#include "test/util/socket_util.h"
#include "test/util/test_util.h"
@@ -113,7 +115,13 @@ void RawPacketTest::SetUp() {
ASSERT_THAT(s_ = socket(AF_PACKET, SOCK_RAW, htons(GetParam())),
SyscallSucceeds());
restore_config_ = ASSERT_NO_ERRNO_AND_VALUE(AllowMartianPacketsOnLoopback());
auto restore_config = AllowMartianPacketsOnLoopback();
if (restore_config.ok()) {
restore_config_ = restore_config.ValueOrDie();
} else {
ASSERT_THAT(restore_config.error(), PosixErrorIs(EACCES));
GTEST_SKIP();
}
}
void RawPacketTest::TearDown() {