Last change
on this file was
23,
checked in by trishank, 7 years ago
|
Add pre-release upPIR from June 2011.
|
File size:
686 bytes
|
Line | |
---|
1 | # this is a few simple integration tests for an upPIR mirror. Uses any local |
---|
2 | # mirror |
---|
3 | |
---|
4 | # if everything passes, there is no output |
---|
5 | |
---|
6 | import socket |
---|
7 | |
---|
8 | import session |
---|
9 | |
---|
10 | import getmyip |
---|
11 | |
---|
12 | mirrortocheck = getmyip.getmyip() |
---|
13 | |
---|
14 | def get_response(requeststring): |
---|
15 | s = socket.socket() |
---|
16 | s.connect((mirrortocheck,62294)) |
---|
17 | session.sendmessage(s,requeststring) |
---|
18 | return session.recvmessage(s) |
---|
19 | |
---|
20 | |
---|
21 | # We don't know the size so we won't test it 'working'... |
---|
22 | |
---|
23 | # are you friendly? |
---|
24 | assert('HI!' == get_response('HELLO')) |
---|
25 | |
---|
26 | # too short of a string (len 0) |
---|
27 | assert('Invalid request length' == get_response('XORBLOCK')) |
---|
28 | |
---|
29 | # too short of a string (len 0) |
---|
30 | assert('Invalid request type' == get_response('ajskdfjsad')) |
---|
Note: See
TracBrowser
for help on using the repository browser.