Skip to content

Commit 4c2d043

Browse files
opensearch-trigger-bot[bot]github-actions[bot]Rajat Gupta
authored
Add Seccomp and Reboot call tests (#18165) (#18182)
(cherry picked from commit 47f9bdb) Signed-off-by: Rajat Gupta <gptrajat@amazon.com> Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Rajat Gupta <gptrajat@amazon.com>
1 parent c0f4705 commit 4c2d043

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

qa/systemd-test/src/test/java/org/opensearch/systemdinteg/SystemdIntegTests.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,17 @@ public void testFileDescriptorLimit() throws IOException, InterruptedException {
135135
limits.contains("Max open files unlimited unlimited"));
136136
}
137137

138+
public void testSeccompEnabled() throws IOException, InterruptedException {
139+
// Check if Seccomp is enabled
140+
String seccomp = executeCommand("sudo su -c 'grep Seccomp /proc/" + opensearchPid + "/status'", "Failed to read Seccomp status");
141+
assertFalse("Seccomp should be enabled", seccomp.contains("0"));
142+
}
143+
144+
public void testRebootSysCall() throws IOException, InterruptedException {
145+
String rebootResult = executeCommand("sudo su opensearch -c 'kill -s SIGHUP 1' 2>&1 || echo 'Operation not permitted'", "Failed to test reboot system call");
146+
assertTrue("Reboot system call should be blocked", rebootResult.contains("Operation not permitted"));
147+
}
148+
138149
public void testOpenSearchProcessCannotExit() throws IOException, InterruptedException {
139150

140151
String scriptPath;

0 commit comments

Comments
 (0)