From 2397c86b17e71f1472a867dfa1fb4e7223cb811c Mon Sep 17 00:00:00 2001 From: JINMEI Tatuya Date: Thu, 5 Apr 2012 17:37:29 -0700 Subject: [PATCH 1/6] [1792] unrelated style fix per guideline. should be obvious from the diff. --- src/lib/datasrc/factory.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/datasrc/factory.h b/src/lib/datasrc/factory.h index 9d0a7620ad..f3ca397598 100644 --- a/src/lib/datasrc/factory.h +++ b/src/lib/datasrc/factory.h @@ -163,7 +163,7 @@ public: /// /// \return Reference to the DataSourceClient instance contained in this /// container. - DataSourceClient& getInstance() { return *instance_; } + DataSourceClient& getInstance() { return (*instance_); } private: DataSourceClient* instance_; From aaf4fb3d70f5868ba9c6fa16c490abd7ed5035d3 Mon Sep 17 00:00:00 2001 From: JINMEI Tatuya Date: Thu, 5 Apr 2012 21:34:01 -0700 Subject: [PATCH 2/6] [1792] unrelated cleanup: constify and fold a long line just noticed them and the changes are small, so I did it here. --- src/lib/datasrc/sqlite3_accessor_link.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/lib/datasrc/sqlite3_accessor_link.cc b/src/lib/datasrc/sqlite3_accessor_link.cc index 81ac6b5bc2..c064e0f2e3 100644 --- a/src/lib/datasrc/sqlite3_accessor_link.cc +++ b/src/lib/datasrc/sqlite3_accessor_link.cc @@ -82,13 +82,15 @@ createInstance(isc::data::ConstElementPtr config, std::string& error) { error = "Configuration error: " + errors->str(); return (NULL); } - std::string dbfile = config->get(CONFIG_ITEM_DATABASE_FILE)->stringValue(); + const std::string dbfile = + config->get(CONFIG_ITEM_DATABASE_FILE)->stringValue(); try { boost::shared_ptr sqlite3_accessor( new SQLite3Accessor(dbfile, "IN")); // XXX: avoid hardcode RR class return (new DatabaseClient(isc::dns::RRClass::IN(), sqlite3_accessor)); } catch (const std::exception& exc) { - error = std::string("Error creating sqlite3 datasource: ") + exc.what(); + error = std::string("Error creating sqlite3 datasource: ") + + exc.what(); return (NULL); } catch (...) { error = std::string("Error creating sqlite3 datasource, " From 08d13321640259a5036053852ff0c8731b54239c Mon Sep 17 00:00:00 2001 From: JINMEI Tatuya Date: Mon, 9 Apr 2012 15:55:30 -0700 Subject: [PATCH 3/6] [1792] moved rwtest.sqlite3 under lib/testutils so that it can be shared. it's going to be used in subsequent auth tests. --- src/lib/datasrc/tests/Makefile.am | 1 - src/lib/datasrc/tests/database_unittest.cc | 2 +- src/lib/datasrc/tests/test_client.cc | 2 +- src/lib/testutils/testdata/Makefile.am | 1 + .../testdata/auth_test.sqlite3} | Bin .../testutils/testdata/auth_test.sqlite3.copied | Bin 0 -> 16384 bytes src/lib/testutils/testdata/rwtest.sqlite3 | Bin 0 -> 16384 bytes 7 files changed, 3 insertions(+), 3 deletions(-) rename src/lib/{datasrc/tests/testdata/rwtest.sqlite3 => testutils/testdata/auth_test.sqlite3} (100%) mode change 100644 => 100755 create mode 100755 src/lib/testutils/testdata/auth_test.sqlite3.copied create mode 100644 src/lib/testutils/testdata/rwtest.sqlite3 diff --git a/src/lib/datasrc/tests/Makefile.am b/src/lib/datasrc/tests/Makefile.am index c635c33d8b..49a606e84e 100644 --- a/src/lib/datasrc/tests/Makefile.am +++ b/src/lib/datasrc/tests/Makefile.am @@ -106,7 +106,6 @@ EXTRA_DIST += testdata/mkbrokendb.c EXTRA_DIST += testdata/root.zone EXTRA_DIST += testdata/rrset_toWire1 EXTRA_DIST += testdata/rrset_toWire2 -EXTRA_DIST += testdata/rwtest.sqlite3 EXTRA_DIST += testdata/sql1.example.com.signed EXTRA_DIST += testdata/sql2.example.com.signed EXTRA_DIST += testdata/test-root.sqlite3 diff --git a/src/lib/datasrc/tests/database_unittest.cc b/src/lib/datasrc/tests/database_unittest.cc index 9362a46f11..3f59001a55 100644 --- a/src/lib/datasrc/tests/database_unittest.cc +++ b/src/lib/datasrc/tests/database_unittest.cc @@ -1090,7 +1090,7 @@ public: // probably move this to some specialized templated method specific // to SQLite3 (or for even a longer term we should add an API to // purge the diffs table). - const char* const install_cmd = INSTALL_PROG " " TEST_DATA_DIR + const char* const install_cmd = INSTALL_PROG " " TEST_DATA_COMMONDIR "/rwtest.sqlite3 " TEST_DATA_BUILDDIR "/rwtest.sqlite3.copied"; if (system(install_cmd) != 0) { diff --git a/src/lib/datasrc/tests/test_client.cc b/src/lib/datasrc/tests/test_client.cc index 7709a3bc59..58b43e0237 100644 --- a/src/lib/datasrc/tests/test_client.cc +++ b/src/lib/datasrc/tests/test_client.cc @@ -66,7 +66,7 @@ createSQLite3Client(RRClass zclass, const Name& zname, // We always begin with an empty template SQLite3 DB file and install // the zone data from the zone file to ensure both cases have the // same test data. - const char* const install_cmd_prefix = INSTALL_PROG " " TEST_DATA_DIR + const char* const install_cmd_prefix = INSTALL_PROG " " TEST_DATA_COMMONDIR "/rwtest.sqlite3 "; const string install_cmd = string(install_cmd_prefix) + db_file; if (system(install_cmd.c_str()) != 0) { diff --git a/src/lib/testutils/testdata/Makefile.am b/src/lib/testutils/testdata/Makefile.am index a6b82064ce..b9ef53f9f1 100644 --- a/src/lib/testutils/testdata/Makefile.am +++ b/src/lib/testutils/testdata/Makefile.am @@ -27,6 +27,7 @@ EXTRA_DIST += rfc5155-example.zone.signed EXTRA_DIST += example.com EXTRA_DIST += example.sqlite3 +EXTRA_DIST += rwtest.sqlite3 # SQLite3 DB file as a template data source EXTRA_DIST += test1.zone.in EXTRA_DIST += test1-new.zone.in diff --git a/src/lib/datasrc/tests/testdata/rwtest.sqlite3 b/src/lib/testutils/testdata/auth_test.sqlite3 old mode 100644 new mode 100755 similarity index 100% rename from src/lib/datasrc/tests/testdata/rwtest.sqlite3 rename to src/lib/testutils/testdata/auth_test.sqlite3 diff --git a/src/lib/testutils/testdata/auth_test.sqlite3.copied b/src/lib/testutils/testdata/auth_test.sqlite3.copied new file mode 100755 index 0000000000000000000000000000000000000000..205e4ef54f2812d6be4314afc93bff7e9c637deb GIT binary patch literal 16384 zcmeI3%WvB@7{E!%kHvY^ZHnpO!-xSwBGd~Cbho1D)KnRasZyILKy#^~T1sNfmQ%^w znjHo>9d_R?yX+s>t-G%OL9xGL$9BMO!-`%;QnD?^j~bZc2F|CLdQcR}@AvWh_>i*m zz^u1@vfm1uZkyad8H6$Vj1Yv7N<)!`MH(a;KB7UUp}XPk$(W;xKKb+GEKPvrw=7vf zek=boCOzB&0zhCE1hUJtl!XtU#Zu6+&Z{WE9e}&{%b0;te1O$LUj{vv-%eZU#%nMX3#O$9= z`e6eCK;Qxri2MJSNPc+%g$I#=z}yh{6fYpGs?sW26FT|yaDSz^W9u7agIw?arRM*0 zLjnW=0zhCW0XF|n&j9%RAIASfSwSQan0o?j{GUTF5PE@c;~ynk`dNNHO`#v*oT6#? zxa~e}_)+c9Z@Sg5{V=Mx0`W@P+%|N_AdY^=G>CYQtS66lJUDF}gwflvfa_t)4i)-+tLBFM_M*fqp{GjGX;^nd^ zpm=jVaGQRaKB;wXF6I?Q!6&;s&u?3SAMssAc%Da*^}5%q-Tm##J$-wRd|~XB3CoT+ z#zTjb;+5XCO_Kq(>`i^gD3j2uHQXo~o2n=2TE$u`6EBD&zeeuZwrS{AKkGh^t)-lz zD!5t?JpU=LWA*Vds|-KCl!#EV?ivqC`Zlqx_?mDM+R2B@d8Jgs-^-jr=+|1I7bSb=w}{!?c<|&DIuyK^ivIL$Zfl#el%-^+EWQ1 zaKMS^3F71`FF+QPFw8w(Ofrqxe-_b~|8KB~f0v$1|H?n1KVlD%nSSejrY`W-{e#B! z>ecu6BfeV_bjqVfX_V-@j$N_n1NRKeDHlk0qqWXVY(5VzQOhmiFHeCC8I=T)Jc1-o zBcS9lTBDd(Zk2Fn`Ba`v!&Nu%s_D#&BQh5gi>2@uMJ<zlw2-;w5j7)R(0w*RdwDF?%4qphD+m7lK&P}8>= z$OHvTt(|07V|w*d4e`b93_-_Wl~-1$0y!g!~pP0IkL-I0JlOf%8Rxz5h$r|JncfEaKbfFZA84>NwjO^BD|Lr#*^>buYd$IXF+9*23cS zm$W8caiR;kqt{_3nfaf^f-SuNpOvqJa)7{lCou5-KeqqZNPhj^>jo770zlyG2wcsq Ns(8oN(;o!l{{WON#Uua# literal 0 HcmV?d00001 diff --git a/src/lib/testutils/testdata/rwtest.sqlite3 b/src/lib/testutils/testdata/rwtest.sqlite3 new file mode 100644 index 0000000000000000000000000000000000000000..5eeb2c333e06972a72b5413b13e57522dc7e798c GIT binary patch literal 16384 zcmeI3&2Q5%6u|AKAFTW2L*&o{7TUz36@77dD?qE!oWxTt>>wHymY>y{l;eMV)Ci7OUbq|-)i>akm@<3fp5>_2C z)W-%V#Tz}B(KH5F&&;Kk)g*DPT*36bwo)}sZ>04bNn$ykXXnUlCZnk-yI6n6G|P(l*@&h73!6{R(WUZBqMnFjk;8;h0L-k+DFkxs6Qp} z1_$h`?j!cEVgh7Qgki4nVwx$;|09Tg`TrYh_)BO%^h^_f1splr}(bcx<74ITPxu zc~%h0BzL;wonzDVHpR|InmcIerDMA%$oz+MxK?ZbU%1pTz;NAY?`KWr=OY5t#$pE2 zN5Q0(-N@xCy?j$gydcnP+Y#H*J8r_N4mzbR+cnE{{yS#O=wPsM-THuWG}yElCJ1^f zPk%yZzvUYWeU#$(Gy3G`ovi~Hj89rhw;Z6`6A6r`{KYHyW#ep)r?CD%Tf-c*1_<<$ z0Qi3|X~VOCz}X_u@ckeApU)tkLEq8qUbV5eE9O&pMeX)mH0*ovoypd9YPU8PyT7H? z@s1PS$PM0y>15@98XLCE|FQG~(GLV500jD*z?d{4`~v_t%>VtZIcNt2fItg@zt;w) A-2eap literal 0 HcmV?d00001 From 501c5f296f27b565b6e2229e62f8f19754818abf Mon Sep 17 00:00:00 2001 From: JINMEI Tatuya Date: Mon, 9 Apr 2012 16:34:16 -0700 Subject: [PATCH 4/6] [1792] added supplemental utility for tests using SQLite3 backend. it creates a temporary SQLite3 DB file from a shared template with a specified stream of zone data. this will help reduce the number of pre-generated DB files in the repository (which will be subject to upgrading the schema). --- src/bin/auth/tests/datasrc_util.cc | 77 ++++++++++++++++++++++++++++++ src/bin/auth/tests/datasrc_util.h | 61 +++++++++++++++++++++++ 2 files changed, 138 insertions(+) create mode 100644 src/bin/auth/tests/datasrc_util.cc create mode 100644 src/bin/auth/tests/datasrc_util.h diff --git a/src/bin/auth/tests/datasrc_util.cc b/src/bin/auth/tests/datasrc_util.cc new file mode 100644 index 0000000000..d9e99b69b0 --- /dev/null +++ b/src/bin/auth/tests/datasrc_util.cc @@ -0,0 +1,77 @@ +// Copyright (C) 2012 Internet Systems Consortium, Inc. ("ISC") +// +// Permission to use, copy, modify, and/or distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH +// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +// AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, +// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE +// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +// PERFORMANCE OF THIS SOFTWARE. + +#include + +#include +#include +#include + +#include + +#include +#include +#include + +#include "datasrc_util.h" + +#include + +#include + +#include + +using namespace std; + +using namespace isc::dns; +using namespace isc::data; +using namespace isc::datasrc; + +namespace isc { +namespace auth { +namespace unittest { + +namespace { +void +addRRset(ZoneUpdaterPtr updater, ConstRRsetPtr rrset) { + updater->addRRset(*rrset); +} +} + +void +createSQLite3DB(RRClass zclass, const Name& zname, + const char* const db_file, istream& rr_stream) +{ + // We always begin with an empty template SQLite3 DB file and install + // the zone data from the zone file. + const char* const install_cmd_prefix = INSTALL_PROG " " TEST_DATA_DIR + "/rwtest.sqlite3 "; + const string install_cmd = string(install_cmd_prefix) + db_file; + if (system(install_cmd.c_str()) != 0) { + isc_throw(isc::Unexpected, + "Error setting up; command failed: " << install_cmd); + } + + DataSourceClientContainer container("sqlite3", + Element::fromJSON( + "{\"database_file\": \"" + + string(db_file) + "\"}")); + ZoneUpdaterPtr updater = container.getInstance().getUpdater(zname, true); + masterLoad(rr_stream, zname, zclass, boost::bind(addRRset, updater, _1)); + updater->commit(); +} + +} // end of unittest +} // end of auth +} // end of isc diff --git a/src/bin/auth/tests/datasrc_util.h b/src/bin/auth/tests/datasrc_util.h new file mode 100644 index 0000000000..fc4109bdef --- /dev/null +++ b/src/bin/auth/tests/datasrc_util.h @@ -0,0 +1,61 @@ +// Copyright (C) 2012 Internet Systems Consortium, Inc. ("ISC") +// +// Permission to use, copy, modify, and/or distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH +// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +// AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, +// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE +// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +// PERFORMANCE OF THIS SOFTWARE. + +#ifndef __AUTH_DATA_SOURCE_UTIL_H +#define __AUTH_DATA_SOURCE_UTIL_H 1 + +#include +#include + +#include + +namespace isc { +namespace auth { +namespace unittest { + +// Here we define utility modules for the convenience of tests that create +// a data source client according to the specified conditions. + +/// \brief Create an SQLite3 data source client from a stream. +/// +/// This function creates an SQLite3 DB file for the specified zone +/// with specified content. The zone will be created in the given +/// SQLite3 database file. The database file does not have to exist; +/// this function will automatically create a new file for the test +/// based on a template that only contains the necessary schema. If +/// the given file already exists this function overrides the content +/// (so basically the file must be an ephemeral one only for that test +/// case). +/// +/// The input stream must produce strings as the corresponding +/// \c dns::masterLoad() function expects. +/// +/// \param zclass The RR class of the zone +/// \param zname The origin name of the zone +/// \param db_file The SQLite3 data base file in which the zone data should be +/// installed. +/// \param rr_stream An input stream that produces zone data. +void +createSQLite3DB(dns::RRClass zclass, const dns::Name& zname, + const char* const db_file, std::istream& rr_stream); + +} // end of unittest +} // end of auth +} // end of isc + +#endif // __AUTH_DATA_SOURCE_UTIL_H + +// Local Variables: +// mode: c++ +// End: From 9b060a79e29c1691d1e84da5d6a656e99f2ec8a2 Mon Sep 17 00:00:00 2001 From: JINMEI Tatuya Date: Mon, 9 Apr 2012 16:35:57 -0700 Subject: [PATCH 5/6] [1792] added support for "sqlite3" filetype of inmemory zone. --- src/bin/auth/auth_config.cc | 38 +++++++++++++++++------- src/bin/auth/tests/Makefile.am | 4 +++ src/bin/auth/tests/config_unittest.cc | 42 ++++++++++++++++++++++++--- 3 files changed, 70 insertions(+), 14 deletions(-) diff --git a/src/bin/auth/auth_config.cc b/src/bin/auth/auth_config.cc index 3b391d3da5..3a04dc8a6b 100644 --- a/src/bin/auth/auth_config.cc +++ b/src/bin/auth/auth_config.cc @@ -12,14 +12,6 @@ // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR // PERFORMANCE OF THIS SOFTWARE. -#include -#include -#include -#include - -#include -#include - #include #include @@ -27,6 +19,7 @@ #include #include +#include #include #include @@ -34,6 +27,15 @@ #include +#include +#include +#include + +#include +#include +#include +#include + using namespace std; using namespace isc::dns; using namespace isc::data; @@ -165,10 +167,21 @@ MemoryDatasourceConfig::build(ConstElementPtr config_value) { isc_throw(AuthConfigError, "Missing zone file for zone: " << origin_txt); } + + // We support the traditional text type and SQLite3 backend. For the + // latter we create a client for the underlying SQLite3 data source, + // and build the in-memory zone using an iterator of the underlying + // zone. ConstElementPtr filetype = zone_config->get("filetype"); const string filetype_txt = filetype ? filetype->stringValue() : "text"; - if (filetype_txt != "text") { + boost::scoped_ptr container; + if (filetype_txt == "sqlite3") { + container.reset(new DataSourceClientContainer( + "sqlite3", + Element::fromJSON("{\"database_file\": \"" + + file_txt + "\"}"))); + } else if (filetype_txt != "text") { isc_throw(AuthConfigError, "Invalid filetype for zone " << origin_txt << ": " << filetype_txt); } @@ -198,7 +211,12 @@ MemoryDatasourceConfig::build(ConstElementPtr config_value) { * need the load method to be split into some kind of build and * commit/abort parts. */ - zone_finder->load(file_txt); + if (filetype_txt == "text") { + zone_finder->load(file_txt); + } else { + zone_finder->load(*container->getInstance().getIterator( + Name(origin_txt))); + } } } diff --git a/src/bin/auth/tests/Makefile.am b/src/bin/auth/tests/Makefile.am index 521890eb76..b33c7af91b 100644 --- a/src/bin/auth/tests/Makefile.am +++ b/src/bin/auth/tests/Makefile.am @@ -12,6 +12,9 @@ AM_CXXFLAGS = $(B10_CXXFLAGS) if USE_STATIC_LINK AM_LDFLAGS = -static +# Some test cases cannot work with static link. To selectively disable such +# tests we signal it via a definition. +AM_CPPFLAGS += -DUSE_STATIC_LINK=1 endif CLEANFILES = *.gcno *.gcda @@ -29,6 +32,7 @@ run_unittests_SOURCES += ../auth_config.h ../auth_config.cc run_unittests_SOURCES += ../command.h ../command.cc run_unittests_SOURCES += ../common.h ../common.cc run_unittests_SOURCES += ../statistics.h ../statistics.cc +run_unittests_SOURCES += datasrc_util.h datasrc_util.cc run_unittests_SOURCES += auth_srv_unittest.cc run_unittests_SOURCES += config_unittest.cc run_unittests_SOURCES += config_syntax_unittest.cc diff --git a/src/bin/auth/tests/config_unittest.cc b/src/bin/auth/tests/config_unittest.cc index 7b4a2250b9..d471a53c9a 100644 --- a/src/bin/auth/tests/config_unittest.cc +++ b/src/bin/auth/tests/config_unittest.cc @@ -21,6 +21,7 @@ #include +#include #include #include @@ -29,14 +30,20 @@ #include #include +#include "datasrc_util.h" + #include #include #include +#include + +using namespace std; using namespace isc::dns; using namespace isc::data; using namespace isc::datasrc; using namespace isc::asiodns; +using namespace isc::auth::unittest; using namespace isc::testutils; namespace { @@ -201,17 +208,44 @@ TEST_F(MemoryDatasrcConfigTest, addOneZone) { RRType::A())->code); } -TEST_F(MemoryDatasrcConfigTest, addOneWithFiletype) { - // Until #1792 is completed, only "text" filetype is allowed. +// This test uses dynamic load of a data source module, and won't work when +// statically linked. +TEST_F(MemoryDatasrcConfigTest, +#ifdef USE_STATIC_LINK + DISABLED_addOneWithFiletypeSQLite3 +#else + addOneWithFiletypeSQLite3 +#endif + ) +{ + const string test_db = TEST_DATA_BUILDDIR "/auth_test.sqlite3.copied"; + stringstream ss("example.org. 3600 IN SOA . . 0 0 0 0 0\n"); + createSQLite3DB(rrclass, Name("example.org"), test_db.c_str(), ss); + + // In-memory with an SQLite3 data source as the backend. + parser->build(Element::fromJSON( + "[{\"type\": \"memory\"," + " \"zones\": [{\"origin\": \"example.org\"," + " \"file\": \"" + + test_db + "\"," + " \"filetype\": \"sqlite3\"}]}]")); + parser->commit(); + EXPECT_EQ(1, server.getInMemoryClient(rrclass)->getZoneCount()); + + // Failure case: the specified zone doesn't exist in the DB file. + delete parser; + parser = createAuthConfigParser(server, "datasources"); EXPECT_THROW(parser->build( Element::fromJSON( "[{\"type\": \"memory\"," " \"zones\": [{\"origin\": \"example.com\"," " \"file\": \"" - TEST_DATA_DIR "/example.zone\"," + + test_db + "\"," " \"filetype\": \"sqlite3\"}]}]")), - AuthConfigError); + DataSourceError); +} +TEST_F(MemoryDatasrcConfigTest, addOneWithFiletypeText) { // Explicitly specifying "text" is okay. parser->build(Element::fromJSON( "[{\"type\": \"memory\"," From 9ad569a0f568d9faf5f213f1403dce51cbcf08b8 Mon Sep 17 00:00:00 2001 From: JINMEI Tatuya Date: Mon, 9 Apr 2012 17:04:36 -0700 Subject: [PATCH 6/6] [1792] added a simple lettuce for the "inmemory w/ SQLite3 backend" scenario. right now it does a simple check for loading and query response from the loaded zone. this is intended to be used for the inmemory-from-xfrin scenarios. --- .../inmemory_over_sqlite3/secondary.conf | 24 +++++++++++++++++++ .../features/inmemory_over_sqlite3.feature | 9 +++++++ 2 files changed, 33 insertions(+) create mode 100644 tests/lettuce/configurations/inmemory_over_sqlite3/secondary.conf create mode 100644 tests/lettuce/features/inmemory_over_sqlite3.feature diff --git a/tests/lettuce/configurations/inmemory_over_sqlite3/secondary.conf b/tests/lettuce/configurations/inmemory_over_sqlite3/secondary.conf new file mode 100644 index 0000000000..a9f6e9985d --- /dev/null +++ b/tests/lettuce/configurations/inmemory_over_sqlite3/secondary.conf @@ -0,0 +1,24 @@ +{ + "version": 2, + "Logging": { + "loggers": [ { + "debuglevel": 99, + "severity": "DEBUG", + "name": "auth" + } ] + }, + "Auth": { + "datasources": [ { + "type": "memory", + "zones": [ { + "origin": "example.org", + "file": "data/example.org.sqlite3", + "filetype": "sqlite3" + } ] + } ], + "listen_on": [ { + "port": 47806, + "address": "127.0.0.1" + } ] + } +} diff --git a/tests/lettuce/features/inmemory_over_sqlite3.feature b/tests/lettuce/features/inmemory_over_sqlite3.feature new file mode 100644 index 0000000000..60945c87fb --- /dev/null +++ b/tests/lettuce/features/inmemory_over_sqlite3.feature @@ -0,0 +1,9 @@ +Feature: In-memory zone using SQLite3 backend + This feature tests the authoritative server configured with an in-memory + data source that uses the SQLite3 data source as the backend, and tests + scenarios that update the zone via incoming zone transfers. + + Scenario: Load and response + Given I have bind10 running with configuration inmemory_over_sqlite3/secondary.conf + A query for www.example.org should have rcode NOERROR + The SOA serial for example.org should be 1234