From: drh Date: Sat, 15 Mar 2008 14:53:04 +0000 (+0000) Subject: Skip tests that require setting detailed unix permissions on files when X-Git-Tag: version-3.6.10~1311 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=17fe6c1d327d3ed7836f6914987023100a33eed2;p=thirdparty%2Fsqlite.git Skip tests that require setting detailed unix permissions on files when running on filesystems such as AFP that do not support that capability. (CVS 4866) FossilOrigin-Name: 5589b9d395fb8267a124d56dd5d7987e57505e3d --- diff --git a/manifest b/manifest index 4ba4d60843..33cf8bd964 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Add\stests\sto\smake\ssure\sthe\sbusy\shandler\sresets.\s(CVS\s4865) -D 2008-03-15T02:09:22 +C Skip\stests\sthat\srequire\ssetting\sdetailed\sunix\spermissions\son\sfiles\swhen\nrunning\son\sfilesystems\ssuch\sas\sAFP\sthat\sdo\snot\ssupport\sthat\scapability.\s(CVS\s4866) +D 2008-03-15T14:53:05 F Makefile.arm-wince-mingw32ce-gcc ac5f7b2cef0cd850d6f755ba6ee4ab961b1fadf7 F Makefile.in 5be94fea84f1599672e5041de03b97990baca593 F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654 @@ -402,7 +402,7 @@ F test/misc3.test aea079f4c3d93e9962186f45c0ff0954310e6b11 F test/misc4.test 91e8ed25c092c2bb4e0bb01864631e2930f8d7de F test/misc5.test c1bc7b8cbc6694dccfc4c0b03c00c8f2dc55c46b F test/misc6.test 953cc693924d88e6117aeba16f46f0bf5abede91 -F test/misc7.test 3ec53989ddfa30f0ef68757dd04726c9896376c0 +F test/misc7.test 26e0d948a413bca61ed031159907a03d64647409 F test/misuse.test 30b3a458e5a70c31e74c291937b6c82204c59f33 F test/notnull.test 44d600f916b770def8b095a9962dbe3be5a70d82 F test/null.test a8b09b8ed87852742343b33441a9240022108993 @@ -623,7 +623,7 @@ F www/tclsqlite.tcl 8be95ee6dba05eabcd27a9d91331c803f2ce2130 F www/vdbe.tcl 87a31ace769f20d3627a64fa1fade7fed47b90d0 F www/version3.tcl 890248cf7b70e60c383b0e84d77d5132b3ead42b F www/whentouse.tcl fc46eae081251c3c181bd79c5faef8195d7991a5 -P 66777f048195e4242905c40f790ed7360af7028b -R d085a4d2bb229e9074372fcf51b9d75a +P 5e4df441815ed7d02e9ad8ee2e1c2f937ee675d7 +R 4fc01bc578742338cb6e67ff251ecd70 U drh -Z bac5113aa0aec201b601763ef92cbc42 +Z 787508c13d0cfaee6008fe2953e61687 diff --git a/manifest.uuid b/manifest.uuid index e9b0fc1a65..87ad5baee9 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -5e4df441815ed7d02e9ad8ee2e1c2f937ee675d7 \ No newline at end of file +5589b9d395fb8267a124d56dd5d7987e57505e3d \ No newline at end of file diff --git a/test/misc7.test b/test/misc7.test index c683116a0f..c9db96cf18 100644 --- a/test/misc7.test +++ b/test/misc7.test @@ -10,7 +10,7 @@ #*********************************************************************** # This file implements regression tests for SQLite library. # -# $Id: misc7.test,v 1.18 2008/01/23 12:52:41 drh Exp $ +# $Id: misc7.test,v 1.19 2008/03/15 14:53:05 drh Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl @@ -363,60 +363,69 @@ set sqlite_pager_n_sort_bucket 0 # windows file system. # if {$tcl_platform(platform)!="windows"} { -do_test misc7-17.1 { - execsql { - BEGIN; - DELETE FROM t3 WHERE (oid%3)==0; - } - copy_file test.db bak.db - copy_file test.db-journal bak.db-journal - execsql { - COMMIT; - } - db close - copy_file bak.db test.db - copy_file bak.db-journal test.db-journal - sqlite3 db test.db - - catch {file attributes test.db-journal -permissions r--------} - catch {file attributes test.db-journal -readonly 1} - catchsql { - SELECT count(*) FROM t3; - } -} {1 {database is locked}} -do_test misc7-17.2 { - # Note that the -readonly flag must be cleared before the -permissions - # are set. Otherwise, when using tcl 8.5 on mac, the fact that the - # -readonly flag is set causes the attempt to set the permissions - # to fail. - catch {file attributes test.db-journal -readonly 0} - catch {file attributes test.db-journal -permissions rw-------} - catchsql { - SELECT count(*) FROM t3; - } -} {0 32} - -set ::pending_byte_page [expr ($::sqlite_pending_byte / 1024) + 1] -do_test misc7-17.3 { - db eval { - pragma writable_schema = true; - UPDATE sqlite_master - SET rootpage = $pending_byte_page - WHERE type = 'table' AND name = 't3'; - } - execsql { - SELECT rootpage FROM sqlite_master WHERE type = 'table' AND name = 't3'; + # Some network filesystems (ex: AFP) do not support setting read-only + # permissions. Only run these tests if full unix permission setting + # capabilities are supported. + # + file attributes test.db -permissions rw-r--r-- + if {[file attributes test.db -permissions]==0644} { + + do_test misc7-17.1 { + execsql { + BEGIN; + DELETE FROM t3 WHERE (oid%3)==0; + } + copy_file test.db bak.db + copy_file test.db-journal bak.db-journal + execsql { + COMMIT; + } + + db close + copy_file bak.db test.db + copy_file bak.db-journal test.db-journal + sqlite3 db test.db + + catch {file attributes test.db-journal -permissions r--------} + catch {file attributes test.db-journal -readonly 1} + catchsql { + SELECT count(*) FROM t3; + } + } {1 {database is locked}} + do_test misc7-17.2 { + # Note that the -readonly flag must be cleared before the -permissions + # are set. Otherwise, when using tcl 8.5 on mac, the fact that the + # -readonly flag is set causes the attempt to set the permissions + # to fail. + catch {file attributes test.db-journal -readonly 0} + catch {file attributes test.db-journal -permissions rw-------} + catchsql { + SELECT count(*) FROM t3; + } + } {0 32} + + set ::pending_byte_page [expr ($::sqlite_pending_byte / 1024) + 1] + do_test misc7-17.3 { + db eval { + pragma writable_schema = true; + UPDATE sqlite_master + SET rootpage = $pending_byte_page + WHERE type = 'table' AND name = 't3'; + } + execsql { + SELECT rootpage FROM sqlite_master WHERE type = 'table' AND name = 't3'; + } + } $::pending_byte_page + + do_test misc7-17.4 { + db close + sqlite3 db test.db + catchsql { + SELECT count(*) FROM t3; + } + } {1 {database disk image is malformed}} } -} $::pending_byte_page - -do_test misc7-17.4 { - db close - sqlite3 db test.db - catchsql { - SELECT count(*) FROM t3; - } -} {1 {database disk image is malformed}} } # Ticket #2470