landro / TesTcl

when you don't have the balls to test your F5 BIG-IP iRules directly in production
https://testcl.com
BSD 3-Clause "New" or "Revised" License
98 stars 30 forks source link

Documentation should explain what you'll see if misconfigured #47

Closed dkaplan-pivotal closed 7 years ago

dkaplan-pivotal commented 7 years ago

I'm trying to run the script that says

if {"aa" starts_with "a"} {
  puts "The jtcl-irule extension has successfully been installed"
}

But I get an error that says:

syntax error in expression ""aa" starts_with "a"": variable references require preceding $
    ("if" test expression)
    invoked from within
"if {"aa" starts_with "a"} {
  puts "The jtcl-irule extension has successfully been installed"
}"
    (file "misc/f5/irules/test/test_jtcl_irule.tcl" line 1)

Is that because I have not configured jtcl-irule.jar correctly? It would be nice if the documentation provided some troubleshooting information if someone can't get past this step.

dkaplan-pivotal commented 7 years ago

Turns out I put the jtcl-irule.jar too late in the classpath. Consider modifying the docs to say where to put the export CLASSPATH line.

landro commented 7 years ago

Isn't this clear enough? (from doc:)

IMPORTANT!Make sure you place the jtcl-irule.jar on the classpath before the standard jtcl-.jar

2017-02-09 0:10 GMT+01:00 dkaplan-pivotal notifications@github.com:

Turns out I put the jtcl-irule.jar too late in the classpath. Consider modifying the docs to say where to put the export CLASSPATH line.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/landro/TesTcl/issues/47#issuecomment-278492984, or mute the thread https://github.com/notifications/unsubscribe-auth/AACyyfY2hVHRrfEFFWMZSOp5vixtkK1Gks5raktOgaJpZM4L7fF8 .

-- BEKK Open http://open.bekk.no

TesTcl - a unit test framework for iRules http://testcl.com

dkaplan-pivotal commented 7 years ago

Sure, I read that then still made the mistake. I'm new to Tcl so from my perspective there are infinite reasons that the steps would not work. I suspected this was why but not sure.

On Wed, Feb 8, 2017 at 4:06 PM, Stefan Magnus Landrø < notifications@github.com> wrote:

Isn't this clear enough? (from doc:)

IMPORTANT!Make sure you place the jtcl-irule.jar on the classpath before the standard jtcl-.jar

2017-02-09 0:10 GMT+01:00 dkaplan-pivotal notifications@github.com:

Turns out I put the jtcl-irule.jar too late in the classpath. Consider modifying the docs to say where to put the export CLASSPATH line.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/landro/TesTcl/issues/47#issuecomment-278492984, or mute the thread https://github.com/notifications/unsubscribe-auth/ AACyyfY2hVHRrfEFFWMZSOp5vixtkK1Gks5raktOgaJpZM4L7fF8 .

-- BEKK Open http://open.bekk.no

TesTcl - a unit test framework for iRules http://testcl.com

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/landro/TesTcl/issues/47#issuecomment-278504268, or mute the thread https://github.com/notifications/unsubscribe-auth/AL32jFxskhKnMu8AVfZqZ5GoNd-OgW1pks5raliAgaJpZM4L7fF8 .

mcjffld commented 7 years ago

I am getting this error on my tests. examples.sh works fine, but verification test fails:

checking the classpath, the irule JAR is ahead of the standard jtcl JAR file, still getting the error?

jtcl verification/test_jtcl_irule_all.tcl

/Users/mjames/jtcl-2.8.0/jtcl-irule.jar:/Users/mjames/jtcl-2.8.0/jtcl-2.8.0.jar :: printing classpath from jtcl shell script ::

starts_with works as expected ends_with works as expected contains works as expected matches_glob works as expected matches_regex works as expected equals works as expected syntax error in expression " 1 and 1 ": variable references require preceding $ ("if" test expression) invoked from within "if { 1 and 1 } { puts "and works as expected" }" (file "verification/test_jtcl_irule_all.tcl" line 10)

landro commented 7 years ago

hmm - I'm able to reproduce in jtcl 2.8 @mcjffld. Seems like there is an issue related to boolean operators. I'll have to look into that. In the meanwhile, you can either:

mcjffld commented 7 years ago

one other issue that we found, the rule { ... } syntax doesn't work on the version that we are running, 11.4, I think.

I'm guessing that the rule {} syntax was a standard in previous versions? Just wondering.

landro commented 7 years ago

I've added some more docs (ffe609b0e4602804e898bd098e42e7fd708ee1eb) that should help in solving the initial issue. Please report a new issue for the rule{} problem you're hitting, @mcjffld