Skip to content

Adding some runtime tests to the suite #10

Merged
1 commit merged into from Aug 3, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Expand Up @@ -5,6 +5,8 @@ bin/rebuild.sh
bin/rerun.sh
bin/run.sh
bin/test.sh
bin/start.sh
bin/stop.sh
root/**
shibboleth-identity-provider.tar.gz
test.log
5 changes: 4 additions & 1 deletion Dockerfile
Expand Up @@ -5,4 +5,7 @@ ARG imagename=shibboleth_idp
ARG version=3.2.1
ENV VERSION=$version

RUN chown -R root:root /opt/shibboleth/shibboleth-identity-provider-$version
RUN chown -R root:root /opt/shibboleth/shibboleth-identity-provider-$version

EXPOSE 8080
CMD ["catalina.sh", "run"]
17 changes: 16 additions & 1 deletion Jenkinsfile
Expand Up @@ -20,7 +20,22 @@ node {
dir('root'){
git([ url: "https://github.internet2.edu/docker/shib-idp-conftree.git",
branch: "test", credentialsId: "jenkins-github-access-token" ])
}
}

stage 'Build'

def maintainer = maintainer()
def imagename = imagename()
def tag = env.BRANCH_NAME
if(!imagename){
echo "You must define an imagename in common.bash"
currentBuild.result = 'FAILURE'
}
if(maintainer){
echo "Building ${maintainer}:${tag} for ${maintainer}"
}

sh 'bin/rebuild.sh'

stage 'Tests'

Expand Down
4 changes: 0 additions & 4 deletions tests/image.bats
Expand Up @@ -2,10 +2,6 @@

load ../common

setup() {
./bin/rebuild.sh
}

@test "Creates non-root Shib IDP home" {
result="$(docker run -i $maintainer/$imagename ls /opt/shibboleth/current/bin/)"
[ "$result" != '' ]
Expand Down
15 changes: 15 additions & 0 deletions tests/running.bats
@@ -0,0 +1,15 @@
#!/usr/bin/env bats

load ../common

setup() {
bin/start.sh
}

@test "Leaves running process" {
result="$(docker ps | grep $imagename)"
[ "$result" != '' ]
}
teardown() {
bin/stop.sh
}