Skip to content
Permalink
Browse files

Clean up tests in demo/grouper

Tests for REST reconciliation were added. Some obsolete tests were removed.
  • Loading branch information
mederly committed Jan 14, 2020
1 parent 4fc009f commit f35685b0c4b1cba46fc589e1c5443e16ea00e92a
@@ -38,10 +38,10 @@ load ../../../library
check_health_shibboleth_idp
}

@test "060 Check Grouper health" {
if [ -e $BATS_TMPDIR/not-started ]; then skip 'not started'; fi
skip TODO
}
#@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
@@ -204,9 +204,6 @@ load ../../../library
@test "330 Check groups in midPoint and LDAP" {
if [ -e $BATS_TMPDIR/not-started ]; then skip 'not started'; fi

# wait_for_task_completion b73a2e66-8233-4c20-928f-acb30027b33e 8 10
# assert_task_success b73a2e66-8233-4c20-928f-acb30027b33e

search_and_check_object orgs course_ACCT101
search_and_check_object orgs course_ACCT201
search_and_check_object orgs course_CS251
@@ -224,89 +221,43 @@ load ../../../library
check_ldap_courses_by_name course_MATH101 grouper_directory_1
check_ldap_courses_by_name course_SCI123 grouper_directory_1
check_ldap_courses_by_name course_SCI404 grouper_directory_1

# memberships will be there only after triggers are executed

# check_of_ldap_membership amorrison "ou=courses,ou=groups,dc=internet2,dc=edu" "ACCT101" grouper_directory_1
# check_of_ldap_membership cmorrison "ou=courses,ou=groups,dc=internet2,dc=edu" "ACCT101" grouper_directory_1
# check_of_ldap_membership mroberts "ou=courses,ou=groups,dc=internet2,dc=edu" "ACCT101" grouper_directory_1
# check_of_ldap_membership whenderson "ou=courses,ou=groups,dc=internet2,dc=edu" "ACCT101" grouper_directory_1

# check_of_ldap_membership amorrison "ou=courses,ou=groups,dc=internet2,dc=edu" "CS251" grouper_directory_1
# check_of_ldap_membership cmorrison "ou=courses,ou=groups,dc=internet2,dc=edu" "CS251" grouper_directory_1
# check_of_ldap_membership ddavis "ou=courses,ou=groups,dc=internet2,dc=edu" "CS251" grouper_directory_1
# check_of_ldap_membership mroberts "ou=courses,ou=groups,dc=internet2,dc=edu" "CS251" grouper_directory_1

# check_of_ldap_membership kwhite "ou=courses,ou=groups,dc=internet2,dc=edu" "CS252" grouper_directory_1

# check_of_ldap_membership danderson "ou=courses,ou=groups,dc=internet2,dc=edu" "MATH100" grouper_directory_1
# check_of_ldap_membership ddavis "ou=courses,ou=groups,dc=internet2,dc=edu" "MATH100" grouper_directory_1
# check_of_ldap_membership kwhite "ou=courses,ou=groups,dc=internet2,dc=edu" "MATH100" grouper_directory_1
# check_of_ldap_membership wprice "ou=courses,ou=groups,dc=internet2,dc=edu" "MATH100" grouper_directory_1

# check_of_ldap_membership amorrison "ou=courses,ou=groups,dc=internet2,dc=edu" "MATH101" grouper_directory_1
# check_of_ldap_membership cmorrison "ou=courses,ou=groups,dc=internet2,dc=edu" "MATH101" grouper_directory_1
# check_of_ldap_membership mroberts "ou=courses,ou=groups,dc=internet2,dc=edu" "MATH101" grouper_directory_1

# check_of_ldap_membership danderson "ou=courses,ou=groups,dc=internet2,dc=edu" "SCI123" grouper_directory_1
# check_of_ldap_membership mroberts "ou=courses,ou=groups,dc=internet2,dc=edu" "SCI123" grouper_directory_1

# check_of_ldap_membership kwhite "ou=courses,ou=groups,dc=internet2,dc=edu" "SCI404" grouper_directory_1
# check_of_ldap_membership wprice "ou=courses,ou=groups,dc=internet2,dc=edu" "SCI404" grouper_directory_1
}


