Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

event priority support #29

Closed
samstep opened this issue Aug 11, 2014 · 3 comments
Closed

event priority support #29

samstep opened this issue Aug 11, 2014 · 3 comments

Comments

@samstep
Copy link

samstep commented Aug 11, 2014

Hi, I would like to request the ability to support events with priorities, e.g.:

when <event_name> priority nnn

As per F5 documentation priorit could be a number between 1-1000 (500 is the default value if priority is omitted)

Here is what happens when I try to test an iRule with priority set in TesTcl 1.0.5:

error Expected return code 200 from calling when, got 1
error Error info: wrong # args: should be "when event body"
error while executing
error "when HTTP_REQUEST priority 100 {

TesTcl should understand if there are multiple event handlers for an event (e.g HTTP_REQUEST) with different priorities and handle the test cases correctly in the order of priority

@landro
Copy link
Owner

landro commented Aug 11, 2014

Quite easy to implement support for tolerating optional arguments (so it won't crash). Handling side effects is more difficult. Currently there is no support for chaining irules (or different when command calls). Would you be able to provide a real world example irule file and attach it here, @samstep ?

@landro
Copy link
Owner

landro commented Aug 13, 2014

@samstep , can you please try out this branch, and see if it works as expected?

@samstep
Copy link
Author

samstep commented Aug 15, 2014

Hi @landro - Itried it and modified it a bit. It has unnecessary "elseif/else" block in my opinion and can be rewritten as:

if {[llength $args] <2} {
error "wrong # args for when"
} else {
set event [lindex $args 0]
set body [lindex $args end]
}

Sorry I am unable to do a git commit at the moment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants