Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#2557 new fileSystem.test failures

obsolete: 8.5a0
closed-fixed
Vince Darley
5
2003-12-17
2003-12-12
Don Porter
No

Do you `make test` before you commit
these changes? Or is this a cross-platform
issue?

On Solaris 9:

==== filesystem-1.7 link normalisation FAILED
==== Contents of test case:

testPathEqual [file normalize [file join dir.link
linkinside.file foo]] [file normalize [file join
dir.file inside.file foo]]

---- Result was:
not equal:
/local/src/tcl/solaris/dir.file/linkinside.file/foo
/local/src/tcl/solaris/dir.file/inside.file/foo
---- Result should have been (exact matching):
1
==== filesystem-1.7 FAILED

==== filesystem-1.9 link normalisation FAILED
==== Contents of test case:

file delete -force dir.link
file link dir.link [file nativename dir.file]
testPathEqual [file normalize [file join dir.file
linkinside.file foo]] [file normalize [file join
dir.link inside.file foo]]

---- Result was:
not equal:
/local/src/tcl/solaris/dir.file/linkinside.file/foo
/local/src/tcl/solaris/dir.file/inside.file/foo
---- Result should have been (exact matching):
1
==== filesystem-1.9 FAILED

==== filesystem-1.10 link normalisation: double link FAILED
==== Contents of test case:

file link dir2.link dir.link
testPathEqual [file normalize [file join dir.file
linkinside.file foo]] [file normalize [file join
dir2.link inside.file foo]]

---- Result was:
not equal:
/local/src/tcl/solaris/dir.file/linkinside.file/foo
/local/src/tcl/solaris/dir.file/inside.file/foo
---- Result should have been (exact matching):
1
==== filesystem-1.10 FAILED

==== filesystem-1.11 link normalisation: double link,
back in tree FAILED
==== Contents of test case:

file link [file join dir2.file dir2.link] dir2.link
testPathEqual [file normalize [file join dir.file
linkinside.file foo]] [file normalize [file join
dir2.file dir2.link inside.file foo]]

---- Result was:
not equal:
/local/src/tcl/solaris/dir.file/linkinside.file/foo
/local/src/tcl/solaris/dir2.file/dir2.link/inside.file/foo
---- Result should have been (exact matching):
1
==== filesystem-1.11 FAILED

==== filesystem-1.26 link normalisation: link and .. FAILED
==== Contents of test case:

file delete -force dir2.link
set dir [file join dir2 foo bar]
file mkdir $dir
file link dir2.link [file join dir2 foo bar]
set res [list [file normalize [file join dir2 foo
x]] [file normalize [file join dir2.link .. x]]]
if {![string equal [lindex $res 0] [lindex $res 1]]} {
set res "$res not equal"
} else {
set res "ok"
}

---- Result was:
/local/src/tcl/solaris/dir2/foo/x
/local/src/tcl/solaris/x not equal
---- Result should have been (exact matching):
ok
==== filesystem-1.26 FAILED

==== filesystem-1.28 link normalisation: link with ..
and .. FAILED
==== Contents of test case:

file delete -force dir2.link
set dir [file join dir2 foo bar]
file mkdir $dir
set to [file join dir2 .. dir2 foo .. foo bar]
file link dir2.link $to
set res [list [file normalize [file join dir2 foo
x]] [file normalize [file join dir2.link .. x]]]
if {![string equal [lindex $res 0] [lindex $res 1]]} {
set res "$res not equal"
} else {
set res "ok"
}

---- Result was:
/local/src/tcl/solaris/dir2/foo/x
/local/src/tcl/solaris/x not equal
---- Result should have been (exact matching):
ok
==== filesystem-1.28 FAILED

Discussion

