Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Loading status checks…
Create main.bats
Showing
1 changed file
with
33 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#!/usr/bin/env bats | ||
|
||
load ../common | ||
|
||
@test "010 Image is present and healthy" { | ||
docker image inspect ${maintainer}/${imagename} | ||
} | ||
|
||
@test "030 Port 443/https is listening" { | ||
docker run -d ${maintainer}/${imagename} | ||
sleep 25 | ||
#get cont id | ||
contid=$(docker ps | grep ${maintainer}/${imagename} | cut -f 1 -d ' ') | ||
run docker exec -i ${contid} sh -c 'cat < /dev/null > /dev/tcp/127.0.0.1/443' | ||
docker kill ${contid} &>/dev/null | ||
docker rm ${contid} &>/dev/null | ||
[ "$status" -eq 0 ] | ||
} | ||
|
||
@test "040 The Grouper Status page is present" { | ||
docker run -d ${maintainer}/${imagename} | ||
sleep 60 | ||
contid2=$(docker ps | grep ${maintainer}/${imagename} | cut -f 1 -d ' ') | ||
run docker exec -i ${contid2} sh -c 'curl -I -k -s -f https://127.0.0.1/grouper/status?diagnosticType=trivial' | ||
docker kill ${contid2} &>/dev/null | ||
docker rm ${contid2} &>/dev/null | ||
[ "$status" -eq 0 ] | ||
} | ||
|
||
|
||
@test "070 There are no known security vulnerabilities" { | ||
./tests/clairscan.sh ${maintainer}/${imagename} | ||
} |