Skip to content

Commit 367dbb0

Browse files
Add test.
1 parent 47d5e6c commit 367dbb0

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

example/redis.nomad

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ job "redis" {
66
driver = "containerd-driver"
77

88
config {
9-
image = "docker.io/library/redis:alpine"
9+
image = "docker.io/library/redis:alpine"
10+
seccomp = true
1011
}
1112

1213
resources {

tests/001-test-redis.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,14 @@ test_redis_nomad_job() {
3232
exit 1
3333
fi
3434

35+
echo "INFO: Check if default seccomp is enabled."
36+
output=$(nomad alloc exec -job redis cat /proc/1/status | grep Seccomp)
37+
seccomp_code=$(echo $output|cut -d' ' -f2)
38+
if [ $seccomp_code != "2" ]; then
39+
echo "ERROR: default seccomp is not enabled."
40+
exit 1
41+
fi
42+
3543
echo "INFO: Stopping nomad redis job."
3644
nomad job stop redis
3745
redis_status=$(nomad job status -short redis|grep Status|awk '{split($0,a,"="); print a[2]}'|tr -d ' ')

0 commit comments

Comments
 (0)