Please note that the CVS and issue trackers have moved to GitHub. These Trac pages are no longer kept up-to-date.

root/seattle/branches/nacl_repy/seattlelib/tests/ut_lind_fs_multiple_open.py

Revision 5140, 0.8 KB (checked in by justinc, 6 years ago)

removed circular imports and created a new Python testing mechanism called
lind_test_server. This removes the need for wrappers, etc.

Line 
1import lind_test_server
2
3
4from lind_fs_constants import *
5
6# Try read / write of a file and see if it works...
7lind_test_server._blank_fs_init()
8myfd = lind_test_server.open_syscall('/foo',O_CREAT | O_EXCL | O_RDWR,S_IRWXA)
9
10myfd2 = lind_test_server.open_syscall('/foo',O_RDWR,S_IRWXA)
11
12assert(myfd!= myfd2)
13
14flags = O_TRUNC | O_CREAT | O_RDWR
15mode = 438   # 0666
16name = 'double_open_file'
17
18#print "CM: failing double open here:"
19myfd3 = lind_test_server.open_syscall(name, flags, mode)
20assert(lind_test_server.write_syscall(myfd3,'hi')==2)
21
22myfd4 = lind_test_server.open_syscall(name, flags, mode)
23
24# should still work
25assert(lind_test_server.write_syscall(myfd3,'boo')==3)
26
27# reading data should get \0\0boo
28assert(lind_test_server.read_syscall(myfd4,10)=='\0\0boo')
Note: See TracBrowser for help on using the browser.