|
152 | 152 | assert: |
153 | 153 | - type: javascript |
154 | 154 | value: output.length === 0 |
| 155 | + |
| 156 | +# 12. Terminate multiple VMs (comma-separated list) |
| 157 | +- vars: |
| 158 | + input: "Terminate VMs 3, 5, 7." |
| 159 | + options: |
| 160 | + transform: file://transforms/extract_function_call.js |
| 161 | + assert: |
| 162 | + - type: javascript |
| 163 | + value: output.length === 1 && |
| 164 | + output[0].function === 'manage_vm' && |
| 165 | + output[0].arguments.vm_id === '3,5,7' && |
| 166 | + output[0].arguments.operation === 'terminate' |
| 167 | + |
| 168 | +# 13. Terminate multiple VMs (range syntax) |
| 169 | +- vars: |
| 170 | + input: "Terminate VMs 5 through 10." |
| 171 | + options: |
| 172 | + transform: file://transforms/extract_function_call.js |
| 173 | + assert: |
| 174 | + - type: javascript |
| 175 | + value: output.length === 1 && |
| 176 | + output[0].function === 'manage_vm' && |
| 177 | + output[0].arguments.vm_id === '5..10' && |
| 178 | + output[0].arguments.operation === 'terminate' |
| 179 | + |
| 180 | +# 14. Force-terminate multiple VMs (hard flag) |
| 181 | +- vars: |
| 182 | + input: "Force-terminate VMs 12 and 13 now." |
| 183 | + options: |
| 184 | + transform: file://transforms/extract_function_call.js |
| 185 | + assert: |
| 186 | + - type: javascript |
| 187 | + value: output.length === 1 && |
| 188 | + output[0].function === 'manage_vm' && |
| 189 | + output[0].arguments.vm_id === '12,13' && |
| 190 | + output[0].arguments.operation === 'terminate' && |
| 191 | + output[0].arguments.hasOwnProperty('hard') && output[0].arguments.hard === true |
| 192 | + |
| 193 | +# 15. Invalid multi-VM format (spaces instead of commas) |
| 194 | +- vars: |
| 195 | + input: "Terminate VMs id: 1 2 3." |
| 196 | + options: |
| 197 | + transform: file://transforms/extract_function_call.js |
| 198 | + assert: |
| 199 | + - type: javascript |
| 200 | + value: output[0].function == 'manage_vm' && (output[0].arguments.vm_id == '1,2,3' || output[0].arguments.vm_id == '1..3') |
| 201 | + |
| 202 | +# 16. Stop multiple VMs (comma-list) |
| 203 | +- vars: |
| 204 | + input: "Power off VMs 3,4,5." |
| 205 | + options: |
| 206 | + transform: file://transforms/extract_function_call.js |
| 207 | + assert: |
| 208 | + - type: javascript |
| 209 | + value: output.length === 1 && |
| 210 | + output[0].function === 'manage_vm' && |
| 211 | + output[0].arguments.vm_id === '3,4,5' && |
| 212 | + output[0].arguments.operation === 'stop' |
| 213 | + |
| 214 | +# 17. Stop multiple VMs (range syntax) |
| 215 | +- vars: |
| 216 | + input: "Power off VMs 10 through 15." |
| 217 | + options: |
| 218 | + transform: file://transforms/extract_function_call.js |
| 219 | + assert: |
| 220 | + - type: javascript |
| 221 | + value: output.length === 1 && |
| 222 | + output[0].function === 'manage_vm' && |
| 223 | + output[0].arguments.vm_id === '10..15' && |
| 224 | + output[0].arguments.operation === 'stop' |
| 225 | + |
| 226 | +# 18. Hard-stop multiple VMs |
| 227 | +- vars: |
| 228 | + input: "Force power off VMs 7,8,9 immediately." |
| 229 | + options: |
| 230 | + transform: file://transforms/extract_function_call.js |
| 231 | + assert: |
| 232 | + - type: javascript |
| 233 | + value: output.length === 1 && |
| 234 | + output[0].function === 'manage_vm' && |
| 235 | + output[0].arguments.vm_id === '7,8,9' && |
| 236 | + output[0].arguments.operation === 'stop' && |
| 237 | + output[0].arguments.hasOwnProperty('hard') && output[0].arguments.hard === true |
| 238 | + |
| 239 | +# 19. Start multiple VMs (comma-list) |
| 240 | +- vars: |
| 241 | + input: "Start VMs 20,21,22." |
| 242 | + options: |
| 243 | + transform: file://transforms/extract_function_call.js |
| 244 | + assert: |
| 245 | + - type: javascript |
| 246 | + value: output.length === 1 && |
| 247 | + output[0].function === 'manage_vm' && |
| 248 | + output[0].arguments.vm_id === '20,21,22' && |
| 249 | + output[0].arguments.operation === 'start' |
| 250 | + |
| 251 | +# 20. Start multiple VMs (range syntax) |
| 252 | +- vars: |
| 253 | + input: "Start VMs 25 through 30." |
| 254 | + options: |
| 255 | + transform: file://transforms/extract_function_call.js |
| 256 | + assert: |
| 257 | + - type: javascript |
| 258 | + value: output.length === 1 && |
| 259 | + output[0].function === 'manage_vm' && |
| 260 | + output[0].arguments.vm_id === '25..30' && |
| 261 | + output[0].arguments.operation === 'start' |
| 262 | + |
| 263 | +# 21. Reboot multiple VMs (comma-list) |
| 264 | +- vars: |
| 265 | + input: "Reboot VMs 31,32,33." |
| 266 | + options: |
| 267 | + transform: file://transforms/extract_function_call.js |
| 268 | + assert: |
| 269 | + - type: javascript |
| 270 | + value: output.length === 1 && |
| 271 | + output[0].function === 'manage_vm' && |
| 272 | + output[0].arguments.vm_id === '31,32,33' && |
| 273 | + output[0].arguments.operation === 'reboot' |
| 274 | + |
| 275 | +# 22. Hard-reboot multiple VMs (range) |
| 276 | +- vars: |
| 277 | + input: "Force reboot VMs 40 through 45 immediately." |
| 278 | + options: |
| 279 | + transform: file://transforms/extract_function_call.js |
| 280 | + assert: |
| 281 | + - type: javascript |
| 282 | + value: output.length === 1 && |
| 283 | + output[0].function === 'manage_vm' && |
| 284 | + output[0].arguments.vm_id === '40..45' && |
| 285 | + output[0].arguments.operation === 'reboot' && |
| 286 | + output[0].arguments.hasOwnProperty('hard') && output[0].arguments.hard === true |
| 287 | + |
| 288 | +# 23. Mixed operations with multi-VM (should split into separate calls) |
| 289 | +- vars: |
| 290 | + input: "Start VMs 50,51 and terminate VMs 52 through 54." |
| 291 | + options: |
| 292 | + transform: file://transforms/extract_function_call.js |
| 293 | + assert: |
| 294 | + - type: javascript |
| 295 | + value: output.length === 2 && |
| 296 | + output[0].function === 'manage_vm' && |
| 297 | + output[0].arguments.vm_id === '50,51' && |
| 298 | + output[0].arguments.operation === 'start' && |
| 299 | + output[1].function === 'manage_vm' && |
| 300 | + output[1].arguments.vm_id === '52..54' && |
| 301 | + output[1].arguments.operation === 'terminate' |
| 302 | + |
| 303 | +# 24. Invalid multi-VM format with mixed delimiters |
| 304 | +- vars: |
| 305 | + input: "Stop VMs 60..61,62." |
| 306 | + options: |
| 307 | + transform: file://transforms/extract_function_call.js |
| 308 | + assert: |
| 309 | + - type: javascript |
| 310 | + value: output.length === 0 || |
| 311 | + (output[0].function === 'manage_vm' && |
| 312 | + (output[0].arguments.vm_id === '60..62' || output[0].arguments.vm_id === '60,61,62')) |
0 commit comments