bugGNU Octave - Bugs: bug #55565, test: help.cc BIST test fails in...


bug #55565: test: help.cc BIST test fails in test suite if test directory is not writeable

Submitted by:  Mike Miller <mtmiller>
Submitted on:  Thu 24 Jan 2019 11:07:45 PM UTC  
Category:  Test Suite Severity:  2 - Minor
Priority:  5 - Normal Item Group:  Unexpected Error or Warning
Status:  Fixed Assigned to:  None
Originator Name:  Open/Closed:  Closed
Release:  5.0.90 Operating System:  GNU/Linux

Add a New Comment (Rich Markup)

You are not logged in

Please log in, so followups can be emailed to you.


( Jump to the original submission)

Tue 05 Feb 2019 04:41:39 AM UTC, comment #7: 

This might be a documentation issue.  The Matlab documentation says that tempname creates a name in the "system’s temporary folder".  Whether that means the one pointed to by an environment variable, or the default system temporary dir, is open to verification.  But, its a small point.  A user needs at least some storage available at both locations.

Rik <rik5>
Project Administrator
Tue 05 Feb 2019 02:20:18 AM UTC, comment #6: 

No, tempdir and tempname already do the right thing. It's only when you explicitly call out to P_tmpdir that it goes to the system temporary directory.

The doc string for tempname looks wrong to me, but the behavior is correct.

Here's my environment

>> P_tmpdir
ans = /tmp
>> tempdir
ans = /run/user/1000/tmpdir/
>> tempname
ans = /run/user/1000/tmpdir/oct-mxxvU3

Mike Miller <mtmiller>
Project Administrator
Tue 05 Feb 2019 01:52:55 AM UTC, comment #5: 

I don't think it's a big deal.  If you don't have any space left on your system's TMPDIR then you have some bigger problems than just running Octave tests.

Also, if this is really a concern then we should re-code all calls to tempname() with tempname (tempdir ()).  With grep, that is 84 instances in the scripts/ directory and 43 in the libinterp/ directory.

Rik <rik5>
Project Administrator
Tue 05 Feb 2019 12:37:03 AM UTC, comment #4: 

I made a further refinement on your change after testing on my system:


Just a reminder that P_tmpdir and tempdir are not necessarily the same, and that tempdir is always preferred since it gives the user control over where temporary files are made. So with that, this works for me and solves the original problem, closing as fixed. I see no need to graft these fixes onto stable.

Mike Miller <mtmiller>
Project Administrator
Mon 04 Feb 2019 09:50:00 PM UTC, comment #3: 

@Mike: I checked in a changeset that fixes the two issues you identified with attempting to create a file in a potentially unwriteable current directory (".").  See https://hg.savannah.gnu.org/hgweb/octave/rev/33f79d94f21f.

If there are any others you know of let me know, they are easy to clean up.  I checked the change in on the development branch, but it could also be grafted on to the stable branch if you like.

Marking as Ready for Test.

Rik <rik5>
Project Administrator
Thu 24 Jan 2019 11:33:07 PM UTC, comment #2: 

Agreed.  Just running _run_test_suite_ myself with the RC1 candidate.

Rik <rik5>
Project Administrator
Thu 24 Jan 2019 11:10:50 PM UTC, comment #1: 

The same type of failure occurs for variables.cc for the same reason, it tries to write a file in the current directory to test the 'exist' function.

Mike Miller <mtmiller>
Project Administrator
Thu 24 Jan 2019 11:07:45 PM UTC, original submission:  

Running the full test suite with '__run_test_suite__' uses chdir to change to the directory that contains each test file.

The BIST test for help.cc requires that the current working directory is writeable.

If Octave is installed first, let's say as root, and then the test suite is run by a non-root user, the test will fail because the directory is not writeable.

It should be possible to rewrite this test to write the function file to a temporary directory, temporarily add that directory to the load path, and remove it from the path in the unwind cleanup. Will take a look at that.

>> test ("/app/share/octave/5.0.90/etc/tests/libinterp/corefcn/help.cc-tst")
PASSES 1 out of 1 test
>> __run_test_suite__ ({"/app/share/octave/5.0.90/etc/tests/libinterp/corefcn"}, {})

Integrated test scripts:

  libinterp/corefcn/help.cc-tst .................................. PASS    0/1
                                                                   FAIL    1

Mike Miller <mtmiller>
Project Administrator


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by rik5 (Posted a comment)

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.




    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2019-02-18 mtmiller Carbon-CopyRemoved 80942 => -
    2019-02-05 mtmiller StatusReady For Test => Fixed
        Open/ClosedOpen => Closed
    2019-02-04 rik5 StatusConfirmed => Ready For Test
    2019-01-24 rik5 StatusNone => Confirmed

    Back to the top

    Powered by Savane 3.5