summaryrefslogtreecommitdiffhomepage
path: root/test/syscalls
diff options
context:
space:
mode:
authorZyad A. Ali <zyad.ali.me@gmail.com>2021-09-07 20:52:55 +0200
committerZyad A. Ali <zyad.ali.me@gmail.com>2021-09-27 19:51:11 +0200
commit82e2e89405332088d60a997ce55e9cbeb4613ea2 (patch)
tree35c75ea70aec1446a9fa96fe4c93b94720381e4f /test/syscalls
parent2e25547e047f69dbfd24465459626351f8b22d55 (diff)
Add procfs files for SysV message queues.
Diffstat (limited to 'test/syscalls')
-rw-r--r--test/syscalls/linux/proc_isolated.cc24
1 files changed, 23 insertions, 1 deletions
diff --git a/test/syscalls/linux/proc_isolated.cc b/test/syscalls/linux/proc_isolated.cc
index a38689667..4ec9b503c 100644
--- a/test/syscalls/linux/proc_isolated.cc
+++ b/test/syscalls/linux/proc_isolated.cc
@@ -12,12 +12,13 @@
// 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>
-#include "gtest/gtest.h"
#include "absl/strings/numbers.h"
#include "absl/strings/str_split.h"
+#include "gtest/gtest.h"
#include "test/util/fs_util.h"
#include "test/util/test_util.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