Opened 10 years ago

Closed 10 years ago

#143 closed defect (fixed)

auth test: what(): Cannot open Sqlite3 database file: testdata/test.sqlite3

Reported by: jreed Owned by: jreed
Priority: medium Milestone:
Component: Unclassified Version:
Keywords: Cc:
CVSS Scoring: Parent Tickets:
Sensitive: no Defect Severity:
Sub-Project: Feature Depending on Ticket:
Estimated Difficulty: Add Hours to Ticket:
Total Hours: Internal?:

Description

Using "make distcheck" fails for me with:

[ RUN      ] StaticDataSourceTest.findRRsetNoType
[       OK ] StaticDataSourceTest.findRRsetNoType (0 ms)
[ RUN      ] StaticDataSourceTest.notImplemented
[       OK ] StaticDataSourceTest.notImplemented (0 ms)
[----------] 24 tests from StaticDataSourceTest (4 ms total)

[----------] 43 tests from Sqlite3DataSourceTest
[ RUN      ] Sqlite3DataSourceTest.close
terminate called after throwing an instance of 'isc::auth::Sqlite3Error'
  what():  Cannot open Sqlite3 database file: testdata/test.sqlite3
[1]   Abort trap (core dumped) ${dir}${tst}
FAIL: run_unittests
====================================
1 of 1 test failed
Please report to bind10-bugs@isc.org
====================================
*** Error code 1

Stop.
make: stopped in /home/reed/work/isc/bind10/svn/trunk/bind10-devel-20100318/_build/src/lib/auth/tests

I don't understand why this is "close" but the error message is from Sqlite3DataSrc::open.

If the problem is it can't find the file, it is in the ${srcdir}/src/lib/auth/tests/testdata/.

If it is a problem with writing to the datafile, then it needs to be copied under the ${builddir} and edited there.

Also I didn't check yet (stopped at this problem) but I think more (new) testdata files need to be listed at EXTRA_DIST in /src/lib/auth/tests/Makefile.am

Subtickets

Change History (8)

comment:1 in reply to: ↑ description Changed 10 years ago by jinmei

  • Owner set to jreed
  • Status changed from new to assigned

Should be fixed in r1713.

(note: I didn't modify EXTRA_DISTs).

comment:2 follow-up: Changed 10 years ago by jreed

I added the extra file to EXTRA_DIST and then realized it was not in the src in the first place. (My tests worked because I was using unclean source.)

Does this look okay? (I tested it.)

Index: src/lib/auth/tests/sqlite3_unittest.cc
===================================================================
--- src/lib/auth/tests/sqlite3_unittest.cc	(revision 1713)
+++ src/lib/auth/tests/sqlite3_unittest.cc	(working copy)
@@ -45,8 +45,9 @@
 namespace {
 ElementPtr SQLITE_DBFILE_EXAMPLE = Element::createFromString(
     "{ \"database_file\": \"" TEST_DATA_DIR "/test.sqlite3\"}");
+// SQLITE_DBFILE_EXAMPLE2 is created, so is not in TEST_DATA_DIR
 ElementPtr SQLITE_DBFILE_EXAMPLE2 = Element::createFromString(
-    "{ \"database_file\": \"" TEST_DATA_DIR "/test2.sqlite3\"}");
+    "{ \"database_file\": \"test2.sqlite3\"}");
 ElementPtr SQLITE_DBFILE_EXAMPLE_ROOT = Element::createFromString(
     "{ \"database_file\": \"" TEST_DATA_DIR "/test-root.sqlite3\"}");
 ElementPtr SQLITE_DBFILE_BROKENDB = Element::createFromString(
Index: src/lib/auth/tests/Makefile.am
===================================================================
--- src/lib/auth/tests/Makefile.am	(revision 1714)
+++ src/lib/auth/tests/Makefile.am	(working copy)
@@ -2,7 +2,7 @@
 AM_CPPFLAGS += -I$(top_builddir)/src/lib/dns -I$(top_srcdir)/src/lib/dns
 AM_CPPFLAGS += -DTEST_DATA_DIR=\"$(srcdir)/testdata\"
 
-CLEANFILES = *.gcno *.gcda
+CLEANFILES = *.gcno *.gcda test2.sqlite3
 
 TESTS =
 if HAVE_GTEST
@@ -59,4 +59,3 @@
 EXTRA_DIST += testdata/sql2.example.com.signed
 EXTRA_DIST += testdata/test-root.sqlite3
 EXTRA_DIST += testdata/test.sqlite3
-EXTRA_DIST += testdata/test2.sqlite3

Note I do not use "testdata/" like it was before because that testdata/ directory does not exist in the builddir.

comment:3 in reply to: ↑ 2 ; follow-up: Changed 10 years ago by jinmei

Replying to jreed:

I added the extra file to EXTRA_DIST and then realized it was not in the src in the first place. (My tests worked because I was using unclean source.)

Does this look okay? (I tested it.)

Hmm...I suspect the original intent (I believe it was me who I added this test) was to use a pre-generated DB file containing non-matching zones. The comment for the test case also suggests so:

    // Replace the data with a totally different zone.  This should succeed,
    // and shouldn't match any names in the previously managed domains.

Maybe I simply forgot to do 'svn add'.

comment:4 in reply to: ↑ 3 ; follow-up: Changed 10 years ago by jinmei

Replying to jinmei:

Maybe I simply forgot to do 'svn add'.

According to the commit log message at that time, I think the intent was to use testdata/example2.com.sqlite3 (see https://bind10.isc.org/changeset/1167).

comment:5 in reply to: ↑ 4 Changed 10 years ago by jinmei

Replying to jinmei:

Replying to jinmei:

Maybe I simply forgot to do 'svn add'.

According to the commit log message at that time, I think the intent was to use testdata/example2.com.sqlite3 (see https://bind10.isc.org/changeset/1167).

See r1721.

(I've created a short-lived branch "trac143" and made this change there as an attempt to address the recent concern about review/trunk/branches, etc)

comment:6 Changed 10 years ago by jreed

Okay 1721 works for me. And I need to undo my change that added the EXTRA_DIST file. I can commit this.

(At first I thought it wouldn't work since this was done with read-only files.)

comment:7 follow-up: Changed 10 years ago by jreed

I merged the minor change to trunk.
Okay to remove this trac143 now and close this ticket?

comment:8 in reply to: ↑ 7 Changed 10 years ago by jinmei

  • Resolution set to fixed
  • Status changed from assigned to closed

Replying to jreed:

I merged the minor change to trunk.
Okay to remove this trac143 now and close this ticket?

Yes, please. (I'm going to close the ticket as a side effect of this comment)

Note: See TracTickets for help on using tickets.