Fix args passed to create_tsig_opts#68
Conversation
1 similar comment
|
Firstly, thanks for doing all this, and investing the time in making this a better gem. Is it possible to reduce your script to a code fragment that can be a test method in test/tc_resolver.rb, preferably testing as narrow a scope of code as possible (e.g. not the whole AXFR operation, if that's possible), and without access to a server? To test just that test file from the command line you can do: Since the other tests in that file take a while to run, I disable them by wrapping them in: =begin
# all the other tests
=endWe would want to ensure that not only does it pass after the modification, but also that it fails before it. Looking at create_tsig_options, it looks like there's a misleading arg test and comment; it appears to permit an arg array of size 1, but in the code it looks like it does nothing with such an array. I suspect that this is not the intended action. So although the test does not fail, it may not be behaving correctly either. The correct behavior might be to use the splat on args0 to expand the elements into separate function arguments, rather than to pass the array as itself. (And, to fix create_tsig_options so that it prohibits an array size of 1 and is documented as such.) |
Fix args passed to create_tsig_opts
|
@keithrbennett Hi, just opened a new pr #69 . Tried to work as you suggested and fixed a small bug. |
Wrong argument is passed to the create_tsig_options in the Resolver.get_tsig function.
The function checks if args[0] is an Array and then it passes just args.
Fixing this makes AXFR w/ TSIG work again.
This is a sample working code.