|
@@ -68,7 +68,7 @@ load ../../../library |
|
|
docker exec complex_sources_1 mysql sis -u root -p123321 -e "delete from SIS_PERSONS where uid not in ('amorrison', 'banderson', 'cmorrison', 'danderson', 'ddavis', 'jsmith', 'kwhite', 'mroberts', 'whenderson', 'wprice')" |
|
|
|
|
|
check_health |
|
|
./upload-objects |
|
|
./upload-objects.sh |
|
|
|
|
|
search_and_check_object objectTemplates template-org-course |
|
|
search_and_check_object objectTemplates template-org-department |
|
@@ -79,7 +79,7 @@ load ../../../library |
|
|
search_and_check_object orgs departments |
|
|
|
|
|
search_and_check_object resources "OpenLDAP (directory)" |
|
|
search_and_check_object resources "Grouper SQL/MQ" |
|
|
search_and_check_object resources "Grouper Resource" |
|
|
search_and_check_object resources "SQL SIS courses (sources)" |
|
|
search_and_check_object resources "SQL SIS persons (sources)" |
|
|
|
|
@@ -91,10 +91,9 @@ load ../../../library |
|
|
search_and_check_object roles role-ldap-basic |
|
|
} |
|
|
|
|
|
@test "210 Test resource" { |
|
|
@test "210 Test LDAP and SQL resources" { |
|
|
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 |
|
|
} |
|
@@ -201,86 +200,149 @@ load ../../../library |
|
|
delete_object_by_name users TestUser240 |
|
|
} |
|
|
|
|
|
@test "300 Add wprice to 'etc:testGroup' and 'ref:affiliation:alum_includes'. Export 'ref:affiliation:alum'" { |
|
|
@test "250 Make 'banderson' Grouper administrator" { |
|
|
if [ -e $BATS_TMPDIR/not-started ]; then skip 'not started'; fi |
|
|
check_health |
|
|
recompute roles d48ec05b-fffd-4262-acd3-d9ff63365b62 |
|
|
execute_bulk_action tests/resources/bulk-action/assign-role-grouper-sysadmin-to-banderson.xml complex_midpoint_server_1 |
|
|
recompute users e897468f-20bd-419c-8fc5-1fe60e2600de # for some reason this looks necessary (TODO) |
|
|
check_of_ldap_membership banderson "ou=groups,dc=internet2,dc=edu" "sysadmingroup" complex_directory_1 |
|
|
} |
|
|
|
|
|
@test "260 Export groups" { |
|
|
if [ -e $BATS_TMPDIR/not-started ]; then skip 'not started'; fi |
|
|
|
|
|
docker cp tests/resources/grouper/t260.gsh complex_grouper_daemon_1:/tmp/ |
|
|
docker exec complex_grouper_daemon_1 bash -c "/opt/grouper/grouper.apiBinary/bin/gsh /tmp/t260.gsh" |
|
|
} |
|
|
|
|
|
docker cp tests/resources/grouper/t300.gsh complex_grouper_daemon_1:/tmp/ |
|
|
docker exec complex_grouper_daemon_1 bash -c "/opt/grouper/grouper.apiBinary/bin/gsh /tmp/t300.gsh" |
|
|
@test "265 Wait 120 seconds for changes to be propagated to MQ" { |
|
|
if [ -e $BATS_TMPDIR/not-started ]; then skip 'not started'; fi |
|
|
|
|
|
sleep 120 |
|
|
} |
|
|
|
|
|
@test "300 Test Grouper resource" { |
|
|
if [ -e $BATS_TMPDIR/not-started ]; then skip 'not started'; fi |
|
|
test_resource 1eff65de-5bb6-483d-9edf-8cc2c2ee0233 |
|
|
} |
|
|
|
|
|
@test "310 Import Grouper-to-midPoint import task" { |
|
|
@test "310 Import Grouper-to-midPoint async update task" { |
|
|
if [ -e $BATS_TMPDIR/not-started ]; then skip 'not started'; fi |
|
|
|
|
|
check_health |
|
|
add_object tasks midpoint-objects-manual/tasks/task-import-grouper.xml |
|
|
search_and_check_object tasks "Import from Grouper" |
|
|
add_object tasks midpoint-objects-manual/tasks/task-async-update-grouper.xml |
|
|
search_and_check_object tasks "Grouper async updates" |
|
|
} |
|
|
|
|
|
@test "320 Wait for the import to finish" { |
|
|
@test "320 Wait for the queue to become empty" { |
|
|
if [ -e $BATS_TMPDIR/not-started ]; then skip 'not started'; fi |
|
|
|
|
|
wait_for_task_completion 617fec0c-f7a6-4f91-89d0-395fb8878edd 8 10 |
|
|
assert_task_success 617fec0c-f7a6-4f91-89d0-395fb8878edd |
|
|
ATTEMPT=0 |
|
|
MAX_ATTEMPTS=20 |
|
|
DELAY=10 |
|
|
|
|
|
get_messages sampleQueue |
|
|
echo "Messages: $MESSAGES" |
|
|
|
|
|
until [[ $ATTEMPT = $MAX_ATTEMPTS ]]; do |
|
|
ATTEMPT=$((ATTEMPT+1)) |
|
|
get_messages sampleQueue |
|
|
echo "Messages: $MESSAGES" |
|
|
if [ "$MESSAGES" = "0" ]; then return 0; fi |
|
|
echo "Waiting $DELAY seconds for the queue to become empty (attempt $ATTEMPT) ..." |
|
|
sleep $DELAY |
|
|
done |
|
|
return 1 |
|
|
} |
|
|
|
|
|
@test "330 Assert wprice membership in LDAP" { |
|
|
@test "330 Add wprice to 'midpoint:test' and 'ref:affiliation:alum_includes' groups" { |
|
|
if [ -e $BATS_TMPDIR/not-started ]; then skip 'not started'; fi |
|
|
|
|
|
assert_ldap_user_has_value wprice Entitlement "etc:testGroup" complex_directory_1 |
|
|
assert_ldap_user_has_value wprice Entitlement "ref:affiliation:alum" complex_directory_1 |
|
|
docker cp tests/resources/grouper/t330.gsh complex_grouper_daemon_1:/tmp/ |
|
|
docker exec complex_grouper_daemon_1 bash -c "/opt/grouper/grouper.apiBinary/bin/gsh /tmp/t330.gsh" |
|
|
} |
|
|
|
|
|
@test "400 Clean sampleQueue" { |
|
|
@test "335 Wait 80 seconds for changes to be propagated to MQ" { |
|
|
if [ -e $BATS_TMPDIR/not-started ]; then skip 'not started'; fi |
|
|
|
|
|
docker exec complex_mq_1 rabbitmqctl purge_queue sampleQueue |
|
|
sleep 80 |
|
|
} |
|
|
|
|
|
@test "410 Import Grouper-to-midPoint live sync task" { |
|
|
@test "340 Assert wprice membership in LDAP" { |
|
|
if [ -e $BATS_TMPDIR/not-started ]; then skip 'not started'; fi |
|
|
|
|
|
check_health |
|
|
add_object tasks tests/resources/tasks/task-livesync-grouper-single.xml |
|
|
search_and_check_object tasks "LiveSync from Grouper" |
|
|
wait_for_task_completion 87ffce52-717a-4205-ba01-0a698f0deaee 8 10 |
|
|
assert_task_success 87ffce52-717a-4205-ba01-0a698f0deaee |
|
|
assert_ldap_user_has_value wprice Entitlement "midpoint:test" complex_directory_1 |
|
|
assert_ldap_user_has_value wprice Entitlement "midpoint:alum" complex_directory_1 |
|
|
} |
|
|
|
|
|
@test "420 Add kwhite to 'etc:testGroup', remove wprice from 'ref:affiliation:alum_includes'" { |
|
|
@test "350 Add kwhite to 'midpoint:test', remove wprice from 'ref:affiliation:alum_includes'" { |
|
|
if [ -e $BATS_TMPDIR/not-started ]; then skip 'not started'; fi |
|
|
|
|
|
docker cp tests/resources/grouper/t420.gsh complex_grouper_daemon_1:/tmp/ |
|
|
docker exec complex_grouper_daemon_1 bash -c "/opt/grouper/grouper.apiBinary/bin/gsh /tmp/t420.gsh" |
|
|
docker cp tests/resources/grouper/t350.gsh complex_grouper_daemon_1:/tmp/ |
|
|
docker exec complex_grouper_daemon_1 bash -c "/opt/grouper/grouper.apiBinary/bin/gsh /tmp/t350.gsh" |
|
|
} |
|
|
|
|
|
@test "425 Wait 80 seconds for changes to be propagated to MQ" { |
|
|
@test "355 Wait 80 seconds for changes to be propagated to MQ" { |
|
|
if [ -e $BATS_TMPDIR/not-started ]; then skip 'not started'; fi |
|
|
|
|
|
sleep 80 |
|
|
} |
|
|
|
|
|
@test "430 Assert existence of change messages in sampleQueue" { |
|
|
@test "360 Assert wprice and kwhite membership in LDAP" { |
|
|
if [ -e $BATS_TMPDIR/not-started ]; then skip 'not started'; fi |
|
|
|
|
|
docker cp tests/resources/rabbitmq/check-samplequeue.sh complex_mq_1:/tmp/ |
|
|
docker exec complex_mq_1 bash /tmp/check-samplequeue.sh |
|
|
assert_ldap_user_has_value kwhite Entitlement "midpoint:test" complex_directory_1 |
|
|
assert_ldap_user_has_value wprice Entitlement "midpoint:test" complex_directory_1 |
|
|
assert_ldap_user_has_no_value wprice Entitlement "ref:affiliation:alum" complex_directory_1 |
|
|
} |
|
|
|
|
|
@test "440 Execute Grouper-to-midPoint live sync task (again)" { |
|
|
@test "400 Suspend async update task" { |
|
|
if [ -e $BATS_TMPDIR/not-started ]; then skip 'not started'; fi |
|
|
|
|
|
check_health |
|
|
run_task_now 87ffce52-717a-4205-ba01-0a698f0deaee |
|
|
wait_for_task_completion 87ffce52-717a-4205-ba01-0a698f0deaee 8 10 |
|
|
assert_task_success 87ffce52-717a-4205-ba01-0a698f0deaee |
|
|
suspend_task 47fc57bd-8c34-4555-9b9f-7087ff179860 complex_midpoint_server_1 |
|
|
wait_for_task_completion 47fc57bd-8c34-4555-9b9f-7087ff179860 5 10 |
|
|
} |
|
|
|
|
|
@test "450 Assert wprice and kwhite membership in LDAP" { |
|
|
@test "410 Remove kwhite and wprice from 'midpoint:test'" { |
|
|
if [ -e $BATS_TMPDIR/not-started ]; then skip 'not started'; fi |
|
|
|
|
|
assert_ldap_user_has_value kwhite Entitlement "etc:testGroup" complex_directory_1 |
|
|
assert_ldap_user_has_value wprice Entitlement "etc:testGroup" complex_directory_1 |
|
|
assert_ldap_user_has_no_value wprice Entitlement "ref:affiliation:alum" complex_directory_1 |
|
|
docker cp tests/resources/grouper/t410.gsh complex_grouper_daemon_1:/tmp/ |
|
|
docker exec complex_grouper_daemon_1 bash -c "/opt/grouper/grouper.apiBinary/bin/gsh /tmp/t410.gsh" |
|
|
} |
|
|
|
|
|
@test "420 Reconcile Grouper" { |
|
|
if [ -e $BATS_TMPDIR/not-started ]; then skip 'not started'; fi |
|
|
|
|
|
add_object tasks midpoint-objects-manual/tasks/task-reconciliation-grouper-users.xml |
|
|
search_and_check_object tasks "Grouper reconciliation (users)" |
|
|
wait_for_task_completion 42aa9f43-64c5-41a6-814c-b58b9ea4e204 6 10 |
|
|
assert_task_success 42aa9f43-64c5-41a6-814c-b58b9ea4e204 |
|
|
|
|
|
search_and_check_object users jsmith |
|
|
search_and_check_object users banderson |
|
|
search_and_check_object users kwhite |
|
|
search_and_check_object users whenderson |
|
|
search_and_check_object users ddavis |
|
|
search_and_check_object users cmorrison |
|
|
search_and_check_object users danderson |
|
|
search_and_check_object users amorrison |
|
|
search_and_check_object users wprice |
|
|
search_and_check_object users mroberts |
|
|
|
|
|
check_ldap_account_by_user_name jsmith complex_directory_1 |
|
|
check_ldap_account_by_user_name banderson complex_directory_1 |
|
|
check_ldap_account_by_user_name kwhite complex_directory_1 |
|
|
check_ldap_account_by_user_name whenderson complex_directory_1 |
|
|
check_ldap_account_by_user_name ddavis complex_directory_1 |
|
|
check_ldap_account_by_user_name cmorrison complex_directory_1 |
|
|
check_ldap_account_by_user_name danderson complex_directory_1 |
|
|
check_ldap_account_by_user_name amorrison complex_directory_1 |
|
|
check_ldap_account_by_user_name wprice complex_directory_1 |
|
|
check_ldap_account_by_user_name mroberts complex_directory_1 |
|
|
|
|
|
assert_ldap_user_has_no_value wprice Entitlement "midpoint:test" complex_directory_1 |
|
|
assert_ldap_user_has_no_value kwhite Entitlement "midpoint:test" complex_directory_1 |
|
|
} |
|
|
|
|
|
@test "999 Clean up" { |
|
|