lsquic
lsquic
¤
Classes:
Name | Description |
---|---|
LsquicServiceManager |
|
LsquicServiceManager
¤
LsquicServiceManager(
service_config_to_test: LsquicConfig,
service_type: str,
protocol: ProtocolConfig,
implementation_name: str,
)
Bases: IImplementationManager
Methods:
Name | Description |
---|---|
add_command |
Add a command to a specific phase of execution |
build_command_args |
Builds a list of command arguments with proper escaping |
build_env_vars |
Builds a dictionary of environment variables with proper escaping |
generate_compile_commands |
This method generates and returns a list of compile commands. |
generate_deployment_commands |
Generates a structured list of deployment command arguments for the LSQUIC service. |
generate_post_compile_commands |
Generate a list of post-compile commands. |
generate_post_run_commands |
Generates post-run commands. |
generate_pre_compile_commands |
Generates a list of shell commands to be executed before compilation. |
generate_pre_run_commands |
Generates a list of pre-run commands. |
generate_run_command |
Generates the run command for the LSQUIC service. |
initialize_commands |
Initializes and generates a dictionary of commands to be executed at different stages |
prepare |
Prepare the service manager for use. |
render_commands |
Renders a command using a Jinja2 template with the provided parameters. |
render_template_with_structured_args |
Renders a template with structured parameters for proper quoting |
Source code in .venv/lib/python3.10/site-packages/panther/plugins/services/iut/quic/lsquic/lsquic.py
14 15 16 17 18 19 20 21 22 23 24 |
|
add_command
¤
add_command(
phase,
command,
description=None,
is_function_definition=False,
is_multiline=False,
is_critical=True,
working_dir=None,
environment=None,
timeout=None,
)
Add a command to a specific phase of execution
Parameters:
Name | Type | Description | Default |
---|---|---|---|
|
The phase to add the command to (pre_compile, compile, post_compile, pre_run, run, post_run) |
required | |
|
The command to add (str or ShellCommand) |
required | |
|
Optional description of the command |
None
|
|
|
Whether this command is a shell function definition |
False
|
|
|
Whether this command spans multiple lines |
False
|
|
|
Whether failure of this command should halt execution |
True
|
|
|
Working directory for the command execution |
None
|
|
|
Environment variables for the command |
None
|
|
|
Command timeout in seconds |
None
|
Returns:
Type | Description |
---|---|
None |
Raises:
Type | Description |
---|---|
ValueError
|
If the phase is invalid |
Source code in .venv/lib/python3.10/site-packages/panther/plugins/services/services_interface.py
530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 |
|
build_command_args
¤
build_command_args(command_args)
Builds a list of command arguments with proper escaping
Parameters:
Name | Type | Description | Default |
---|---|---|---|
|
List of command arguments or a single string. If a string is provided, it will be split on spaces, respecting quoted sections. |
required |
Returns:
Name | Type | Description |
---|---|---|
list |
A properly escaped list of command arguments |
Source code in .venv/lib/python3.10/site-packages/panther/plugins/services/services_interface.py
453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 |
|
build_env_vars
¤
build_env_vars(env_dict)
Builds a dictionary of environment variables with proper escaping
Parameters:
Name | Type | Description | Default |
---|---|---|---|
|
Dictionary of environment variables |
required |
Returns:
Name | Type | Description |
---|---|---|
dict |
A properly escaped dictionary of environment variables |
Source code in .venv/lib/python3.10/site-packages/panther/plugins/services/services_interface.py
482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 |
|
generate_compile_commands
¤
generate_compile_commands() -> list[str]
This method generates and returns a list of compile commands. Generates compile commands.
Returns:
Name | Type | Description |
---|---|---|
list |
list[str]
|
An empty list representing the compile commands. |
Source code in .venv/lib/python3.10/site-packages/panther/plugins/services/services_interface.py
372 373 374 375 376 377 378 379 380 |
|
generate_deployment_commands
¤
generate_deployment_commands() -> list
Generates a structured list of deployment command arguments for the LSQUIC service.
This method constructs the command arguments using the structured approach, creating a list of arguments rather than concatenating strings, which ensures proper escaping and handling of special characters.
Returns:
Name | Type | Description |
---|---|---|
list |
list
|
The list of command arguments. |
Source code in .venv/lib/python3.10/site-packages/panther/plugins/services/iut/quic/lsquic/lsquic.py
110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 |
|
generate_post_compile_commands
¤
generate_post_compile_commands() -> list[str]
Generate a list of post-compile commands. This method returns an empty list of strings representing commands to be executed after the compilation process. Returns: List[str]: An empty list of post-compile commands.
Source code in .venv/lib/python3.10/site-packages/panther/plugins/services/services_interface.py
382 383 384 385 386 387 388 389 390 391 |
|
generate_post_run_commands
¤
generate_post_run_commands()
Generates post-run commands.
Source code in .venv/lib/python3.10/site-packages/panther/plugins/services/iut/quic/lsquic/lsquic.py
81 82 83 84 85 |
|
generate_pre_compile_commands
¤
generate_pre_compile_commands() -> list
Generates a list of shell commands to be executed before compilation.
Returns:
Name | Type | Description |
---|---|---|
list |
list
|
A list of either string commands or ShellCommand objects if available |
Source code in .venv/lib/python3.10/site-packages/panther/plugins/services/services_interface.py
313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 |
|
generate_pre_run_commands
¤
generate_pre_run_commands() -> list[str]
Generates a list of pre-run commands. This method returns an empty list of strings, which can be overridden by subclasses to provide specific pre-run commands required for their execution context. Returns: List[str]: An empty list of strings representing pre-run commands.
Source code in .venv/lib/python3.10/site-packages/panther/plugins/services/services_interface.py
393 394 395 396 397 398 399 400 401 402 |
|
generate_run_command
¤
generate_run_command()
Generates the run command for the LSQUIC service.
This method constructs a complete run command configuration using the structured approach for proper quoting and escaping of all command arguments and environment variables.
Returns:
Name | Type | Description |
---|---|---|
dict |
The run command configuration with all necessary components. |
Source code in .venv/lib/python3.10/site-packages/panther/plugins/services/iut/quic/lsquic/lsquic.py
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 |
|
initialize_commands
¤
initialize_commands() -> dict
Initializes and generates a dictionary of commands to be executed at different stages of the process (pre-compile, compile, post-compile, pre-run, run, post-run).
The dictionary keys are
- "pre_compile_cmds": Commands to be executed before compilation.
- "compile_cmds": Commands to be executed during compilation.
- "post_compile_cmds": Commands to be executed after compilation.
- "pre_run_cmds": Commands to be executed before running.
- "run_cmd": Command to be executed to run the main process.
- "post_run_cmds": Commands to be executed after running.
Returns:
Name | Type | Description |
---|---|---|
dict |
dict
|
A dictionary containing the commands for each stage. |
Source code in .venv/lib/python3.10/site-packages/panther/plugins/services/services_interface.py
285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 |
|
prepare
¤
prepare(plugin_loader: PluginLoader | None = None)
Prepare the service manager for use.
Source code in .venv/lib/python3.10/site-packages/panther/plugins/services/iut/quic/lsquic/lsquic.py
87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 |
|
render_commands
¤
render_commands(
params,
template_name,
command_args=None,
env_vars=None,
extra_fields=None,
)
Renders a command using a Jinja2 template with the provided parameters.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
|
Dictionary containing regular parameters for template rendering. |
required | |
|
Name of the template to render. |
required | |
|
List of command arguments for structured command generation. |
None
|
|
|
Dictionary of environment variables for structured command generation. |
None
|
|
|
Additional YAML fragments as a string for structured templates. |
None
|
Returns:
Name | Type | Description |
---|---|---|
str |
The rendered command string. |
Source code in .venv/lib/python3.10/site-packages/panther/plugins/services/services_interface.py
235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 |
|
render_template_with_structured_args
¤
render_template_with_structured_args(
template_name,
params=None,
command_args=None,
env_vars=None,
extra_fields=None,
)
Renders a template with structured parameters for proper quoting
Parameters:
Name | Type | Description | Default |
---|---|---|---|
|
Name of the template file |
required | |
|
Additional parameters to pass to the template |
None
|
|
|
List of command arguments or a string to be split |
None
|
|
|
Dictionary of environment variables |
None
|
|
|
String with additional YAML fragments |
None
|
Returns:
Name | Type | Description |
---|---|---|
str |
The rendered template with properly quoted values |
Source code in .venv/lib/python3.10/site-packages/panther/plugins/services/services_interface.py
501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 |
|