blob: e44a746c198af247afdb957f29a46b21695f0199 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
import sys
from avahitest import check_ipv6_enabled
from saluttest import exec_test
from file_transfer_helper import SendFileTest
import constants as cs
if not check_ipv6_enabled():
print "Skipped test as IPv6 doesn't seem to be available"
# exiting 77 causes automake to consider the test to have been skipped
raise SystemExit(77)
if sys.version_info < (2, 7, 1):
print "FIXME: disabled because of a bug in Python's httplib. http://bugs.python.org/issue5111"
raise SystemExit(77)
class SendFileTransferIPv6(SendFileTest):
def __init__(self):
SendFileTest.__init__(self, cs.SOCKET_ADDRESS_TYPE_IPV6)
def provide_file(self):
SendFileTest.provide_file(self)
state = self.ft_props.Get(cs.CHANNEL_TYPE_FILE_TRANSFER, 'State')
assert state == cs.FT_STATE_PENDING
def client_request_file(self):
SendFileTest.client_request_file(self)
e = self.q.expect('dbus-signal', signal='InitialOffsetDefined')
offset = e.args[0]
# We don't support resume
assert offset == 0
# Channel is open. We can start to send the file
e = self.q.expect('dbus-signal', signal='FileTransferStateChanged')
state, reason = e.args
assert state == cs.FT_STATE_OPEN
assert reason == cs.FT_STATE_CHANGE_REASON_NONE
if __name__ == '__main__':
test = SendFileTransferIPv6()
exec_test(test.test)
|