@test "330 Add wprice to 'midpoint:test' and 'ref:affiliation:alum_includes' groups" {
@test "340 Execute triggers and check group membership in LDAP" {
if [ -e $BATS_TMPDIR/not-started ]; then skip 'not started'; fi

skip TODO
sleep 60
run_task_now "00000000-0000-0000-0000-000000000007" grouper_midpoint_server_1
sleep 30

docker cp tests/resources/grouper/t330.gsh grouper_grouper_daemon_1:/tmp/
docker exec grouper_grouper_daemon_1 bash -c "/opt/grouper/grouper.apiBinary/bin/gsh /tmp/t330.gsh"
}

@test "335 Wait 80 seconds for changes to be propagated to MQ" {
if [ -e $BATS_TMPDIR/not-started ]; then skip 'not started'; fi

skip TODO

sleep 80
}

@test "340 Assert wprice membership in LDAP" {
if [ -e $BATS_TMPDIR/not-started ]; then skip 'not started'; fi

skip TODO

assert_ldap_user_has_value wprice Entitlement "midpoint:test" grouper_directory_1
assert_ldap_user_has_value wprice Entitlement "ref:affiliation:alum" grouper_directory_1
}

@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

skip TODO
# memberships will be there only after triggers are executed

docker cp tests/resources/grouper/t350.gsh grouper_grouper_daemon_1:/tmp/
docker exec grouper_grouper_daemon_1 bash -c "/opt/grouper/grouper.apiBinary/bin/gsh /tmp/t350.gsh"
}
check_of_ldap_membership amorrison "ou=courses,ou=groups,dc=internet2,dc=edu" "ACCT101" grouper_directory_1
check_of_ldap_membership cmorrison "ou=courses,ou=groups,dc=internet2,dc=edu" "ACCT101" grouper_directory_1
check_of_ldap_membership mroberts "ou=courses,ou=groups,dc=internet2,dc=edu" "ACCT101" grouper_directory_1
check_of_ldap_membership whenderson "ou=courses,ou=groups,dc=internet2,dc=edu" "ACCT101" grouper_directory_1

@test "355 Wait 80 seconds for changes to be propagated to MQ" {
if [ -e $BATS_TMPDIR/not-started ]; then skip 'not started'; fi
check_of_ldap_membership amorrison "ou=courses,ou=groups,dc=internet2,dc=edu" "CS251" grouper_directory_1
check_of_ldap_membership cmorrison "ou=courses,ou=groups,dc=internet2,dc=edu" "CS251" grouper_directory_1
check_of_ldap_membership ddavis "ou=courses,ou=groups,dc=internet2,dc=edu" "CS251" grouper_directory_1
check_of_ldap_membership mroberts "ou=courses,ou=groups,dc=internet2,dc=edu" "CS251" grouper_directory_1

skip TODO
check_of_ldap_membership kwhite "ou=courses,ou=groups,dc=internet2,dc=edu" "CS252" grouper_directory_1

sleep 80
}
check_of_ldap_membership danderson "ou=courses,ou=groups,dc=internet2,dc=edu" "MATH100" grouper_directory_1
check_of_ldap_membership ddavis "ou=courses,ou=groups,dc=internet2,dc=edu" "MATH100" grouper_directory_1
check_of_ldap_membership kwhite "ou=courses,ou=groups,dc=internet2,dc=edu" "MATH100" grouper_directory_1
check_of_ldap_membership wprice "ou=courses,ou=groups,dc=internet2,dc=edu" "MATH100" grouper_directory_1

@test "360 Assert wprice and kwhite membership in LDAP" {
if [ -e $BATS_TMPDIR/not-started ]; then skip 'not started'; fi
check_of_ldap_membership amorrison "ou=courses,ou=groups,dc=internet2,dc=edu" "MATH101" grouper_directory_1
check_of_ldap_membership cmorrison "ou=courses,ou=groups,dc=internet2,dc=edu" "MATH101" grouper_directory_1
check_of_ldap_membership mroberts "ou=courses,ou=groups,dc=internet2,dc=edu" "MATH101" grouper_directory_1

skip TODO
check_of_ldap_membership danderson "ou=courses,ou=groups,dc=internet2,dc=edu" "SCI123" grouper_directory_1
check_of_ldap_membership mroberts "ou=courses,ou=groups,dc=internet2,dc=edu" "SCI123" grouper_directory_1

assert_ldap_user_has_value kwhite Entitlement "midpoint:test" grouper_directory_1
assert_ldap_user_has_value wprice Entitlement "midpoint:test" grouper_directory_1
assert_ldap_user_has_no_value wprice Entitlement "ref:affiliation:alum" grouper_directory_1
check_of_ldap_membership kwhite "ou=courses,ou=groups,dc=internet2,dc=edu" "SCI404" grouper_directory_1
check_of_ldap_membership wprice "ou=courses,ou=groups,dc=internet2,dc=edu" "SCI404" grouper_directory_1
}

