Skip to content

Commit c86faf9

Browse files
Add integration test.
1 parent f80f418 commit c86faf9

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

example/redis.nomad

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@ job "redis" {
66
driver = "containerd-driver"
77

88
config {
9-
image = "redis:alpine"
10-
seccomp = true
11-
cwd = "/home/redis"
9+
image = "redis:alpine"
10+
hostname = "foobar"
11+
seccomp = true
12+
cwd = "/home/redis"
1213
}
1314

1415
resources {

tests/001-test-redis.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,13 @@ test_redis_nomad_job() {
3434
exit 1
3535
fi
3636

37+
echo "INFO: Exec redis job and check hostname is foobar."
38+
hostname=$(nomad alloc exec -job redis hostname)
39+
if [ $hostname != "foobar" ]; then
40+
echo "ERROR: hostname is not foobar."
41+
exit 1
42+
fi
43+
3744
echo "INFO: Check if default seccomp is enabled."
3845
output=$(nomad alloc exec -job redis cat /proc/1/status | grep Seccomp)
3946
seccomp_code=$(echo $output|cut -d' ' -f2)

0 commit comments

Comments
 (0)