Changeset 118602 for trunk/base/tests


Ignore:
Timestamp:
Apr 5, 2014, 7:40:01 PM (6 years ago)
Author:
cal@…
Message:

base: fix tracemode test in non-root mode

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/base/tests/test/trace/test.tcl

    r118599 r118602  
    11package require tcltest 2
     2
     3# need pextlib to drop privs
     4package require Pextlib 1.0
     5
    26namespace import tcltest::*
    37
     
    2327    makeDirectory ../tracetesttmp
    2428    file attributes ../tracetesttmp -owner $user
    25     exec sudo -u $user touch  ../tracetesttmp/delete-trace
    26     exec sudo -u $user touch ../tracetesttmp/rename-trace
    27     exec sudo -u $user mkdir ../tracetesttmp/rmdir-trace
     29
    2830    file delete -force /tmp/hello-trace
     31    file delete -force /tmp/link-trace2
    2932    file link -symbolic /tmp/link-trace2 /usr/include/unistd.h
    30     exec chown -h $user /tmp/link-trace2
     33    if {[getuid] == 0} {
     34        exec chown -h $user /tmp/link-trace2
     35    }
     36
     37    if {[getuid] == 0} {
     38        seteuid [name_to_uid $user]
     39    }
     40    exec touch  ../tracetesttmp/delete-trace
     41    exec touch ../tracetesttmp/rename-trace
     42    exec mkdir ../tracetesttmp/rmdir-trace
     43    if {[getuid] == 0} {
     44        seteuid 0
     45    }
    3146
    3247    port_trace $path
    33    
    34     #file delete -force /tmp/link-trace2
     48
     49    file delete -force /tmp/link-trace2
    3550    file delete -force /tmp/hello-trace
    3651
Note: See TracChangeset for help on using the changeset viewer.