Ticket #12021 (closed defect: fixed)

Opened 19 months ago

Last modified 6 months ago

Doctest failure in sage_object.pyx when test run as root

Reported by: emil Owned by: mvngu
Priority: minor Milestone: sage-5.6
Component: doctest coverage Keywords: doctest root
Cc: Work issues:
Report Upstream: N/A Reviewers: Volker Braun
Authors: Emil Widmann Merged in: sage-5.6.beta0
Dependencies: Stopgaps:

Description

sage -t -force_lib "devel/sage/sage/structure/sage_object.pyx"
*************************************************************

File "/mnt/sda6/COMPILE/sage-4.7.2/devel/sage/sage/structure/
sage_object.pyx", line 1042:
    sage: sage.structure.sage_object.picklejar(1, dir + '/noaccess')
Expected:
    Traceback (most recent call last):
    ...
    OSError: ...
Got nothing
*******************************************************************

the doctest creates a directory and sets permissions to 0000. if running as root no error is thrown when accessing this directory, hence the failure of the doctest.

Proposed fix: check if running the test as root or flag example as no test

[  http://groups.google.com/group/sage-devel/browse_thread/thread/e1886d5ba5ade945]

Attachments

trac120221_root.patch Download (930 bytes) - added by emil 19 months ago.
patch (see Volker Braun) to avoid error in sage_object.pyx

Change History

Changed 19 months ago by emil

patch (see Volker Braun) to avoid error in sage_object.pyx

comment:1 Changed 19 months ago by emil

  • Status changed from new to needs_review

I attached a patch which fixes the error when run as root. However there is no warning about running tests as root which was suggested on sage-devel.

Example: WARNING: You are running doctests as root! It is strongly advised to stop and run the tests as restricted user Are you sure you want to continue as root (y/n)?

There was another ticket mentioned (#5155), maybe it should be implemented there?

comment:2 Changed 11 months ago by jdemeyer

Please fill in your real name as Author.

comment:3 Changed 8 months ago by emil

Still get the same error in 5.3, so this is still a minor issue. I filled my real name in the comment of the patch. Where else should I fill it in?

comment:4 Changed 7 months ago by vbraun

  • Status changed from needs_review to positive_review

looks good to me

comment:5 Changed 7 months ago by vbraun

  • Keywords doctest added; doctest, sage_object, removed
  • Reviewers set to Volker Braun
  • Authors set to Emil Widmann

comment:6 Changed 6 months ago by jdemeyer

  • Status changed from positive_review to closed
  • Resolution set to fixed
  • Merged in set to sage-5.6.beta0
  • Summary changed from doctest failure insage_object.pyx when test run as root to Doctest failure in sage_object.pyx when test run as root
Note: See TracTickets for help on using tickets.