Closed olanystrom closed 4 years ago
Currently this is not directly supported. Have you tried wrapping using the tcl source command?
- okt. 2019 kl. 12:20 skrev olanystrom notifications@github.com:
I use a lot of iRules with ansibles bigip_irule and the irules and not wrapped in rule name { IRULE } Is there a way to use testcl to test them?
Or do I have to make a builder-script to wrap the files in rule NAME {} to be able to test them?
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.
That works fine. I have a tests-directory with the test and a .tcl that wraps with
rule name {
source ../real_irule
}```
Now I have to figure out how to test my class-based stuff
Have you checked https://github.com/landro/TesTcl/blob/master/examples/example_irule_classes.tcl
- okt. 2019 kl. 14:43 skrev olanystrom notifications@github.com:
That works fine. I have a tests-directory with the test and a .tcl that wraps with
rule name { source ../real_irule }```
Now I have to figure out how to test my class-based stuff — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.
Have you checked https://github.com/landro/TesTcl/blob/master/examples/example_irule_classes.tcl … Yes, and that makes it mostly succesful.
I had to rewrite some irules to be allowed with testcl.
if{ $lower_host eq "example.com"}
{
do_something
}
that we have in production in F5:s are not allowed in the test, it has to be rewritten as
if{ $lower_host eq "example.com"} {
do_something
}
also, it didnt like my use of [HTTP::host] inside strings. For example it didn't like
log local0. "Access to [HTTP::host] with uri [HTTP::uri]"
At least I think that was the problem.
I use a lot of iRules with ansibles bigip_irule and the irules and not wrapped in
rule name { IRULE }
Is there a way to use testcl to test them?Or do I have to make a builder-script to wrap the files in
rule NAME {}
to be able to test them?