summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorvincentdarley <vincentdarley>2003-12-09 16:03:42 (GMT)
committervincentdarley <vincentdarley>2003-12-09 16:03:42 (GMT)
commitd08584b0873067dcc6cadc1ddd950f49cd06ba6e (patch)
tree235a55b7ca8af7e7e54ba9957eb245f36d645b0c
parent4e5360f74973e4d77b3a766a0ab4ac4e378421c4 (diff)
downloadtcl-d08584b0873067dcc6cadc1ddd950f49cd06ba6e.zip
tcl-d08584b0873067dcc6cadc1ddd950f49cd06ba6e.tar.gz
tcl-d08584b0873067dcc6cadc1ddd950f49cd06ba6e.tar.bz2
fixed tests and constraints and setup so works x-platform
-rw-r--r--tests/winFile.test73
1 files changed, 53 insertions, 20 deletions
diff --git a/tests/winFile.test b/tests/winFile.test
index d19e5d6..b4c78b8 100644
--- a/tests/winFile.test
+++ b/tests/winFile.test
@@ -10,12 +10,13 @@
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
-# RCS: @(#) $Id: winFile.test,v 1.11 2003/12/09 14:57:18 vincentdarley Exp $
+# RCS: @(#) $Id: winFile.test,v 1.12 2003/12/09 16:03:42 vincentdarley Exp $
-if {[lsearch [namespace children] ::tcltest] == -1} {
- package require tcltest
- namespace import -force ::tcltest::*
+if {[catch {package require tcltest 2.0.2}]} {
+ puts stderr "Skipping tests in [info script]. tcltest 2.0.2 required."
+ return
}
+namespace import -force ::tcltest::*
if {[info commands ::testvolumetype] == ""} {
tcltest::testConstraint notNTFS 0
@@ -150,48 +151,80 @@ proc test_access {fname read writ} {
}
# Create the test file
+# NOTE: [tcltest::makeFile] not used. Presumably to force file
+# creation in a particular filesystem? If not, try [makeFile]
+# in a -setup script.
set fname test.dat
file delete $fname
close [open $fname w]
-set owner [getuser $fname]
-set user $::env(USERDOMAIN)\\$::env(USERNAME)
-test winFile-4.0 {Enhanced NTFS user/group permissions: test no acccess} {notNTFS pcOnly nt} {
+test winFile-4.0 {
+ Enhanced NTFS user/group permissions: test no acccess
+} -constraints {
+ notNTFS pcOnly nt
+} -setup {
+ set owner [getuser $fname]
+ set user $::env(USERDOMAIN)\\$::env(USERNAME)
+} -body {
# Clean out all well-known ACLs
catch {cacls $fname /E /R "Everyone"} result
catch {cacls $fname /E /R $user} result
catch {cacls $fname /E /R $owner} result
cacls $fname /E /P $user:N
test_access $fname 0 0
-} {}
-
-test winFile-4.1 {Enhanced NTFS user/group permissions: test readable only} {notNTFS pcOnly nt} {
+} -result {}
+
+test winFile-4.1 {
+ Enhanced NTFS user/group permissions: test readable only
+} -constraints {
+ notNTFS pcOnly nt
+} -setup {
+ set user $::env(USERDOMAIN)\\$::env(USERNAME)
+} -body {
cacls $fname /E /P $user:N
cacls $fname /E /G $user:R
test_access $fname 1 0
-} {}
-
-test winFile-4.2 {Enhanced NTFS user/group permissions: test writable only} {notNTFS pcOnly nt} {
+} -result {}
+
+test winFile-4.2 {
+ Enhanced NTFS user/group permissions: test writable only
+} -constraints {
+ notNTFS pcOnly nt
+} -setup {
+ set user $::env(USERDOMAIN)\\$::env(USERNAME)
+} -body {
catch {cacls $fname /E /R $user} result
cacls $fname /E /P $user:N
cacls $fname /E /G $user:W
test_access $fname 0 1
-} {}
-
-test winFile-4.3 {Enhanced NTFS user/group permissions: test read+write} {notNTFS pcOnly nt} {
+} -result {}
+
+test winFile-4.3 {
+ Enhanced NTFS user/group permissions: test read+write
+} -constraints {
+ notNTFS pcOnly nt
+} -setup {
+ set user $::env(USERDOMAIN)\\$::env(USERNAME)
+} -body {
catch {cacls $fname /E /R $user} result
cacls $fname /E /P $user:N
cacls $fname /E /G $user:R
cacls $fname /E /G $user:W
test_access $fname 1 1
-} {}
-
-test winFile-4.4 {Enhanced NTFS user/group permissions: test full access} {notNTFS pcOnly nt} {
+} -result {}
+
+test winFile-4.4 {
+ Enhanced NTFS user/group permissions: test full access
+} -constraints {
+ notNTFS pcOnly nt
+} -setup {
+ set user $::env(USERDOMAIN)\\$::env(USERNAME)
+} -body {
catch {cacls $fname /E /R $user} result
cacls $fname /E /P $user:N
cacls $fname /E /G $user:F
test_access $fname 1 1
-} {}
+} -result {}
file delete $fname