All pastes #244441 Raw Edit

Unnamed

public text v1 · immutable
#244441 ·published 2006-11-09 20:31 UTC
rendered paste body
#!/usr/bin/python

#test cases for catbox remode

import catbox.catbox as catbox
import os

def logger(text):
    print text


def run_tests():
    ret = catbox.run(lambda: os.chown('hello.txt', 0, 0), [os.getcwd()], logger)

    print ret.ownerships
    if ret.ownerships['hello.txt'] != (0,0): 
        print "Chown not trapped"
    if os.stat('hello.txt').st_uid == 0: 
        print "Chown not trapped"

run_tests()