summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/twisted/avahi/aliases.py8
-rw-r--r--tests/twisted/avahi/caps-file-transfer.py8
-rw-r--r--tests/twisted/avahi/caps-self.py2
-rw-r--r--tests/twisted/avahi/close-local-pending-room.py10
-rw-r--r--tests/twisted/avahi/file-transfer/file_transfer_helper.py10
-rw-r--r--tests/twisted/avahi/file-transfer/ft-client-caps.py14
-rw-r--r--tests/twisted/avahi/ichat-composing.py8
-rw-r--r--tests/twisted/avahi/ichat-incoming-msg.py10
-rw-r--r--tests/twisted/avahi/muc-invite.py11
-rw-r--r--tests/twisted/avahi/olpc-activity-announcements.py2
-rw-r--r--tests/twisted/avahi/request-im.py8
-rw-r--r--tests/twisted/avahi/request-muc.py6
-rw-r--r--tests/twisted/avahi/roomlist.py11
-rw-r--r--tests/twisted/avahi/set-presence.py4
-rw-r--r--tests/twisted/avahi/text-channel.py15
-rw-r--r--tests/twisted/avahi/tubes/request-muc-tubes.py6
-rw-r--r--tests/twisted/avahi/tubes/tubetestutil.py10
-rw-r--r--tests/twisted/avahi/tubes/two-muc-dbus-tubes.py4
-rw-r--r--tests/twisted/cm/protocol.py6
-rw-r--r--tests/twisted/constants.py95
-rw-r--r--tests/twisted/saluttest.py24
-rw-r--r--tests/twisted/servicetest.py8
-rw-r--r--tests/twisted/sidecars.py2
-rw-r--r--tests/twisted/tools/Makefile.am4
-rw-r--r--tests/twisted/tools/salut.service.in2
25 files changed, 119 insertions, 169 deletions
diff --git a/tests/twisted/avahi/aliases.py b/tests/twisted/avahi/aliases.py
index 41c82857..af18ab3a 100644
--- a/tests/twisted/avahi/aliases.py
+++ b/tests/twisted/avahi/aliases.py
@@ -13,8 +13,8 @@ import time
def wait_for_aliases_changed(q, handle):
e = q.expect('dbus-signal', signal='AliasesChanged',
- predicate=lambda e: e.args[0][0][0] == handle)
- _, alias = e.args[0][0]
+ predicate=lambda e: handle in e.args[0])
+ alias = e.args[0][handle]
return alias
def wait_for_contact_info_changed(q, handle):
@@ -57,7 +57,7 @@ def check_contact_info(info, txt):
def check_all_contact_info_methods(conn, handle, keys):
attrs = conn.Contacts.GetContactAttributes([handle],
- [cs.CONN_IFACE_CONTACT_INFO], True)[handle]
+ [cs.CONN_IFACE_CONTACT_INFO])[handle]
info = attrs[cs.CONN_IFACE_CONTACT_INFO + "/info"]
check_contact_info(info, keys)
@@ -127,7 +127,7 @@ def test(q, bus, conn):
check_contact_info(info, dict)
attrs = conn.Contacts.GetContactAttributes([handle],
- [cs.CONN_IFACE_ALIASING], True)[handle]
+ [cs.CONN_IFACE_ALIASING])[handle]
assertEquals(alias, attrs[cs.CONN_IFACE_ALIASING + "/alias"])
check_all_contact_info_methods(conn, handle, dict)
diff --git a/tests/twisted/avahi/caps-file-transfer.py b/tests/twisted/avahi/caps-file-transfer.py
index c239fdfd..13425c26 100644
--- a/tests/twisted/avahi/caps-file-transfer.py
+++ b/tests/twisted/avahi/caps-file-transfer.py
@@ -140,7 +140,7 @@ def test_ft_caps_from_contact(q, bus, conn, client):
# check the Contacts interface give the same caps
caps_via_contacts_iface = conn_contacts_iface.GetContactAttributes(
- [contact_handle], [cs.CONN_IFACE_CONTACT_CAPS], False) \
+ [contact_handle], [cs.CONN_IFACE_CONTACT_CAPS]) \
[contact_handle][cs.CONN_IFACE_CONTACT_CAPS + '/capabilities']
assert caps_via_contacts_iface == caps, caps_via_contacts_iface
@@ -194,7 +194,7 @@ def test_ft_caps_from_contact(q, bus, conn, client):
# check the Contacts interface give the same caps
caps_via_contacts_iface = conn_contacts_iface.GetContactAttributes(
- [contact_handle], [cs.CONN_IFACE_CONTACT_CAPS], False) \
+ [contact_handle], [cs.CONN_IFACE_CONTACT_CAPS]) \
[contact_handle][cs.CONN_IFACE_CONTACT_CAPS + '/capabilities']
assert caps_via_contacts_iface == caps, caps_via_contacts_iface
@@ -215,7 +215,7 @@ def test_ft_caps_from_contact(q, bus, conn, client):
# check the Contacts interface give the same caps
caps_via_contacts_iface = conn_contacts_iface.GetContactAttributes(
- [contact_handle], [cs.CONN_IFACE_CONTACT_CAPS], False) \
+ [contact_handle], [cs.CONN_IFACE_CONTACT_CAPS]) \
[contact_handle][cs.CONN_IFACE_CONTACT_CAPS + '/capabilities']
assert caps_via_contacts_iface == caps, caps_via_contacts_iface
@@ -231,7 +231,7 @@ def test(q, bus, conn):
self_handle = conn.Properties.Get(cs.CONN, "SelfHandle")
conn_contacts_iface = dbus.Interface(conn, cs.CONN_IFACE_CONTACTS)
caps = conn_contacts_iface.GetContactAttributes(
- [self_handle], [cs.CONN_IFACE_CONTACT_CAPS], False) \
+ [self_handle], [cs.CONN_IFACE_CONTACT_CAPS]) \
[self_handle][cs.CONN_IFACE_CONTACT_CAPS + '/capabilities']
assertContains(ft_metadata_caps, caps)
diff --git a/tests/twisted/avahi/caps-self.py b/tests/twisted/avahi/caps-self.py
index 4438d937..c176691b 100644
--- a/tests/twisted/avahi/caps-self.py
+++ b/tests/twisted/avahi/caps-self.py
@@ -1,6 +1,6 @@
"""
Basic test of SetSelfCapabilities on interface
-org.freedesktop.Telepathy.Connection.Interface.ContactCapabilities
+im.telepathy1.Connection.Interface.ContactCapabilities
"""
from saluttest import exec_test
diff --git a/tests/twisted/avahi/close-local-pending-room.py b/tests/twisted/avahi/close-local-pending-room.py
index 1e04fa37..5066fcfd 100644
--- a/tests/twisted/avahi/close-local-pending-room.py
+++ b/tests/twisted/avahi/close-local-pending-room.py
@@ -61,18 +61,18 @@ def test(q, bus, conn):
xmpp_connection.send(message)
# group channel is created
- e = q.expect('dbus-signal', signal='NewChannel',
+ e = q.expect('dbus-signal', signal='NewChannels',
predicate=lambda e:
- e.args[1] == cs.CHANNEL_TYPE_TEXT and
- e.args[2] == cs.HT_ROOM)
- path = e.args[0]
+ e.args[0][0][1][cs.CHANNEL_TYPE] == cs.CHANNEL_TYPE_TEXT and
+ e.args[0][0][1][cs.TARGET_HANDLE_TYPE] == cs.HT_ROOM)
+ path = e.args[0][0][0]
channel = make_channel_proxy(conn, path, 'Channel')
props_iface = dbus.Interface(bus.get_object(conn.object.bus_name, path),
dbus.PROPERTIES_IFACE)
q.expect('dbus-signal', signal='MembersChanged', path=path)
- lp_members = props_iface.Get('org.freedesktop.Telepathy.Channel.Interface.Group',
+ lp_members = props_iface.Get('im.telepathy1.Channel.Interface.Group1',
'LocalPendingMembers')
assert len(lp_members) == 1
diff --git a/tests/twisted/avahi/file-transfer/file_transfer_helper.py b/tests/twisted/avahi/file-transfer/file_transfer_helper.py
index cb10c6b8..edfb1989 100644
--- a/tests/twisted/avahi/file-transfer/file_transfer_helper.py
+++ b/tests/twisted/avahi/file-transfer/file_transfer_helper.py
@@ -133,7 +133,7 @@ class FileTransferTest(object):
def create_ft_channel(self):
self.channel = make_channel_proxy(self.conn, self.ft_path, 'Channel')
- self.ft_channel = make_channel_proxy(self.conn, self.ft_path, 'Channel.Type.FileTransfer')
+ self.ft_channel = make_channel_proxy(self.conn, self.ft_path, 'Channel.Type.FileTransfer1')
self.ft_props = dbus.Interface(self.bus.get_object(
self.conn.object.bus_name, self.ft_path), PROPERTIES_IFACE)
@@ -246,7 +246,7 @@ class ReceiveFileTest(FileTransferTest):
path, props = channels[0]
# check channel properties
- # org.freedesktop.Telepathy.Channel D-Bus properties
+ # im.telepathy1.Channel D-Bus properties
assert props[cs.CHANNEL_TYPE] == cs.CHANNEL_TYPE_FILE_TRANSFER
assert props[cs.INTERFACES] == []
assert props[cs.TARGET_HANDLE] == self.handle
@@ -256,7 +256,7 @@ class ReceiveFileTest(FileTransferTest):
assert props[cs.INITIATOR_HANDLE] == self.handle
assert props[cs.INITIATOR_ID] == self.contact_name
- # org.freedesktop.Telepathy.Channel.Type.FileTransfer D-Bus properties
+ # im.telepathy1.Channel.Type.FileTransfer D-Bus properties
assert props[cs.FT_STATE] == cs.FT_STATE_PENDING
assert props[cs.FT_CONTENT_TYPE] == self.file.content_type
assert props[cs.FT_FILENAME] == self.file.name
@@ -410,7 +410,7 @@ class SendFileTest(FileTransferTest):
self.ft_path, props = self.conn.Requests.CreateChannel(request)
- # org.freedesktop.Telepathy.Channel D-Bus properties
+ # im.telepathy1.Channel D-Bus properties
assert props[cs.CHANNEL_TYPE] == cs.CHANNEL_TYPE_FILE_TRANSFER
assert props[cs.INTERFACES] == []
assert props[cs.TARGET_HANDLE] == self.handle
@@ -420,7 +420,7 @@ class SendFileTest(FileTransferTest):
assert props[cs.INITIATOR_HANDLE] == self.self_handle
assert props[cs.INITIATOR_ID] == self.self_handle_name
- # org.freedesktop.Telepathy.Channel.Type.FileTransfer D-Bus properties
+ # im.telepathy1.Channel.Type.FileTransfer D-Bus properties
assert props[cs.FT_STATE] == cs.FT_STATE_PENDING
assert props[cs.FT_CONTENT_TYPE] == self.file.content_type
assert props[cs.FT_FILENAME] == self.file.name
diff --git a/tests/twisted/avahi/file-transfer/ft-client-caps.py b/tests/twisted/avahi/file-transfer/ft-client-caps.py
index 3cb6aca3..8d6bb8df 100644
--- a/tests/twisted/avahi/file-transfer/ft-client-caps.py
+++ b/tests/twisted/avahi/file-transfer/ft-client-caps.py
@@ -131,7 +131,7 @@ def receive_caps(q, bus, conn, service, contact, contact_handle, features,
# check the Contacts interface give the same caps
caps_via_contacts_iface = conn.Contacts.GetContactAttributes(
- [contact_handle], [cs.CONN_IFACE_CONTACT_CAPS], False) \
+ [contact_handle], [cs.CONN_IFACE_CONTACT_CAPS]) \
[contact_handle][cs.ATTR_CONTACT_CAPABILITIES]
assertSameElements(expected_caps, caps_via_contacts_iface)
@@ -151,7 +151,7 @@ def test_ft_caps_from_contact(q, bus, conn, service, contact):
# Check that we don't crash if we haven't seen any caps/presence for this
# contact yet.
caps = conn.Contacts.GetContactAttributes(
- [contact_handle], [cs.CONN_IFACE_CONTACT_CAPS], False) \
+ [contact_handle], [cs.CONN_IFACE_CONTACT_CAPS]) \
[contact_handle]
basic_caps = [(text_fixed_properties, text_allowed_properties)]
@@ -243,7 +243,7 @@ def advertise_caps(q, bus, conn, service, filters, expected_features, unexpected
# check the Contacts interface give the same caps
caps_via_contacts_iface = conn.Contacts.GetContactAttributes(
- [self_handle], [cs.CONN_IFACE_CONTACT_CAPS], False) \
+ [self_handle], [cs.CONN_IFACE_CONTACT_CAPS]) \
[self_handle][cs.ATTR_CONTACT_CAPABILITIES]
assertSameElements(expected_caps, caps_via_contacts_iface)
@@ -276,7 +276,7 @@ def test_ft_caps_to_contact(q, bus, conn, service):
# Check our own caps
#
caps_via_contacts_iface = conn.Contacts.GetContactAttributes(
- [self_handle], [cs.CONN_IFACE_CONTACT_CAPS], False) \
+ [self_handle], [cs.CONN_IFACE_CONTACT_CAPS]) \
[self_handle][cs.ATTR_CONTACT_CAPABILITIES]
assertEquals(basic_caps, caps_via_contacts_iface)
@@ -288,7 +288,7 @@ def test_ft_caps_to_contact(q, bus, conn, service):
# Check our own caps
caps_via_contacts_iface = conn.Contacts.GetContactAttributes(
- [self_handle], [cs.CONN_IFACE_CONTACT_CAPS], False) \
+ [self_handle], [cs.CONN_IFACE_CONTACT_CAPS]) \
[self_handle][cs.ATTR_CONTACT_CAPABILITIES]
assertEquals(basic_caps, caps_via_contacts_iface)
@@ -302,7 +302,7 @@ def test_ft_caps_to_contact(q, bus, conn, service):
# Check our own caps
caps_via_contacts_iface = conn.Contacts.GetContactAttributes(
- [self_handle], [cs.CONN_IFACE_CONTACT_CAPS], False) \
+ [self_handle], [cs.CONN_IFACE_CONTACT_CAPS]) \
[self_handle][cs.ATTR_CONTACT_CAPABILITIES]
assertEquals(basic_caps, caps_via_contacts_iface)
@@ -316,7 +316,7 @@ def test_ft_caps_to_contact(q, bus, conn, service):
# Check our own caps
caps_via_contacts_iface = conn.Contacts.GetContactAttributes(
- [self_handle], [cs.CONN_IFACE_CONTACT_CAPS], False) \
+ [self_handle], [cs.CONN_IFACE_CONTACT_CAPS]) \
[self_handle][cs.ATTR_CONTACT_CAPABILITIES]
assertEquals(basic_caps, caps_via_contacts_iface)
diff --git a/tests/twisted/avahi/ichat-composing.py b/tests/twisted/avahi/ichat-composing.py
index ae48d8a8..c2057fac 100644
--- a/tests/twisted/avahi/ichat-composing.py
+++ b/tests/twisted/avahi/ichat-composing.py
@@ -66,9 +66,11 @@ def test(q, bus, conn):
event.addElement('composing')
xmpp_connection.send(message)
- e = q.expect('dbus-signal', signal='Received')
- assert e.args[2] == handle
- assert e.args[5] == OUTGOING_MESSAGE
+ e = q.expect('dbus-signal', signal='MessageReceived')
+ assert len(e.args[0]) == 2
+ assert e.args[0][0]['message-sender-id'] == contact_name
+ assert e.args[0][0]['message-sender'] == handle
+ assert e.args[0][1]['content'] == OUTGOING_MESSAGE
if __name__ == '__main__':
exec_test(test)
diff --git a/tests/twisted/avahi/ichat-incoming-msg.py b/tests/twisted/avahi/ichat-incoming-msg.py
index 71812230..bbf3bf06 100644
--- a/tests/twisted/avahi/ichat-incoming-msg.py
+++ b/tests/twisted/avahi/ichat-incoming-msg.py
@@ -53,10 +53,12 @@ def test(q, bus, conn):
boddy = msg.addElement('body', content='hi')
outbound.send(msg)
- e = q.expect('dbus-signal', signal='Received')
- assert e.args[2] == handle
- assert e.args[3] == cs.MT_NORMAL
- assert e.args[5] == "hi"
+ e = q.expect('dbus-signal', signal='MessageReceived')
+ assert len(e.args[0]) == 2
+ assert e.args[0][0]['message-sender-id'] == contact_name
+ assert e.args[0][0]['message-sender'] == handle
+ assert e.args[0][0]['message-type'] == cs.MT_NORMAL
+ assert e.args[0][1]['content'] == "hi"
if __name__ == '__main__':
skip_if_another_llxmpp()
diff --git a/tests/twisted/avahi/muc-invite.py b/tests/twisted/avahi/muc-invite.py
index abfc8f28..6f0a6116 100644
--- a/tests/twisted/avahi/muc-invite.py
+++ b/tests/twisted/avahi/muc-invite.py
@@ -80,10 +80,9 @@ def test(q, bus, conn):
channel_group = make_channel_proxy(conn, path, "Channel.Interface.Group")
# check channel properties
- # org.freedesktop.Telepathy.Channel D-Bus properties
+ # im.telepathy1.Channel D-Bus properties
assert props[cs.CHANNEL_TYPE] == cs.CHANNEL_TYPE_TEXT
assertContains(cs.CHANNEL_IFACE_GROUP, props[cs.INTERFACES])
- assertContains(cs.CHANNEL_IFACE_MESSAGES, props[cs.INTERFACES])
assert props[cs.TARGET_ID] == 'my-room'
assert props[cs.TARGET_HANDLE_TYPE] == HT_ROOM
assert props[cs.REQUESTED] == False
@@ -92,14 +91,14 @@ def test(q, bus, conn):
# we are added to local pending
e = q.expect('dbus-signal', signal='MembersChanged')
- msg, added, removed, lp, rp, actor, reason = e.args
- assert msg == 'Inviting to this room'
+ added, removed, lp, rp, details = e.args
+ assert details['message'] == 'Inviting to this room'
assert added == []
assert removed == []
assert lp == [self_handle]
assert rp == []
- assert actor == handle
- assert reason == 4 # invited
+ assert details['actor'] == handle
+ assert details['change-reason'] == 4 # invited
# TODO: join the muc, check if we are added to remote-pending and then
# to members. This would need some tweak in Salut and/or the test framework
diff --git a/tests/twisted/avahi/olpc-activity-announcements.py b/tests/twisted/avahi/olpc-activity-announcements.py
index 6b4d01a2..93dbd1a6 100644
--- a/tests/twisted/avahi/olpc-activity-announcements.py
+++ b/tests/twisted/avahi/olpc-activity-announcements.py
@@ -13,7 +13,7 @@ import time
import dbus
import socket
-CHANNEL_TYPE_TEXT = "org.freedesktop.Telepathy.Channel.Type.Text"
+CHANNEL_TYPE_TEXT = "im.telepathy1.Channel.Type.Text"
HT_CONTACT = 1
HT_ROOM = 2
HT_CONTACT_LIST = 3
diff --git a/tests/twisted/avahi/request-im.py b/tests/twisted/avahi/request-im.py
index d7d2141e..93e3abf7 100644
--- a/tests/twisted/avahi/request-im.py
+++ b/tests/twisted/avahi/request-im.py
@@ -5,13 +5,11 @@ Test requesting of text 1-1 channels using the old and new request API.
import dbus
-from saluttest import (exec_test, wait_for_contact_list,
- wait_for_contact_in_publish)
+from saluttest import (exec_test, wait_for_contact_in_publish)
from servicetest import call_async, EventPattern, \
tp_name_prefix, make_channel_proxy
from avahitest import get_host_name, AvahiAnnouncer
from xmppstream import setup_stream_listener
-
import constants as cs
def test(q, bus, conn):
@@ -24,10 +22,6 @@ def test(q, bus, conn):
contact_name = "test-request-im@" + get_host_name()
listener, port = setup_stream_listener(q, contact_name)
- # FIXME: this is a hack to be sure to have all the contact list channels
- # announced so they won't interfere with the muc ones announces.
- wait_for_contact_list(q, conn)
-
AvahiAnnouncer(contact_name, "_presence._tcp", port, basic_txt)
handle = wait_for_contact_in_publish(q, bus, conn, contact_name)
diff --git a/tests/twisted/avahi/request-muc.py b/tests/twisted/avahi/request-muc.py
index a6283b2e..9ef67770 100644
--- a/tests/twisted/avahi/request-muc.py
+++ b/tests/twisted/avahi/request-muc.py
@@ -8,7 +8,7 @@ import avahitest
from twisted.words.xish import domish
-from saluttest import exec_test, wait_for_contact_list
+from saluttest import exec_test
from servicetest import call_async, EventPattern, \
tp_name_prefix, tp_path_prefix, make_channel_proxy
@@ -21,10 +21,6 @@ def test(q, bus, conn):
q.expect('dbus-signal', signal='StatusChanged', args=[0L, 0L])
- # FIXME: this is a hack to be sure to have all the contact list channels
- # announced so they won't interfere with the muc ones announces.
- wait_for_contact_list(q, conn)
-
# check if we can request roomlist channels
properties = conn.GetAll(
tp_name_prefix + '.Connection.Interface.Requests',
diff --git a/tests/twisted/avahi/roomlist.py b/tests/twisted/avahi/roomlist.py
index 7e84a1be..21fb1824 100644
--- a/tests/twisted/avahi/roomlist.py
+++ b/tests/twisted/avahi/roomlist.py
@@ -8,7 +8,7 @@ import avahitest
from twisted.words.xish import domish
-from saluttest import exec_test, wait_for_contact_list
+from saluttest import exec_test
from servicetest import call_async, EventPattern, \
tp_name_prefix, tp_path_prefix, wrap_channel
import constants as cs
@@ -20,14 +20,11 @@ def test(q, bus, conn):
q.expect('dbus-signal', signal='StatusChanged', args=[0L, 0L])
- # FIXME: this is a hack to be sure to have all the contact list channels
- # announced so they won't interfere with the roomlist ones announces.
- wait_for_contact_list(q, conn)
-
# check if we can request roomlist channels
properties = conn.GetAll(
tp_name_prefix + '.Connection.Interface.Requests',
dbus_interface='org.freedesktop.DBus.Properties')
+
assert ({tp_name_prefix + '.Channel.ChannelType':
cs.CHANNEL_TYPE_ROOM_LIST,
tp_name_prefix + '.Channel.TargetHandleType': 0,
@@ -51,7 +48,7 @@ def test(q, bus, conn):
EventPattern('dbus-signal', signal='NewChannels'),
)
path2 = ret.value[0]
- chan2 = wrap_channel(bus.get_object(conn.bus_name, path2), "RoomList")
+ chan2 = wrap_channel(bus.get_object(conn.bus_name, path2), "RoomList1")
props = ret.value[1]
assert props[tp_name_prefix + '.Channel.ChannelType'] ==\
@@ -64,7 +61,7 @@ def test(q, bus, conn):
== conn.Properties.Get(cs.CONN, "SelfHandle")
assert props[tp_name_prefix + '.Channel.InitiatorID'] \
== self_name
- assert props[tp_name_prefix + '.Channel.Type.RoomList.Server'] == ''
+ assert props[tp_name_prefix + '.Channel.Type.RoomList1.Server'] == ''
assert new_sig.args[0][0][0] == path2
assert new_sig.args[0][0][1] == props
diff --git a/tests/twisted/avahi/set-presence.py b/tests/twisted/avahi/set-presence.py
index 82343c4b..b6f38f1e 100644
--- a/tests/twisted/avahi/set-presence.py
+++ b/tests/twisted/avahi/set-presence.py
@@ -32,13 +32,13 @@ def test(q, bus, conn):
assert status == 'avail', status
assert msg is None, msg
- statuses = conn.Get(cs.CONN_IFACE_SIMPLE_PRESENCE, 'Statuses', dbus_interface=dbus.PROPERTIES_IFACE)
+ statuses = conn.Get(cs.CONN_IFACE_PRESENCE, 'Statuses', dbus_interface=dbus.PROPERTIES_IFACE)
assert 'available' in statuses
assert 'dnd' in statuses
assert 'away' in statuses
- simple_presence = dbus.Interface(conn, cs.CONN_IFACE_SIMPLE_PRESENCE)
+ simple_presence = dbus.Interface(conn, cs.CONN_IFACE_PRESENCE)
# set your status to away
simple_presence.SetPresence('away', 'At the pub')
diff --git a/tests/twisted/avahi/text-channel.py b/tests/twisted/avahi/text-channel.py
index b37b1c2f..acaed6a2 100644
--- a/tests/twisted/avahi/text-channel.py
+++ b/tests/twisted/avahi/text-channel.py
@@ -34,7 +34,9 @@ def test(q, bus, conn):
cs.TARGET_HANDLE_TYPE: cs.HT_CONTACT,
cs.TARGET_HANDLE: handle})[0]
text_channel = make_channel_proxy(conn, t, "Channel.Type.Text")
- text_channel.Send(cs.MT_NORMAL, INCOMING_MESSAGE)
+ text_channel.SendMessage([{'message-type': cs.MT_NORMAL},
+ {'content-type': 'text/plain',
+ 'content': INCOMING_MESSAGE}], 0)
e = q.expect('incoming-connection', listener = listener)
incoming = e.connection
@@ -76,11 +78,12 @@ def test(q, bus, conn):
e.connection.send(message)
- e = q.expect('dbus-signal', signal='Received')
- assert e.args[2] == handle
- assert e.args[3] == cs.MT_NORMAL
- assert e.args[5] == OUTGOING_MESSAGE
-
+ e = q.expect('dbus-signal', signal='MessageReceived')
+ assert len(e.args[0]) == 2
+ assert e.args[0][0]['message-sender-id'] == contact_name
+ assert e.args[0][0]['message-sender'] == handle
+ assert e.args[0][0]['message-type'] == cs.MT_NORMAL
+ assert e.args[0][1]['content'] == OUTGOING_MESSAGE
if __name__ == '__main__':
exec_test(test)
diff --git a/tests/twisted/avahi/tubes/request-muc-tubes.py b/tests/twisted/avahi/tubes/request-muc-tubes.py
index 21100f15..206f3384 100644
--- a/tests/twisted/avahi/tubes/request-muc-tubes.py
+++ b/tests/twisted/avahi/tubes/request-muc-tubes.py
@@ -8,7 +8,7 @@ import avahitest
from twisted.words.xish import domish
-from saluttest import exec_test, wait_for_contact_list
+from saluttest import exec_test
from servicetest import call_async, EventPattern, wrap_channel, pretty
import constants as cs
@@ -19,10 +19,6 @@ def test(q, bus, conn):
q.expect('dbus-signal', signal='StatusChanged', args=[0L, 0L])
- # FIXME: this is a hack to be sure to have all the contact list channels
- # announced so they won't interfere with the muc ones announces.
- wait_for_contact_list(q, conn)
-
# check if we can request tube channels
properties = conn.Properties.GetAll(cs.CONN_IFACE_REQUESTS)
assert ({cs.CHANNEL_TYPE: cs.CHANNEL_TYPE_STREAM_TUBE,
diff --git a/tests/twisted/avahi/tubes/tubetestutil.py b/tests/twisted/avahi/tubes/tubetestutil.py
index d058ef62..4e342f9e 100644
--- a/tests/twisted/avahi/tubes/tubetestutil.py
+++ b/tests/twisted/avahi/tubes/tubetestutil.py
@@ -1,4 +1,4 @@
-from saluttest import make_connection, wait_for_contact_list
+from saluttest import make_connection
from avahitest import get_host_name
from servicetest import make_channel_proxy
@@ -10,10 +10,6 @@ def connect_two_accounts(q, bus, conn):
conn.Connect()
q.expect('dbus-signal', signal='StatusChanged', args=[cs.CONN_STATUS_CONNECTED, cs.CSR_NONE_SPECIFIED])
- # FIXME: this is a hack to be sure to have all the contact list channels
- # announced so they won't interfere with other channels announces.
- wait_for_contact_list(q, conn)
-
# second connection: connect
conn2_params = {
'published-name': 'testsuite2',
@@ -25,8 +21,6 @@ def connect_two_accounts(q, bus, conn):
conn2.Connect()
q.expect('dbus-signal', signal='StatusChanged', args=[cs.CONN_STATUS_CONNECTED, cs.CSR_NONE_SPECIFIED])
- wait_for_contact_list(q, conn2)
-
# first connection: get the contact list
publish_handle = conn.RequestHandles(cs.HT_LIST, ["publish"])[0]
conn1_publish = conn.RequestChannel(cs.CHANNEL_TYPE_CONTACT_LIST,
@@ -62,7 +56,7 @@ def connect_two_accounts(q, bus, conn):
# property first
contact1_handle_on_conn2 = 0
conn2_members = conn2_publish_proxy.Get(
- 'org.freedesktop.Telepathy.Channel.Interface.Group', 'Members',
+ 'im.telepathy1.Channel.Interface.Group', 'Members',
dbus_interface='org.freedesktop.DBus.Properties')
for h in conn2_members:
name = conn2.InspectHandles(cs.HT_CONTACT, [h])[0]
diff --git a/tests/twisted/avahi/tubes/two-muc-dbus-tubes.py b/tests/twisted/avahi/tubes/two-muc-dbus-tubes.py
index 6fc81097..ae8864c3 100644
--- a/tests/twisted/avahi/tubes/two-muc-dbus-tubes.py
+++ b/tests/twisted/avahi/tubes/two-muc-dbus-tubes.py
@@ -21,9 +21,9 @@ def check_dbus_names(tube, members):
names = tube.Properties.Get(cs.CHANNEL_TYPE_DBUS_TUBE, 'DBusNames')
assert set(names.keys()) == set(members), names.keys()
-SERVICE = "org.freedesktop.Telepathy.Tube.Test"
+SERVICE = "im.telepathy1.Tube.Test"
IFACE = SERVICE
-PATH = "/org/freedesktop/Telepathy/Tube/Test"
+PATH = "/im/telepathy1/Tube/Test"
print "FIXME: MUC tubes tests are currently broken: fdo#69223"
# exiting 77 causes automake to consider the test to have been skipped
diff --git a/tests/twisted/cm/protocol.py b/tests/twisted/cm/protocol.py
index 6f62f1ec..157c6b6f 100644
--- a/tests/twisted/cm/protocol.py
+++ b/tests/twisted/cm/protocol.py
@@ -16,9 +16,9 @@ def test(q, bus, conn):
cm_prop_iface = dbus.Interface(cm, cs.PROPERTIES_IFACE)
protocols = unwrap(cm_prop_iface.Get(cs.CM, 'Protocols'))
- assertEquals(set(['local-xmpp']), set(protocols.keys()))
+ assertEquals(set(['local_xmpp']), set(protocols.keys()))
- local_props = protocols['local-xmpp']
+ local_props = protocols['local_xmpp']
local_params = local_props[cs.PROTOCOL + '.Parameters']
proto = bus.get_object(cm.bus_name, cm.object_path + '/local_xmpp')
@@ -39,7 +39,7 @@ def test(q, bus, conn):
assertContains(cs.CONN_IFACE_ALIASING, proto_props['ConnectionInterfaces'])
assertContains(cs.CONN_IFACE_AVATARS, proto_props['ConnectionInterfaces'])
assertContains(cs.CONN_IFACE_CONTACTS, proto_props['ConnectionInterfaces'])
- assertContains(cs.CONN_IFACE_SIMPLE_PRESENCE,
+ assertContains(cs.CONN_IFACE_PRESENCE,
proto_props['ConnectionInterfaces'])
assertContains(cs.CONN_IFACE_REQUESTS, proto_props['ConnectionInterfaces'])
diff --git a/tests/twisted/constants.py b/tests/twisted/constants.py
index 8c601678..30283533 100644
--- a/tests/twisted/constants.py
+++ b/tests/twisted/constants.py
@@ -4,54 +4,43 @@ Some handy constants for other tests to share and enjoy.
from dbus import PROPERTIES_IFACE
-PREFIX = "org.freedesktop.Telepathy"
+PREFIX = "im.telepathy1"
CM = PREFIX + ".ConnectionManager"
HT_NONE = 0
HT_CONTACT = 1
HT_ROOM = 2
-HT_LIST = 3
-HT_GROUP = 4
CHANNEL = PREFIX + ".Channel"
-CHANNEL_IFACE_CALL_STATE = CHANNEL + ".Interface.CallState"
-CHANNEL_IFACE_CHAT_STATE = CHANNEL + '.Interface.ChatState'
-CHANNEL_IFACE_DESTROYABLE = CHANNEL + ".Interface.Destroyable"
-CHANNEL_IFACE_DTMF = CHANNEL + ".Interface.DTMF"
-CHANNEL_IFACE_GROUP = CHANNEL + ".Interface.Group"
-CHANNEL_IFACE_HOLD = CHANNEL + ".Interface.Hold"
-CHANNEL_IFACE_MEDIA_SIGNALLING = CHANNEL + ".Interface.MediaSignalling"
-CHANNEL_IFACE_MESSAGES = CHANNEL + ".Interface.Messages"
-CHANNEL_IFACE_PASSWORD = CHANNEL + ".Interface.Password"
-CHANNEL_IFACE_TUBE = CHANNEL + ".Interface.Tube"
-CHANNEL_IFACE_SASL_AUTH = CHANNEL + ".Interface.SASLAuthentication"
-CHANNEL_IFACE_CONFERENCE = CHANNEL + '.Interface.Conference'
-CHANNEL_IFACE_ROOM = CHANNEL + '.Interface.Room2'
+CHANNEL_IFACE_CHAT_STATE = CHANNEL + '.Interface.ChatState1'
+CHANNEL_IFACE_DESTROYABLE = CHANNEL + ".Interface.Destroyable1"
+CHANNEL_IFACE_DTMF = CHANNEL + ".Interface.DTMF1"
+CHANNEL_IFACE_GROUP = CHANNEL + ".Interface.Group1"
+CHANNEL_IFACE_HOLD = CHANNEL + ".Interface.Hold1"
+CHANNEL_IFACE_PASSWORD = CHANNEL + ".Interface.Password1"
+CHANNEL_IFACE_TUBE = CHANNEL + ".Interface.Tube1"
+CHANNEL_IFACE_SASL_AUTH = CHANNEL + ".Interface.SASLAuthentication1"
+CHANNEL_IFACE_CONFERENCE = CHANNEL + '.Interface.Conference1'
+CHANNEL_IFACE_ROOM = CHANNEL + '.Interface.Room1'
CHANNEL_IFACE_ROOM_CONFIG = CHANNEL + '.Interface.RoomConfig1'
-CHANNEL_IFACE_SUBJECT = CHANNEL + '.Interface.Subject2'
-CHANNEL_IFACE_FILE_TRANSFER_METADATA = CHANNEL + '.Interface.FileTransfer.Metadata'
+CHANNEL_IFACE_SUBJECT = CHANNEL + '.Interface.Subject1'
+CHANNEL_IFACE_FILE_TRANSFER_METADATA = CHANNEL + '.Interface.FileTransfer.Metadata1'
CHANNEL_TYPE_CALL = CHANNEL + ".Type.Call1"
-CHANNEL_TYPE_CONTACT_LIST = CHANNEL + ".Type.ContactList"
-CHANNEL_TYPE_CONTACT_SEARCH = CHANNEL + ".Type.ContactSearch"
+CHANNEL_TYPE_CONTACT_LIST = CHANNEL + ".Type.ContactList1"
+CHANNEL_TYPE_CONTACT_SEARCH = CHANNEL + ".Type.ContactSearch1"
+CHANNEL_TYPE_TEXT = CHANNEL + ".Type.Text1"
+CHANNEL_TYPE_STREAM_TUBE = CHANNEL + ".Type.StreamTube1"
+CHANNEL_TYPE_DBUS_TUBE = CHANNEL + ".Type.DBusTube1"
CHANNEL_TYPE_TEXT = CHANNEL + ".Type.Text"
-CHANNEL_TYPE_TUBES = CHANNEL + ".Type.Tubes"
-CHANNEL_TYPE_STREAM_TUBE = CHANNEL + ".Type.StreamTube"
-CHANNEL_TYPE_DBUS_TUBE = CHANNEL + ".Type.DBusTube"
-CHANNEL_TYPE_TEXT = CHANNEL + ".Type.Text"
-CHANNEL_TYPE_FILE_TRANSFER = CHANNEL + ".Type.FileTransfer"
-CHANNEL_TYPE_ROOM_LIST = CHANNEL + ".Type.RoomList"
+CHANNEL_TYPE_FILE_TRANSFER = CHANNEL + ".Type.FileTransfer1"
+CHANNEL_TYPE_ROOM_LIST = CHANNEL + ".Type.RoomList1"
CHANNEL_TYPE_SERVER_AUTHENTICATION = \
- CHANNEL + ".Type.ServerAuthentication"
+ CHANNEL + ".Type.ServerAuthentication1"
CHANNEL_TYPE_SERVER_TLS_CONNECTION = \
- CHANNEL + ".Type.ServerTLSConnection"
-
-TP_AWKWARD_PROPERTIES = PREFIX + ".Properties"
-PROPERTY_FLAG_READ = 1
-PROPERTY_FLAG_WRITE = 2
-PROPERTY_FLAGS_RW = PROPERTY_FLAG_READ | PROPERTY_FLAG_WRITE
+ CHANNEL + ".Type.ServerTLSConnection1"
CHANNEL_TYPE = CHANNEL + '.ChannelType'
TARGET_HANDLE_TYPE = CHANNEL + '.TargetHandleType'
@@ -165,28 +154,26 @@ CONTACT_LIST_STATE_FAILURE = 2
CONTACT_LIST_STATE_SUCCESS = 3
CONN = PREFIX + ".Connection"
-CONN_IFACE_AVATARS = CONN + '.Interface.Avatars'
-CONN_IFACE_ALIASING = CONN + '.Interface.Aliasing'
-CONN_IFACE_CAPS = CONN + '.Interface.Capabilities'
+CONN_IFACE_AVATARS = CONN + '.Interface.Avatars1'
+CONN_IFACE_ALIASING = CONN + '.Interface.Aliasing1'
CONN_IFACE_CONTACTS = CONN + '.Interface.Contacts'
-CONN_IFACE_CONTACT_CAPS = CONN + '.Interface.ContactCapabilities'
-CONN_IFACE_CONTACT_INFO = CONN + ".Interface.ContactInfo"
-CONN_IFACE_PRESENCE = CONN + '.Interface.Presence'
-CONN_IFACE_SIMPLE_PRESENCE = CONN + '.Interface.SimplePresence'
+CONN_IFACE_CONTACT_CAPS = CONN + '.Interface.ContactCapabilities1'
+CONN_IFACE_CONTACT_INFO = CONN + ".Interface.ContactInfo1"
+CONN_IFACE_PRESENCE = CONN + '.Interface.Presence1'
CONN_IFACE_REQUESTS = CONN + '.Interface.Requests'
-CONN_IFACE_LOCATION = CONN + '.Interface.Location'
+CONN_IFACE_LOCATION = CONN + '.Interface.Location1'
CONN_IFACE_GABBLE_DECLOAK = CONN + '.Interface.Gabble.Decloak'
-CONN_IFACE_MAIL_NOTIFICATION = CONN + '.Interface.MailNotification'
-CONN_IFACE_CONTACT_LIST = CONN + '.Interface.ContactList'
-CONN_IFACE_CONTACT_GROUPS = CONN + '.Interface.ContactGroups'
-CONN_IFACE_CLIENT_TYPES = CONN + '.Interface.ClientTypes'
-CONN_IFACE_POWER_SAVING = CONN + '.Interface.PowerSaving'
-CONN_IFACE_CONTACT_BLOCKING = CONN + '.Interface.ContactBlocking'
+CONN_IFACE_MAIL_NOTIFICATION = CONN + '.Interface.MailNotification1'
+CONN_IFACE_CONTACT_LIST = CONN + '.Interface.ContactList1'
+CONN_IFACE_CONTACT_GROUPS = CONN + '.Interface.ContactGroups1'
+CONN_IFACE_CLIENT_TYPES = CONN + '.Interface.ClientTypes1'
+CONN_IFACE_POWER_SAVING = CONN + '.Interface.PowerSaving1'
+CONN_IFACE_CONTACT_BLOCKING = CONN + '.Interface.ContactBlocking1'
CONN_IFACE_ADDRESSING = CONN + '.Interface.Addressing1'
ATTR_CONTACT_ID = CONN + '/contact-id'
ATTR_CONTACT_CAPABILITIES = CONN_IFACE_CONTACT_CAPS + '/capabilities'
-ATTR_PRESENCE = CONN_IFACE_SIMPLE_PRESENCE + '/presence'
+ATTR_PRESENCE = CONN_IFACE_PRESENCE + '/presence'
STREAM_HANDLER = PREFIX + '.Media.StreamHandler'
@@ -470,9 +457,9 @@ class SendError(object):
NOT_IMPLEMENTED = 5
PROTOCOL = PREFIX + '.Protocol'
-PROTOCOL_IFACE_PRESENCES = PROTOCOL + '.Interface.Presence'
-PROTOCOL_IFACE_ADDRESSING = PROTOCOL + '.Interface.Addressing'
-PROTOCOL_IFACE_AVATARS = PROTOCOL + '.Interface.Avatars'
+PROTOCOL_IFACE_PRESENCES = PROTOCOL + '.Interface.Presence1'
+PROTOCOL_IFACE_ADDRESSING = PROTOCOL + '.Interface.Addressing1'
+PROTOCOL_IFACE_AVATARS = PROTOCOL + '.Interface.Avatars1'
PARAM_REQUIRED = 1
PARAM_REGISTER = 2
@@ -492,9 +479,9 @@ TLS_REJECT_REASON_UNTRUSTED = 1
# Channel.Interface.Messages
-MESSAGE_PART_SUPPORT_FLAGS = CHANNEL_IFACE_MESSAGES + '.MessagePartSupportFlags'
-DELIVERY_REPORTING_SUPPORT = CHANNEL_IFACE_MESSAGES + '.DeliveryReportingSupport'
-SUPPORTED_CONTENT_TYPES = CHANNEL_IFACE_MESSAGES + '.SupportedContentTypes'
+MESSAGE_PART_SUPPORT_FLAGS = CHANNEL_TYPE_TEXT + '.MessagePartSupportFlags'
+DELIVERY_REPORTING_SUPPORT = CHANNEL_TYPE_TEXT + '.DeliveryReportingSupport'
+SUPPORTED_CONTENT_TYPES = CHANNEL_TYPE_TEXT + '.SupportedContentTypes'
MSG_SENDING_FLAGS_REPORT_DELIVERY = 1
MSG_SENDING_FLAGS_REPORT_READ = 2
diff --git a/tests/twisted/saluttest.py b/tests/twisted/saluttest.py
index fec5b1ed..0517730e 100644
--- a/tests/twisted/saluttest.py
+++ b/tests/twisted/saluttest.py
@@ -54,7 +54,7 @@ def make_connection(bus, event_func, params=None):
default_params.update(params)
return servicetest.make_connection(bus, event_func, 'salut',
- 'local-xmpp', default_params)
+ 'local_xmpp', default_params)
def ensure_avahi_is_running():
bus = dbus.SystemBus()
@@ -185,31 +185,11 @@ def exec_test(fun, params=None, protocol=None, timeout=None,
make_conn)
reactor.run()
-def wait_for_contact_list(q, conn):
- """Request contact list channels and wait for their NewChannel signals.
- This is useful to avoid these signals to interfere with your test."""
-
- #FIXME: this maybe racy if there are other contacts connected
- requestotron = dbus.Interface(conn, cs.CONN_IFACE_REQUESTS)
-
- # publish
- requestotron.EnsureChannel({
- cs.CHANNEL_TYPE: cs.CHANNEL_TYPE_CONTACT_LIST,
- cs.TARGET_HANDLE_TYPE: cs.HT_LIST,
- cs.TARGET_ID: 'publish'})
- q.expect('dbus-signal', signal='NewChannel')
- # subscribe
- requestotron.EnsureChannel({
- cs.CHANNEL_TYPE: cs.CHANNEL_TYPE_CONTACT_LIST,
- cs.TARGET_HANDLE_TYPE: cs.HT_LIST,
- cs.TARGET_ID: 'subscribe'})
- q.expect('dbus-signal', signal='NewChannel')
-
def wait_for_contact_in_publish(q, bus, conn, contact_name):
handle = 0
# Wait until the record shows up in publish
while handle == 0:
- e = q.expect('dbus-signal', signal='ContactsChangedWithID',
+ e = q.expect('dbus-signal', signal='ContactsChanged',
path=conn.object_path)
for h, state in e.args[0].items():
name = e.args[1][h]
diff --git a/tests/twisted/servicetest.py b/tests/twisted/servicetest.py
index bca3b13b..08c6ab9e 100644
--- a/tests/twisted/servicetest.py
+++ b/tests/twisted/servicetest.py
@@ -18,8 +18,8 @@ from twisted.internet import reactor
import constants as cs
-tp_name_prefix = 'org.freedesktop.Telepathy'
-tp_path_prefix = '/org/freedesktop/Telepathy'
+tp_name_prefix = 'im.telepathy1'
+tp_path_prefix = '/im/telepathy1'
class DictionarySupersetOf (object):
"""Utility class for expecting "a dictionary with at least these keys"."""
@@ -419,7 +419,7 @@ def sync_dbus(bus, q, conn):
assert conn.object.bus_name.startswith(':')
root_object = bus.get_object(conn.object.bus_name, '/')
call_async(
- q, dbus.Interface(root_object, 'org.freedesktop.Telepathy.Tests'), 'DummySyncDBus')
+ q, dbus.Interface(root_object, 'im.telepathy1.Tests'), 'DummySyncDBus')
q.expect('dbus-error', method='DummySyncDBus')
class ProxyWrapper:
@@ -445,7 +445,7 @@ def wrap_connection(conn):
dict([
(name, tp_name_prefix + '.Connection.Interface.' + name)
for name in ['Aliasing', 'Avatars', 'Capabilities', 'Contacts',
- 'Presence', 'SimplePresence', 'Requests']] +
+ 'Presence', 'Requests']] +
[('Peer', 'org.freedesktop.DBus.Peer'),
('ContactCapabilities', cs.CONN_IFACE_CONTACT_CAPS),
('ContactInfo', cs.CONN_IFACE_CONTACT_INFO),
diff --git a/tests/twisted/sidecars.py b/tests/twisted/sidecars.py
index 26a7b67c..137a27f8 100644
--- a/tests/twisted/sidecars.py
+++ b/tests/twisted/sidecars.py
@@ -9,7 +9,7 @@ from saluttest import exec_test
import constants as cs
from config import PLUGINS_ENABLED
-TEST_PLUGIN_IFACE = "org.freedesktop.Telepathy.Salut.Plugin.Test"
+TEST_PLUGIN_IFACE = "im.telepathy1.Salut.Plugin.Test"
if not PLUGINS_ENABLED:
print "NOTE: built without --enable-plugins, not testing plugins"
diff --git a/tests/twisted/tools/Makefile.am b/tests/twisted/tools/Makefile.am
index aaca6af3..bab9999f 100644
--- a/tests/twisted/tools/Makefile.am
+++ b/tests/twisted/tools/Makefile.am
@@ -8,12 +8,12 @@ exec-with-log.sh: exec-with-log.sh.in
# We don't use the full filename for the .in because > 99 character filenames
# in tarballs are non-portable (and automake 1.8 doesn't let us build
# non-archaic tarballs)
-org.freedesktop.Telepathy.ConnectionManager.%.service: %.service.in
+im.telepathy1.ConnectionManager.%.service: %.service.in
$(AM_V_GEN)sed -e "s|[@]abs_top_builddir[@]|@abs_top_builddir@|g" $< > $@
# D-Bus service file for testing
service_in_files = salut.service.in
-service_files = org.freedesktop.Telepathy.ConnectionManager.salut.service
+service_files = im.telepathy1.ConnectionManager.salut.service
# D-Bus config file for testing
conf_in_files = tmp-session-bus.conf.in
diff --git a/tests/twisted/tools/salut.service.in b/tests/twisted/tools/salut.service.in
index 93adb71d..c517ba10 100644
--- a/tests/twisted/tools/salut.service.in
+++ b/tests/twisted/tools/salut.service.in
@@ -1,3 +1,3 @@
[D-BUS Service]
-Name=org.freedesktop.Telepathy.ConnectionManager.salut
+Name=im.telepathy1.ConnectionManager.salut
Exec=@abs_top_builddir@/tests/twisted/tools/exec-with-log.sh