Skip to content

Commit

Permalink
enable other tests
Browse files Browse the repository at this point in the history
  • Loading branch information
pcaskey committed Nov 11, 2022
1 parent 2fa2d5f commit 5de45d9
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 43 deletions.
2 changes: 1 addition & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ pipeline {
script {
try {
echo "Starting tests..."
// sh "bin/test.sh 2>&1 | tee debug ; test ${PIPESTATUS[0]} -eq 0"
sh "bin/test.sh 2>&1 | tee debug ; test ${PIPESTATUS[0]} -eq 0"
sh 'tests/fulltest.sh'
// echo "Skipping tests for now"
} catch (error) {
Expand Down
1 change: 0 additions & 1 deletion tests/fulltest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ rm -f ./lastpage.txt

# replace FROM line in IdP Dockerfile to newly-built local image
echo "Setting test suite to base from new IdP image: ${imagename}_${tag}"
#sed -i "s*FROM i2incommon/shib-idp:latest*FROM shib-idp_4.2.1_20221101_rocky8_multiarch_dev*g" ../test-compose/idp/Dockerfile
sed -i "s*FROM i2incommon/shib-idp:latest*FROM ${imagename}_${tag}*g" ../test-compose/idp/Dockerfile

echo "Attempting full-cycle test..."
Expand Down
82 changes: 41 additions & 41 deletions tests/main.bats
Original file line number Diff line number Diff line change
Expand Up @@ -2,55 +2,55 @@

load ../common

#@test "010 Image is present and healthy" {
# docker image inspect ${maintainer}/${imagename}
#}
@test "010 Image is present and healthy" {
docker image inspect ${imagename}_${tag}
}

#@test "020 All key files are present" {
# docker run --rm -i ${maintainer}/${imagename} \
# find \
# /opt/shibboleth-idp/credentials/idp-encryption.crt \
# /opt/shibboleth-idp/credentials/idp-encryption.key \
# /opt/shibboleth-idp/credentials/idp-signing.crt \
# /opt/shibboleth-idp/credentials/idp-signing.key \
# /usr/local/tomcat/ \
# /usr/bin/java
#}
@test "020 All key files are present" {
docker run --rm -i ${imagename}_${tag} \
find \
/opt/shibboleth-idp/credentials/idp-encryption.crt \
/opt/shibboleth-idp/credentials/idp-encryption.key \
/opt/shibboleth-idp/credentials/idp-signing.crt \
/opt/shibboleth-idp/credentials/idp-signing.key \
/usr/local/tomcat/ \
/usr/bin/java
}

#@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 "030 Port 443/https is listening" {
docker run -d ${imagename}_${tag}
sleep 25
#get cont id
contid=$(docker ps | grep ${imagename}_${tag} | 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 IdP 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/idp/status'
# docker kill ${contid2} &>/dev/null
# docker rm ${contid2} &>/dev/null
# [ "$status" -eq 0 ]
#}
@test "040 The IdP Status page is present" {
docker run -d ${imagename}_${tag}
sleep 60
contid2=$(docker ps | grep ${imagename}_${tag} | cut -f 1 -d ' ')
run docker exec -i ${contid2} sh -c 'curl -I -k -s -f https://127.0.0.1/idp/status'
docker kill ${contid2} &>/dev/null
docker rm ${contid2} &>/dev/null
[ "$status" -eq 0 ]
}

#@test "050 The version of Tomcat is current" {
# ./tests/checktomcatver.sh ${maintainer}/${imagename}
#}
@test "050 The version of Tomcat is current" {
./tests/checktomcatver.sh ${imagename}_${tag}
}

#@test "060 The version of the IdP is current" {
# ./tests/checkidpver.sh ${maintainer}/${imagename}
#}
@test "060 The version of the IdP is current" {
./tests/checkidpver.sh ${imagename}_${tag}
}

##@test "070 There are no known security vulnerabilities" {
## ./tests/clairscan.sh ${maintainer}/${imagename}:latest
##}

@test "080 The IdP successfully completed a full-cycle test with an SP" {
./tests/fulltest.sh
}
#@test "080 The IdP successfully completed a full-cycle test with an SP" {
# ./tests/fulltest.sh
#}

0 comments on commit 5de45d9

Please sign in to comment.