Skip to content
Permalink
baca108dd0
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
executable file 81 lines (69 sloc) 2.39 KB
#!/usr/bin/env bats
load ../../../common
load ../../../library
@test "000 Cleanup before running the tests" {
pwd > /tmp/log
echo a1 >> /tmp/log
(cd ../shibboleth ; docker-compose down -v ; sleep 60) || true
echo a2 >> /tmp/log
(docker-compose down -v ; sleep 60) || true
echo a3 >> /tmp/log
}
@test "010 Initialize and start the composition" {
docker ps -a
docker-compose up -d
}
@test "020 Wait until components are started" {
touch $BATS_TMPDIR/not-started
wait_for_midpoint_start complex_midpoint-server_1
wait_for_shibboleth_idp_start complex_idp_1
rm $BATS_TMPDIR/not-started
# TODO wait for shibboleth, grouper-ui, (also something other?)
}
@test "040 Check midPoint health" {
if [ -e $BATS_TMPDIR/not-started ]; then skip 'not started'; fi
check_health
}
@test "050 Check Shibboleth IDP health" {
if [ -e $BATS_TMPDIR/not-started ]; then skip 'not started'; fi
check_health_shibboleth_idp
}
@test "060 Check Grouper health" {
if [ -e $BATS_TMPDIR/not-started ]; then skip 'not started'; fi
skip TODO
}
@test "100 Get 'administrator'" {
if [ -e $BATS_TMPDIR/not-started ]; then skip 'not started'; fi
check_health
get_and_check_object users 00000000-0000-0000-0000-000000000002 administrator
}
@test "110 And and get 'test110'" {
if [ -e $BATS_TMPDIR/not-started ]; then skip 'not started'; fi
check_health
echo "<user><name>test110</name></user>" >/tmp/test110.xml
add_object users /tmp/test110.xml
rm /tmp/test110.xml
search_and_check_object users test110
# TODO delete user after
}
@test "200 Upload objects" {
if [ -e $BATS_TMPDIR/not-started ]; then skip 'not started'; fi
check_health
pwd >&2
./upload-objects
search_and_check_object objectTemplates template-org-course
search_and_check_object objectTemplates template-org-department
search_and_check_object objectTemplates template-role-affiliation
search_and_check_object objectTemplates template-role-generic-group
# TODO check other objects that were uploaded
}
@test "210 Test resource" {
if [ -e $BATS_TMPDIR/not-started ]; then skip 'not started'; fi
test_resource 0a37121f-d515-4a23-9b6d-554c5ef61272
test_resource 6dcb84f5-bf82-4931-9072-fbdf87f96442
test_resource 13660d60-071b-4596-9aa1-5efcd1256c04
test_resource 4d70a0da-02dd-41cf-b0a1-00e75d3eaa15
}
@test "999 Clean up" {
# docker-compose down -v
}