1 2 > >> (Page 1 of 2)
  • Vince Darley
    Vince Darley
    2003-12-14

    Logged In: YES
    user_id=32170

    Most of those tests are 'macOrUnix', so don't run on my
    default platform (Windows, where file-symlinks don't exist).

    I always run 'make test' on Windows, and when sf's veyr
    flaky compilefarm authorization works, on there too.

    Anyway, these new test failures are probably a consequence
    of newly allowing Tcl to create relative links (previously
    they were all converted to absolute paths).

    An update to tclPathObj has been checked it, which will
    probably fix some of these.

    It would also be helpful to know if your platform has
    'realpath()' or not.

     
  • Don Porter
    Don Porter
    2003-12-15

    Logged In: YES
    user_id=80530

    sorry to be grumpy. The good news
    is that there were tests at all.

    Yes, some of those failures are fixed now.

    Still failing today are tests fileSystem-1.{7,9,10,11}

    judging solely by the installed documentation,
    it appears that on both platforms where I see
    these tests fail, there is a realpath() system call,
    apparently provided by <stdlib.h>

     
  • Vince Darley
    Vince Darley
    2003-12-17

    Logged In: YES
    user_id=32170

    Hmm, can you look at what the links are that are created
    with this:

    if {[catch {
    file link link.file gorp.file
    file link \ [file join dir.dir linkinside.file] \ [file join dir.dir inside.file]
    file link dir.link dir.dir
    file link [file join dir.dir dirinside.link] \ [file join dir.dir dirinside.dir]
    }]} {
    tcltest::testConstraint hasLinks 0
    } else {
    tcltest::testConstraint hasLinks 1
    }

    In particular the 'linkinside.file' link is the one causing
    the problems here, and those problems are almost certainly
    caused by the tclUnixFile.c changes to support creation of
    relative links. The problem here is that I'm not sure how to
    define the link that is created. We're doing:

    file link dir.dir/linkinside.file dir.dir/inside.file

    i.e. ln -s dir.dir/inside.file dir.dir/linkinside.file

    But Tcl will now, I think, try to create a link
    'linkinside.file' pointing to 'dir.dir/inside.file' which
    isn't really correct, since the cwd is different for the two
    cases.

    Any ideas how this is defined consistently for 'ln'? We
    should have Tcl's file-link do the same....

     
  • Vince Darley
    Vince Darley
    2003-12-17

    Logged In: YES
    user_id=32170

    Ok, a bit of experimentation on a unix system shows that
    'file link' should really throw an error in this case (it
    doesn't allow you to create links to non-existent things).

    Will have to fix tclUnixFile.c and the test suite.

     
  • Vince Darley
    Vince Darley
    2003-12-17

    Logged In: YES
    user_id=32170

    Please test the attached patch.

     
  • Don Porter
    Don Porter
    2003-12-17

    Logged In: YES
    user_id=80530

    After applying that patch,
    the test results are different.
    Now these four tests fail
    (on both Solaris 9 and Linux/Alpha):

    ==== fCmd-26.2 TclDeleteFilesCmd: delete dir with symlink FAILED
    ==== Contents of test case:

    catch {file delete -force -- tfad1 tfad2}

    file mkdir tfad1
    file mkdir tfad2
    file link -symbolic [file join tfad2 link] tfad1
    file delete -force tfad2

    set r1 [file isdir tfad1]
    set r2 [file exists tfad2]

    set result [expr $r1 && !$r2]
    file delete tfad1
    set result

    ---- Test generated error; Return code was: 1
    ---- Return code should have been one of: 0 2
    ---- errorInfo: could not create new link "tfad2/link":
    target "tfad1" doesn't exist
    while executing
    "file link -symbolic [file join tfad2 link] tfad1"
    ("uplevel" body line 6)
    invoked from within
    "uplevel 1 $script"
    ---- errorCode: NONE
    ==== fCmd-26.2 FAILED

    ==== fCmd-28.20 file link: relative paths FAILED
    ==== Contents of test case:

    cd [temporaryDirectory]
    file mkdir d1/d2/d3
    list [catch {file link d1/l2 d1/d2} res] $res

    ---- Result was:
    1 {could not create new link "d1/l2": target "d1/d2" doesn't
    exist}
    ---- Result should have been (exact matching):
    1 d1/d2
    ==== fCmd-28.20 FAILED

    ==== fCmd-28.22 file link: relative paths FAILED
    ==== Contents of test case:

    cd [temporaryDirectory]
    file mkdir d1/d2/d3
    list [catch {file link d1/l2 d2/d3} res] $res

    ---- Result was:
    1 {could not create new link "d1/l2": that path already exists}
    ---- Result should have been (exact matching):
    0 d2/d3
    ==== fCmd-28.22 FAILED

    ==== filesystem-1.11 link normalisation: double link, back
    in tree FAILED
    ==== Contents of test case:

    file link [file join dir2.file dir2.link] dir2.link
    testPathEqual [file normalize [file join dir.dir
    linkinside.file foo]] [file normalize [file join dir2.file
    dir2.link inside.file foo]]

    ---- Test generated error; Return code was: 1
    ---- Return code should have been one of: 0 2
    ---- errorInfo: could not create new link
    "dir2.file/dir2.link": target "dir2.link" doesn't exist
    while executing
    "file link [file join dir2.file dir2.link] dir2.link"
    ("uplevel" body line 2)
    invoked from within
    "uplevel 1 $script"
    ---- errorCode: NONE
    ==== filesystem-1.11 FAILED

     
  • Vince Darley
    Vince Darley
    2003-12-17

    diff -u with windows eols

     
    Attachments
  • Vince Darley
    Vince Darley
    2003-12-17

    Logged In: YES
    user_id=32170

    Thanks -- please try the attached new patch. It should be
    very close now.

     
  • Don Porter
    Don Porter
    2003-12-17

    Logged In: YES
    user_id=80530

    After applying that patch, test
    fCmd-28.20 needs another
    close-brace at the end for proper
    syntax.

    After making that typo correction,
    all tests pass. Success!

     
  • Vince Darley
    Vince Darley
    2003-12-17

    • status: open --> closed-fixed
     
1 2 > >> (Page 1 of 2)