Skip to content

Commit

Permalink
broken test
Browse files Browse the repository at this point in the history
  • Loading branch information
gerardsn committed Oct 17, 2024
1 parent c8adb2c commit 813b2e7
Showing 1 changed file with 45 additions and 3 deletions.
48 changes: 45 additions & 3 deletions e2e-tests/discovery/run-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,13 @@ fi
echo "---------------------------------------"
echo "Registering care organization on Discovery Service..."
echo "---------------------------------------"
curl --insecure -s -X POST http://localhost:28081/internal/discovery/v1/dev:eOverdracht2023/${SUBJECT}
RESPONSE=$(curl --insecure -s -X POST http://localhost:28081/internal/discovery/v1/dev:eOverdracht2023/${SUBJECT})
if [ -z "${RESPONSE}" ]; then
echo "Registered for service"
else
echo "FAILED: Could not register for Discovery Service" 1>&2
exitWithDockerLogs 1
fi

# Registration refresh interval is 500ms, wait some to make sure the registration is refreshed
sleep 2
Expand All @@ -68,8 +74,6 @@ fi
echo "---------------------------------------"
echo "Searching for care organization registration on Discovery Client..."
echo "---------------------------------------"
# Service refresh interval is 500ms, wait some to make sure the presentations are loaded
sleep 2
RESPONSE=$(curl -s --insecure "http://localhost:28081/internal/discovery/v1/dev:eOverdracht2023?credentialSubject.organization.name=Care*")
NUM_ITEMS=$(echo $RESPONSE | jq length)
if [ $NUM_ITEMS -eq 1 ]; then
Expand All @@ -87,6 +91,44 @@ else
exitWithDockerLogs 1
fi

echo "---------------------------------------"
echo "Retract Discovery Service registration..."
echo "---------------------------------------"
RESPONSE=$(curl --insecure -s -X DELETE http://localhost:28081/internal/discovery/v1/dev:eOverdracht2023/${SUBJECT})
if [ -z "${RESPONSE}" ]; then
echo "Registration revoked"
else
echo "FAILED: Registration not (immediately) revoked" 1>&2
exitWithDockerLogs 1
fi

# Registration refresh interval is 500ms, wait some to make sure the registration is refreshed
sleep 2

echo "---------------------------------------"
echo "Searching for care organization registration on Discovery Server..."
echo "---------------------------------------"
RESPONSE=$(curl -s --insecure "http://localhost:18081/internal/discovery/v1/dev:eOverdracht2023?credentialSubject.organization.name=Care*")
NUM_ITEMS=$(echo $RESPONSE | jq length)
if [ $NUM_ITEMS -eq 0 ]; then
echo "Registration not found"
else
echo "FAILED: Found registration" 1>&2
exitWithDockerLogs 1
fi

echo "---------------------------------------"
echo "Searching for care organization registration on Discovery Client..."
echo "---------------------------------------"
RESPONSE=$(curl -s --insecure "http://localhost:28081/internal/discovery/v1/dev:eOverdracht2023?credentialSubject.organization.name=Care*")
NUM_ITEMS=$(echo $RESPONSE | jq length)
if [ $NUM_ITEMS -eq 0 ]; then
echo "Registration not found"
else
echo "FAILED: Found registration" 1>&2
exitWithDockerLogs 1
fi

echo "------------------------------------"
echo "Stopping Docker containers..."
echo "------------------------------------"
Expand Down

0 comments on commit 813b2e7

Please sign in to comment.