Skip to content

Commit

Permalink
Test cases prove t/resolver.t
Browse files Browse the repository at this point in the history
Calling Write just once

Expanding the t/resolver.t TEST 1 documentation

Updating changelog for spliting `resolv.conf` in lines
  • Loading branch information
maneta committed Feb 27, 2018
1 parent 999317e commit 97470e0
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 12 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

## [Unreleased]

- Splitted `resolv.conf` in lines,to avoid commented lines [PR #618](https://github.com/3scale/apicast/pull/618)

## [3.2.0-beta1] - 2018-02-20

## Added
Expand Down
24 changes: 13 additions & 11 deletions spec/resty/resolver_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -163,17 +163,19 @@ describe('resty.resolver', function()
before_each(function()
tmpname = io.tmpfile()

tmpname:write('# nameserver updated in comentary\n')
tmpname:write('#nameserver updated in comentary\n')
tmpname:write('#comentary nameserver 1.2.3.4\n')
tmpname:write('#comentary nameserver\n')
tmpname:write('# search updated.example.com in comentary\n')
tmpname:write('#search updated in comentary\n')
tmpname:write('#search nameserver 1.2.3.4\n')
tmpname:write('#search nameserver\n')
tmpname:write('search localdomain.example.com local\n')
tmpname:write('nameserver 127.0.0.2\n')
tmpname:write('nameserver 127.0.0.1\n')
tmpname:write([[
# nameserver updated in comentary
#nameserver updated in comentary
#comentary nameserver 1.2.3.4
#comentary nameserver
# search updated.example.com in comentary
#search updated in comentary
#search nameserver 1.2.3.4
#search nameserver
search localdomain.example.com local
nameserver 127.0.0.2
nameserver 127.0.0.1
]])
end)

it('returns nameserver touples', function()
Expand Down
13 changes: 12 additions & 1 deletion t/resolver.t
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ run_tests();
__DATA__
=== TEST 1: uses all resolvers
both RESOLVER env variable and resolvers in resolv.conf should be used
both RESOLVER env variable and resolvers in resolv.conf should be used.
checking if commented 'nameserver' and 'search' keywords impact on the
resolv.conf file parsing.
--- main_config
env RESOLVER=$TEST_NGINX_RESOLVER;
--- http_config
Expand All @@ -34,6 +36,15 @@ GET /t
nameservers: 3 127.0.1.15353 1.2.3.453 4.5.6.753
--- user_files
>>> resolv.conf
# nameserver updated in comentary
#nameserver updated in comentary
#comentary nameserver 1.2.3.4
#comentary nameserver
# search updated.example.com in comentary
#search updated in comentary
#search nameserver 1.2.3.4
#search nameserver
search localdomain.example.com local
nameserver 1.2.3.4
nameserver 4.5.6.7
Expand Down

0 comments on commit 97470e0

Please sign in to comment.