Skip to content

Commit

Permalink
Reorganizing test suite, updating binscripts
Browse files Browse the repository at this point in the history
  • Loading branch information
Jim Van Fleet committed Aug 3, 2016
1 parent 4212f68 commit 12f5269
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 6 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
@@ -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
}

0 comments on commit 12f5269

Please sign in to comment.