diff --git a/cmd/prism-launcher/main.go b/cmd/prism-launcher/main.go index 8f098b53c..e01c196c9 100644 --- a/cmd/prism-launcher/main.go +++ b/cmd/prism-launcher/main.go @@ -111,9 +111,13 @@ func main() { eventPublisher = &launcher.NoopEventPublisher{} } + // Create control service for process callbacks + controlService := launcher.NewControlService(*launcherID, adminClient) + // Create gRPC server grpcServer := grpc.NewServer() pb.RegisterPatternLauncherServer(grpcServer, service) + pb.RegisterLauncherControlServer(grpcServer, controlService) // Enable reflection for grpcurl reflection.Register(grpcServer) diff --git a/test_transparent_proxy.sh b/test_transparent_proxy.sh new file mode 100755 index 000000000..e723e4fce --- /dev/null +++ b/test_transparent_proxy.sh @@ -0,0 +1,54 @@ +#!/bin/bash +# Simple test script for transparent proxy using grpcurl + +set -e + +echo "๐Ÿงช Testing Transparent Proxy - KeyValue Pattern" +echo "================================================" +echo "" + +# Test Set operation +echo "1. Testing Set operation..." +grpcurl -plaintext -d '{"key":"test-key","value":"dGVzdC12YWx1ZQ=="}' \ + localhost:9090 prism.interfaces.keyvalue.KeyValueBasicInterface/Set + +echo "โœ… Set completed" +echo "" + +# Test Get operation +echo "2. Testing Get operation..." +grpcurl -plaintext -d '{"key":"test-key"}' \ + localhost:9090 prism.interfaces.keyvalue.KeyValueBasicInterface/Get + +echo "โœ… Get completed" +echo "" + +# Test Exists operation +echo "3. Testing Exists operation..." +grpcurl -plaintext -d '{"key":"test-key"}' \ + localhost:9090 prism.interfaces.keyvalue.KeyValueBasicInterface/Exists + +echo "โœ… Exists completed" +echo "" + +# Test Delete operation +echo "4. Testing Delete operation..." +grpcurl -plaintext -d '{"key":"test-key"}' \ + localhost:9090 prism.interfaces.keyvalue.KeyValueBasicInterface/Delete + +echo "โœ… Delete completed" +echo "" + +# Test Get on deleted key (should not be found) +echo "5. Testing Get on deleted key..." +grpcurl -plaintext -d '{"key":"test-key"}' \ + localhost:9090 prism.interfaces.keyvalue.KeyValueBasicInterface/Get + +echo "โœ… Get on deleted key completed" +echo "" + +echo "================================================" +echo "โœ… All tests passed!" +echo "" +echo "Transparent proxying is working:" +echo " Client โ†’ prism-proxy:9090 โ†’ keyvalue-runner:9095 โ†’ memstore" diff --git a/test_ttl_operations.sh b/test_ttl_operations.sh new file mode 100755 index 000000000..6a2e9cc05 --- /dev/null +++ b/test_ttl_operations.sh @@ -0,0 +1,49 @@ +#!/bin/bash +# Test TTL operations through transparent proxy + +set -e + +echo "๐Ÿงช Testing Transparent Proxy - KeyValue TTL Operations" +echo "================================================" +echo "" + +# Test 1: Set a key +echo "1. Setting a key..." +grpcurl -plaintext -d '{"key":"ttl-test-key","value":"dGVzdC12YWx1ZQ=="}' \ + localhost:9090 prism.interfaces.keyvalue.KeyValueBasicInterface/Set +echo "โœ… Key set" +echo "" + +# Test 2: Set expiration (5 seconds) +echo "2. Setting TTL to 5 seconds..." +grpcurl -plaintext -d '{"key":"ttl-test-key","ttl_seconds":5}' \ + localhost:9090 prism.interfaces.keyvalue.KeyValueTTLInterface/Expire +echo "โœ… TTL set" +echo "" + +# Test 3: Get TTL +echo "3. Getting TTL..." +grpcurl -plaintext -d '{"key":"ttl-test-key"}' \ + localhost:9090 prism.interfaces.keyvalue.KeyValueTTLInterface/GetTTL +echo "โœ… GetTTL completed" +echo "" + +# Test 4: Persist (remove expiration) +echo "4. Persisting key (removing expiration)..." +grpcurl -plaintext -d '{"key":"ttl-test-key"}' \ + localhost:9090 prism.interfaces.keyvalue.KeyValueTTLInterface/Persist +echo "โœ… Persist completed" +echo "" + +# Test 5: Get TTL again (should be -1 for no expiration) +echo "5. Getting TTL after persist..." +grpcurl -plaintext -d '{"key":"ttl-test-key"}' \ + localhost:9090 prism.interfaces.keyvalue.KeyValueTTLInterface/GetTTL +echo "โœ… GetTTL after persist completed" +echo "" + +echo "================================================" +echo "โœ… All TTL tests passed!" +echo "" +echo "TTL operations working through transparent proxy:" +echo " Client โ†’ prism-proxy:9090 โ†’ keyvalue-runner:9095 โ†’ memstore"