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

support for event context validation #33

Open
samstep opened this issue Aug 13, 2014 · 2 comments
Open

support for event context validation #33

samstep opened this issue Aug 13, 2014 · 2 comments

Comments

@samstep
Copy link

samstep commented Aug 13, 2014

Hi, I would like to request a feature to validate the commands in event context- this is something that F5 does on saving of an iRule, however TesTcl misses entirely . for example the following iRUle will fail to save on F5

rule bad_context {
when HTTP_RESPONSE {
log local.0 "URI is: [HTTP::uri]"
}

}

the error message will be "command not valid in the current event context (HTTP_RESPONSE)[HTTP::uri]

This is a must-have feature in my opinion - the above iRule must raise an error in TesTCL (currently it doesn't!).

DevCentral lists which commands are valid in which event context so I hope this isn't a difficult feature to implement

@landro
Copy link
Owner

landro commented Aug 13, 2014

It would probably make sense to create some kind of post processing step in the run command that validates this kind of stuff. I can't see a simple solution for doing that right now since testcl is a mocking framework and doesn't consider contexts at all. In other programming environments, one would typically pass a context to a method.

@landro
Copy link
Owner

landro commented Aug 13, 2014

Probably the easiest would be to redefine the when command after running the standard current bahaviour, and then validate context stuff.

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