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

Add support to advanced pool verification #58

Merged
merged 4 commits into from
Jan 30, 2019

Conversation

gszeliga
Copy link

I ran into an issue where endstate would not do the job to verify the last pool set by an iRule when wrapped in a catch expression.

This PR attempts to address that by enriching the available building blocks with the following new statements:

  • given_pools: where you can declare all available pools to be used
  • endstate_pool: an easy way to get back the last pool set by the iRule

This way, you can have things like:

verify "Final pool is the expected one after a match" "go_to_bar" eq { endstate_pool }

which is super awesome to have handy!

Let me know what you think

@landro
Copy link
Owner

landro commented Nov 16, 2018

I'll try to ave a look at this PR within the next few days, @gszeliga !

@landro
Copy link
Owner

landro commented Nov 21, 2018

I'm having seeing a regression in examples/example_irule_pool_verification.tcl
Could you make sure it doesn't break, @gszeliga ?

@gszeliga
Copy link
Author

Hey @landro! Sorry for the buggy example. It should be fine now!

@gszeliga gszeliga force-pushed the support-advanced-pool-verification branch from 1e843f4 to 902ef4c Compare November 23, 2018 12:04
@gszeliga
Copy link
Author

@landro It's been a while since I heard from you. Is there anything I can do to unblock this PR? Thanks!

@landro
Copy link
Owner

landro commented Jan 22, 2019 via email

@landro
Copy link
Owner

landro commented Jan 27, 2019

@gszeliga I'm still getting errors:

➜  TesTcl git:(gszeliga-support-advanced-pool-verification) jtcl examples/example_irule_pool_verification.tcl

**************************************************************************
* it should set the right pool when available
**************************************************************************
-> Test failure!!
-> -> Verification 'Final pool is the expected one after a match' failed - expression: {go_to_bar} eq {}
error     Verification 'Final pool is the expected one after a match' failed - expression: {go_to_bar} eq {}

**************************************************************************
* it should fallback to default LB::server default pool if nothing matches
**************************************************************************
-> Test failure!!
-> -> Verification 'Final pool should be defaults' failed - expression: {fallback} eq {}
error     Verification 'Final pool should be defaults' failed - expression: {fallback} eq {}```

@gszeliga
Copy link
Author

Hey @landro !

Have you checked your TCLLIBPATH? It might be pointing to the wrong version.

I ran the tests again and they look fine this time :(

❯ jtcl examples/example_irule_pool_verification.tcl

**************************************************************************
* it should set the right pool when available
**************************************************************************
verification of 'Final pool is the expected one after a match' done.
-> Test ok

**************************************************************************
* it should fallback to default LB::server default pool if nothing matches
**************************************************************************
verification of 'Final pool should be defaults' done.
-> Test ok

@landro landro merged commit 902ef4c into landro:master Jan 30, 2019
@landro
Copy link
Owner

landro commented Jan 30, 2019

Finally sorted out what was going on. I try to maintain compatibility with Tclsh as much as possible, and therefore had to replace not with ! and fix an issue in the classes match implementation. Thanks for your effort and contribution @gszeliga

@gszeliga gszeliga deleted the support-advanced-pool-verification branch January 31, 2019 14:16
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

Successfully merging this pull request may close these issues.

3 participants