-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathclient_test.exp
More file actions
executable file
·105 lines (95 loc) · 2.06 KB
/
client_test.exp
File metadata and controls
executable file
·105 lines (95 loc) · 2.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
#!/usr/bin/expect -f
set timeout 30
spawn ./build/examples/mcp/mcp_example_client --port 3333 --verbose
# Wait for connection
expect {
"Connected successfully!" {
send_user "\n Client connected: PASS\n"
}
timeout {
send_user "\n Client connection: TIMEOUT\n"
exit 1
}
}
# Wait for protocol initialization
expect {
"Protocol initialized:" {
send_user " Protocol initialized: PASS\n"
}
timeout {
send_user " Protocol initialization: TIMEOUT\n"
exit 1
}
}
# Wait for feature demonstration (which tests various RPC methods)
expect {
"Demonstrating MCP features..." {
send_user " Feature demonstration started: PASS\n"
}
timeout {
send_user " Feature demonstration: TIMEOUT\n"
exit 1
}
}
# Check for tool listing
expect {
"Available tools:" {
send_user " Tool listing: PASS\n"
}
timeout {
send_user " Tool listing: TIMEOUT\n"
exit 1
}
}
# Check for calculator tool
expect {
"calculator" {
send_user " Calculator tool found: PASS\n"
}
timeout {
send_user " Calculator tool: NOT FOUND\n"
exit 1
}
}
# Check for resource listing
expect {
"Available resources:" {
send_user " Resource listing: PASS\n"
}
timeout {
send_user " Resource listing: TIMEOUT\n"
exit 1
}
}
# Check for prompt listing
expect {
"Available prompts:" {
send_user " Prompt listing: PASS\n"
}
timeout {
send_user " Prompt listing: TIMEOUT\n"
exit 1
}
}
# Let it run for a few ping cycles
expect {
"Ping #1 successful" {
send_user " First ping successful: PASS\n"
}
timeout {
send_user " First ping: TIMEOUT\n"
exit 1
}
}
# Send interrupt to exit cleanly
send "\003"
expect {
"Client shutdown complete" {
send_user " Clean shutdown: PASS\n"
}
timeout {
send_user " Clean shutdown: TIMEOUT\n"
exit 1
}
}
send_user "\n"