diff options
author | gVisor bot <gvisor-bot@google.com> | 2021-10-01 12:04:17 -0700 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2021-10-01 12:04:17 -0700 |
commit | eac4d9ab2ae6d5df294ac2c0b31af57552695936 (patch) | |
tree | 0fc2ac9ba55c3672f7f4f6de65e9fb161226bcdc /test | |
parent | 788bbc2904983417efe430cc5c66b3af990d3bfe (diff) | |
parent | 82e2e89405332088d60a997ce55e9cbeb4613ea2 (diff) |
Merge pull request #6551 from sudo-sturbia:msgqueue/procfs
PiperOrigin-RevId: 400258924
Diffstat (limited to 'test')
-rw-r--r-- | test/syscalls/linux/proc_isolated.cc | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/test/syscalls/linux/proc_isolated.cc b/test/syscalls/linux/proc_isolated.cc index a38689667..38d079d2b 100644 --- a/test/syscalls/linux/proc_isolated.cc +++ b/test/syscalls/linux/proc_isolated.cc @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include <linux/msg.h> #include <linux/sem.h> #include <linux/shm.h> @@ -73,6 +74,27 @@ TEST(ProcDefaults, PresenceOfSem) { ASSERT_EQ(semmni, SEMMNI); } +TEST(ProcDefaults, PresenceOfMsgMniMaxMnb) { + uint64_t msgmni = 0; + uint64_t msgmax = 0; + uint64_t msgmnb = 0; + + std::string proc_file; + proc_file = ASSERT_NO_ERRNO_AND_VALUE(GetContents("/proc/sys/kernel/msgmni")); + ASSERT_FALSE(proc_file.empty()); + ASSERT_TRUE(absl::SimpleAtoi(proc_file, &msgmni)); + proc_file = ASSERT_NO_ERRNO_AND_VALUE(GetContents("/proc/sys/kernel/msgmax")); + ASSERT_FALSE(proc_file.empty()); + ASSERT_TRUE(absl::SimpleAtoi(proc_file, &msgmax)); + proc_file = ASSERT_NO_ERRNO_AND_VALUE(GetContents("/proc/sys/kernel/msgmnb")); + ASSERT_FALSE(proc_file.empty()); + ASSERT_TRUE(absl::SimpleAtoi(proc_file, &msgmnb)); + + ASSERT_EQ(msgmni, MSGMNI); + ASSERT_EQ(msgmax, MSGMAX); + ASSERT_EQ(msgmnb, MSGMNB); +} + } // namespace } // namespace testing } // namespace gvisor |