@test "400 Suspend async update task" {
@@ -316,11 +267,9 @@ load ../../../library
wait_for_task_completion 47fc57bd-8c34-4555-9b9f-7087ff179860 5 10
}

@test "410 Remove kwhite and wprice from 'midpoint:test'" {
@test "410 Add wprice to 'ref:affiliation:alum_includes' groups" {
if [ -e $BATS_TMPDIR/not-started ]; then skip 'not started'; fi

skip TODO

docker cp tests/resources/grouper/t410.gsh grouper_grouper_daemon_1:/tmp/
docker exec grouper_grouper_daemon_1 bash -c "/opt/grouper/grouper.apiBinary/bin/gsh /tmp/t410.gsh"
}
@@ -332,33 +281,23 @@ load ../../../library
search_and_check_object tasks "Grouper reconciliation (groups)"
wait_for_task_completion 605a0127-a313-442a-9d5e-151eac8b0745 6 10
assert_task_success 605a0127-a313-442a-9d5e-151eac8b0745
}

# 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 grouper_directory_1
# check_ldap_account_by_user_name banderson grouper_directory_1
# check_ldap_account_by_user_name kwhite grouper_directory_1
# check_ldap_account_by_user_name whenderson grouper_directory_1
# check_ldap_account_by_user_name ddavis grouper_directory_1
# check_ldap_account_by_user_name cmorrison grouper_directory_1
# check_ldap_account_by_user_name danderson grouper_directory_1
# check_ldap_account_by_user_name amorrison grouper_directory_1
# check_ldap_account_by_user_name wprice grouper_directory_1
# check_ldap_account_by_user_name mroberts grouper_directory_1
#
# assert_ldap_user_has_no_value wprice Entitlement "midpoint:test" grouper_directory_1
# assert_ldap_user_has_no_value kwhite Entitlement "midpoint:test" grouper_directory_1
@test "430 Recompute users" {
if [ -e $BATS_TMPDIR/not-started ]; then skip 'not started'; fi

add_object tasks midpoint-objects-manual/tasks/task-recomputation-users.xml
search_and_check_object tasks "User recomputing with bucket"
wait_for_task_completion 83a737ea-5eb7-4e78-b431-331cccf02354 6 10
assert_task_success 83a737ea-5eb7-4e78-b431-331cccf02354
}

@test "999 Clean up" {
docker-compose down -v
@test "440 Check wprice group membership in LDAP" {
if [ -e $BATS_TMPDIR/not-started ]; then skip 'not started'; fi

check_of_ldap_membership wprice "ou=Affiliations,ou=Groups,dc=internet2,dc=edu" "alum" grouper_directory_1
}

#@test "999 Clean up" {
# docker-compose down -v
#}
@@ -0,0 +1,11 @@
System.out.println("************** t410.gsh starting **************");

gs = GrouperSession.startRootSession()

testGroup = GroupFinder.findByName(gs, 'midpoint:test')
kwhite = SubjectFinder.findById('kwhite', 'person', 'ldap')
wprice = SubjectFinder.findById('wprice', 'person', 'ldap')
testGroup.deleteMember(kwhite, false)
testGroup.deleteMember(wprice, false)

System.out.println("************** t410.gsh done **************");

This file was deleted.

@@ -2,10 +2,8 @@ System.out.println("************** t410.gsh starting **************");

gs = GrouperSession.startRootSession()

testGroup = GroupFinder.findByName(gs, 'midpoint:test')
kwhite = SubjectFinder.findById('kwhite', 'person', 'ldap')
alumIncludesGroup = GroupFinder.findByName(gs, 'ref:affiliation:alum_includes')
wprice = SubjectFinder.findById('wprice', 'person', 'ldap')
testGroup.deleteMember(kwhite, false)
testGroup.deleteMember(wprice, false)
alumIncludesGroup.addMember(wprice, false)

System.out.println("************** t410.gsh done **************");

0 comments on commit f35685b

Please sign in to comment.
You can’t perform that action at this time.