A few fixes to run tests on 6.2+ kernels

* disable broken socket_inet_loopback test // Lucas Manning
* disable lseek tests on anon inodes. They have been broken by
commit e7478158e1378325907edfdd960eca98a1be405b
Date:   Wed Jun 29 15:06:57 2022 +0200
    fs: clear or set FMODE_LSEEK based on llseek function

* don't check memory.kmem.limit_in_bytes, it has been deprecated and dropped:
commit 86327e8eb94c52eca4f93cfece2e29d1bf52acbf
Date:   Tue Jul 4 13:52:40 2023 +0200
    memcg: drop kmem.limit_in_bytes
commit 58056f77502f3567b760c9a8fc8d2e9081515b2d
Date:   Fri Nov 5 13:37:44 2021 -0700
    memcg, kmem: further deprecate kmem.limit_in_bytes
commit 0158115f702b0ba208ab0b5adf44cae99b3ebcc7
Date:   Mon Sep 23 15:37:22 2019 -0700
    memcg, kmem: deprecate kmem.limit_in_bytes
PiperOrigin-RevId: 562915457
This commit is contained in:
Lucas Manning
2023-09-05 15:51:21 -07:00
committed by gVisor bot
parent c2a7efe6a2
commit e0029cc0ff
6 changed files with 19 additions and 15 deletions
-11
View File
@@ -203,13 +203,6 @@ func TestCgroupV1(t *testing.T) {
file: "cpu.cfs_quota_us",
want: "3000",
},
{
field: "kernel-memory",
value: 100 << 20,
ctrl: "memory",
file: "memory.kmem.limit_in_bytes",
want: "104857600",
},
{
field: "memory",
value: 1 << 30,
@@ -270,8 +263,6 @@ func TestCgroupV1(t *testing.T) {
hostconf.Resources.CPUPeriod = attr.value
case "cpu-quota":
hostconf.Resources.CPUQuota = attr.value
case "kernel-memory":
hostconf.Resources.KernelMemory = attr.value
case "memory":
hostconf.Resources.Memory = attr.value
case "memory-reservation":
@@ -440,8 +431,6 @@ func TestCgroupV2(t *testing.T) {
hostconf.Resources.CPUQuota = defaultTestCPUQuota
case "cpu-quota":
hostconf.Resources.CPUQuota = attr.value
case "kernel-memory":
hostconf.Resources.KernelMemory = attr.value
case "memory":
hostconf.Resources.Memory = attr.value
case "memory-reservation":
+3
View File
@@ -101,6 +101,9 @@ TEST(EventfdTest, SmallRead) {
}
TEST(EventfdTest, IllegalSeek) {
// TODO: b/298787679 - this test fails on 6.0+ kernels.
SKIP_IF(!IsRunningOnGvisor());
FileDescriptor efd = ASSERT_NO_ERRNO_AND_VALUE(NewEventFD(0, 0));
EXPECT_THAT(lseek(efd.get(), 0, SEEK_SET), SyscallFailsWithErrno(ESPIPE));
}
+1 -1
View File
@@ -652,7 +652,7 @@ TEST_F(FlockTest, BlockingLockFirstExclusiveSecondExclusive) {
TEST(FlockTestNoFixture, BadFD) {
// EBADF: fd is not an open file descriptor.
ASSERT_THAT(flock(-1, 0), SyscallFailsWithErrno(EBADF));
ASSERT_THAT(flock(-1, LOCK_UN), SyscallFailsWithErrno(EBADF));
}
TEST(FlockTestNoFixture, FlockDir) {
+3
View File
@@ -333,6 +333,9 @@ PosixErrorOr<int> InotifyAddWatch(int fd, const std::string& path,
}
TEST(Inotify, IllegalSeek) {
// TODO: b/298787679 - this test fails on 6.0+ kernels.
SKIP_IF(!IsRunningOnGvisor());
const FileDescriptor fd = ASSERT_NO_ERRNO_AND_VALUE(InotifyInit1(0));
EXPECT_THAT(lseek(fd.get(), 0, SEEK_SET), SyscallFailsWithErrno(ESPIPE));
}
+9 -3
View File
@@ -1868,7 +1868,9 @@ INSTANTIATE_TEST_SUITE_P(
using SocketMultiProtocolInetLoopbackTest =
::testing::TestWithParam<ProtocolTestParam>;
TEST_P(SocketMultiProtocolInetLoopbackTest, V4MappedLoopbackOnlyReservesV4) {
// TODO: b/298680322 - Investigate why this fails on newer kernel versions.
TEST_P(SocketMultiProtocolInetLoopbackTest,
DISABLED_V4MappedLoopbackOnlyReservesV4) {
ProtocolTestParam const& param = GetParam();
for (int i = 0; true; i++) {
@@ -1917,7 +1919,9 @@ TEST_P(SocketMultiProtocolInetLoopbackTest, V4MappedLoopbackOnlyReservesV4) {
}
}
TEST_P(SocketMultiProtocolInetLoopbackTest, V4MappedAnyOnlyReservesV4) {
// TODO: b/298680322 - Investigate why this fails on newer kernel versions.
TEST_P(SocketMultiProtocolInetLoopbackTest,
DISABLED_V4MappedAnyOnlyReservesV4) {
ProtocolTestParam const& param = GetParam();
for (int i = 0; true; i++) {
@@ -2310,7 +2314,9 @@ TEST_P(SocketMultiProtocolInetLoopbackTest, V6EphemeralPortReserved) {
}
}
TEST_P(SocketMultiProtocolInetLoopbackTest, V4MappedEphemeralPortReserved) {
// TODO: b/298680322 - Investigate why this fails on newer kernel versions.
TEST_P(SocketMultiProtocolInetLoopbackTest,
DISABLED_V4MappedEphemeralPortReserved) {
ProtocolTestParam const& param = GetParam();
for (int i = 0; true; i++) {
+3
View File
@@ -218,6 +218,9 @@ TEST_P(TimerfdTest, SetToPastExpiresEventually) {
}
TEST_P(TimerfdTest, IllegalSeek) {
// TODO: b/298787679 - this test fails on 6.0+ kernels.
SKIP_IF(!IsRunningOnGvisor());
auto const tfd = ASSERT_NO_ERRNO_AND_VALUE(TimerfdCreate(GetParam(), 0));
EXPECT_THAT(lseek(tfd.get(), 0, SEEK_SET), SyscallFailsWithErrno(ESPIPE));
}