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_net_socket.py

Revision 5140, 0.6 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
4
5from lind_net_constants import *
6
7SyscallError = lind_test_server.SyscallError
8
9sockfd = lind_test_server.socket_syscall(AF_INET, SOCK_STREAM, 0)
10sockfd2 = lind_test_server.socket_syscall(AF_INET, SOCK_STREAM, IPPROTO_TCP)
11
12sockfd3 = lind_test_server.socket_syscall(AF_INET, SOCK_DGRAM, 0)
13sockfd4 = lind_test_server.socket_syscall(AF_INET, SOCK_DGRAM, IPPROTO_UDP)
14
15
16try:
17  # let's try to use an incorrect setting
18  lind_test_server.socket_syscall(AF_UNIX, SOCK_DGRAM, 0)
19
20except:
21  pass
22else:
23  print "Should be an error"
24
25sockfd = lind_test_server.socket_syscall(AF_INET, SOCK_STREAM, 0)
26
27lind_test_server.close_syscall(sockfd)
Note: See TracBrowser for help on using the browser.