Dnsdist check config #3412

Merged
merged 2 commits into from Feb 21, 2016

Projects

None yet

4 participants

@pieterlexis
Member

This allows testing of the configuration before one will try to restart
dnsdist with a broken config. Additionally, add tests to confirm the
config check still works.

pieterlexis added some commits Feb 19, 2016
@pieterlexis pieterlexis dnsdist: Explicitly use python2 for tests 55258af
@pieterlexis pieterlexis dnsdist: add --check-config commandline switch
This allows testing of the configuration before one will try to restart
dnsdist with a broken config. Additionally, add tests to confirm the
config check still works.
5efcfa6
@mind04

-c is --client

@rgacogne rgacogne commented on the diff Feb 19, 2016
pdns/dnsdist.cc
@@ -1303,6 +1308,13 @@ try
g_ACL.setState(acl);
}
+ if (g_cmdLine.checkConfig) {
+ setupLua(true, g_cmdLine.config);
+ // No exception was thrown
+ infolog("Configuration '%s' OK!", g_cmdLine.config);
@rgacogne
rgacogne Feb 19, 2016 Member

Just one thing, setupLua() outputs a warning but does not throw an exception if the configuration file does not exist. I believe that's fine, but that means we will gladly validate a non-existent file, which might not be what you had in mind.

@pieterlexis
pieterlexis Feb 22, 2016 Member

An empty config is a valid config was my reasoning :)

@ahupowerdns ahupowerdns merged commit e09c0df into PowerDNS:master Feb 21, 2016

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
@pieterlexis pieterlexis deleted the pieterlexis:dnsdist-check-config branch Feb 22, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment