Skip to content

Commit

Permalink
add tests for reading tenant info from tenant service
Browse files Browse the repository at this point in the history
  • Loading branch information
suhussai committed Nov 4, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent 350d29f commit 9be9e0b
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions scripts/test-sbt-aws.sh
Original file line number Diff line number Diff line change
@@ -52,7 +52,6 @@ else
log_test "fail" "Unexpected output when deleting non-existent tenant"
fi


# Test create-tenant-registration
echo "Testing create-tenant-registration..."
response=$(./sbt-aws.sh create-tenant-registration)
@@ -72,8 +71,6 @@ if [ -n "$tenant_registration_id" ] && [ "$tenant_registration_id" != "null" ];
log_test "fail" "Failed to set tenant registration sbtaws_active to 'True' in DynamoDB table"
fi

# wait_for_stack_creation "$tenant_id"

# Wait for tenant provisioning to complete
max_attempts=60
attempt=0
@@ -118,6 +115,24 @@ else
log_test "fail" "Failed to update tenant registration"
fi

# Test get-tenant
echo "Testing get-tenant..."
tenant=$(./sbt-aws.sh get-tenant "$tenant_id")
if echo "$tenant" | grep -q "$tenant_id"; then
log_test "pass" "Tenant retrieved successfully"
else
log_test "fail" "Failed to retrieve tenant"
fi

# Test get-all-tenants
echo "Testing get-all-tenants..."
tenants=$(./sbt-aws.sh get-all-tenants)
if echo "$tenants" | grep -q "$tenant_id"; then
log_test "pass" "Tenant found in get-all-tenants"
else
log_test "fail" "Tenant not found in get-all-tenants"
fi

# Test delete-tenant-registration
echo "Testing delete-tenant-registration..."
./sbt-aws.sh delete-tenant-registration "$tenant_registration_id" >/dev/null

0 comments on commit 9be9e0b

Please sign in to comment.