Update to ergo 2.15+

This commit is contained in:
Luca Matei Pintilie
2025-10-12 18:01:47 +02:00
committed by mathieui
parent d3b3242874
commit 979ba96cb0
19 changed files with 78 additions and 140 deletions
+1 -1
View File
@@ -24,7 +24,7 @@ endif()
# #
## Find optional instrumentation libraries that will be used in debug only ## Find optional instrumentation libraries that will be used in debug only
# #
find_library(LIBASAN NAMES asan libasan.so.4 libasan.so.3 libasan.so.2 libasan.so.1) find_library(LIBASAN NAMES asan libasan.so.8 libasan.so.4 libasan.so.3 libasan.so.2 libasan.so.1)
find_library(LIBUBSAN NAMES ubsan libubsan.so.0) find_library(LIBUBSAN NAMES ubsan libubsan.so.0)
# #
+6 -6
View File
@@ -1,13 +1,17 @@
# This Dockerfile creates a docker image suitable to run biboumi’s build and # This Dockerfile creates a docker image suitable to run biboumi’s build and
# tests. For example, it can be used on with gitlab-ci. # tests. For example, it can be used on with gitlab-ci.
FROM alpine:latest FROM docker.io/alpine:edge
ENV LC_ALL C.UTF-8 ENV LC_ALL C.UTF-8
# py3-slixmpp is in testing repo
RUN echo "https://dl-cdn.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories
# Needed to build biboumi # Needed to build biboumi
RUN apk add --no-cache \ RUN apk add --no-cache \
git \ git \
ergo \
make \ make \
cmake \ cmake \
g++ \ g++ \
@@ -24,6 +28,7 @@ catch2-3 \
valgrind \ valgrind \
py3-pip \ py3-pip \
py3-lxml \ py3-lxml \
py3-slixmpp \
python3-dev \ python3-dev \
libffi-dev \ libffi-dev \
go \ go \
@@ -31,8 +36,3 @@ rust \
cargo \ cargo \
wget wget
# Install oragono, for e2e tests
RUN wget "https://github.com/ergochat/ergo/archive/v2.0.0.tar.gz" && tar xvf "v2.0.0.tar.gz" && cd "ergo-2.0.0" && make && cp ~/go/bin/oragono /usr/local/bin/oragono
# Install slixmpp, for e2e tests
RUN pip3 install slixmpp --break-system-packages
+3 -3
View File
@@ -1,7 +1,7 @@
# This Dockerfile creates a docker image suitable to run biboumi’s build and # This Dockerfile creates a docker image suitable to run biboumi’s build and
# tests. For example, it can be used on with gitlab-ci. # tests. For example, it can be used on with gitlab-ci.
FROM debian:bookworm FROM docker.io/debian:trixie
ENV LC_ALL=C.UTF-8 ENV LC_ALL=C.UTF-8
@@ -23,10 +23,10 @@ libgcrypt20-dev \
libpq-dev \ libpq-dev \
libcatch2-dev \ libcatch2-dev \
valgrind \ valgrind \
libasan6 \ libasan8 \
libubsan1 \ libubsan1 \
python3-lxml \ python3-lxml \
python3-slixmpp \ python3-slixmpp \
ergochat \
wget wget
RUN wget "https://github.com/ergochat/ergo/releases/download/v2.0.0/oragono-2.0.0-linux-x64.tar.gz" && tar xvf oragono-2.0.0-linux-x64.tar.gz && cp oragono-2.0.0-linux-x64/oragono /usr/local/bin
+4 -3
View File
@@ -1,8 +1,9 @@
# This Dockerfile creates a docker image suitable to run biboumi’s build and # This Dockerfile creates a docker image suitable to run biboumi’s build and
# tests. For example, it can be used on with gitlab-ci. # tests. For example, it can be used on with gitlab-ci.
FROM fedora:latest FROM docker.io/fedora:latest
ARG ERGO_VERSION=2.16.0
ENV LC_ALL=C.UTF-8 ENV LC_ALL=C.UTF-8
# TODO: upgrade to botan3 # TODO: upgrade to botan3
@@ -39,5 +40,5 @@ rpmdevtools \
# Install slixmpp, for e2e tests # Install slixmpp, for e2e tests
RUN pip3 install --break-system-packages slixmpp RUN pip3 install --break-system-packages slixmpp
# Install oragono, for e2e tests # Install ergo, for e2e tests
RUN wget "https://github.com/ergochat/ergo/releases/download/v2.0.0/oragono-2.0.0-linux-x64.tar.gz" && tar xvf oragono-2.0.0-linux-x64.tar.gz && cp oragono-2.0.0-linux-x64/oragono /usr/local/bin RUN wget "https://github.com/ergochat/ergo/releases/download/v${ERGO_VERSION}/ergo-${ERGO_VERSION}-linux-x86_64.tar.gz" && tar xvf ergo-${ERGO_VERSION}-linux-x86_64.tar.gz && cp -r ergo-${ERGO_VERSION}-linux-x86_64 /usr/local/lib/ergo && ln -s /usr/local/lib/ergo/ergo /usr/local/bin/ergo
+1
View File
@@ -13,6 +13,7 @@
#include <database/database.hpp> #include <database/database.hpp>
#include "result_set_management.hpp" #include "result_set_management.hpp"
#include <algorithm> #include <algorithm>
#include <cstring>
using namespace std::string_literals; using namespace std::string_literals;
+7 -4
View File
@@ -14,6 +14,7 @@ import signal
import atexit import atexit
import sys import sys
import os import os
import shutil
from slixmpp.xmlstream.matcher.base import MatcherBase from slixmpp.xmlstream.matcher.base import MatcherBase
@@ -180,8 +181,9 @@ class IrcServerRunner(ProcessRunner):
os.remove("ircd.db") os.remove("ircd.db")
except FileNotFoundError: except FileNotFoundError:
pass pass
subprocess.run(["oragono", "mkcerts", "--conf", os.getcwd() + "/../tests/end_to_end/ircd.yaml"]) ergo_path = shutil.which("ergo") or shutil.which("ergochat")
self.create = asyncio.create_subprocess_exec("oragono", "run", "--conf", os.getcwd() + "/../tests/end_to_end/ircd.yaml", subprocess.run([ergo_path, "mkcerts", "--conf", os.getcwd() + "/../tests/end_to_end/ircd.yaml"])
self.create = asyncio.create_subprocess_exec(ergo_path, "run", "--conf", os.getcwd() + "/../tests/end_to_end/ircd.yaml",
stderr=asyncio.subprocess.PIPE) stderr=asyncio.subprocess.PIPE)
class BiboumiTest: class BiboumiTest:
@@ -205,7 +207,8 @@ class BiboumiTest:
pass pass
logging.basicConfig(level=logging.DEBUG, logging.basicConfig(level=logging.DEBUG,
format='%(levelname)-8s %(message)s', format='%(levelname)-8s %(message)s',
filename=output_filename) filename=output_filename,
force=True)
with open("test.conf", "w") as fd: with open("test.conf", "w") as fd:
fd.write(confs[self.scenario.conf]) fd.write(confs[self.scenario.conf])
@@ -241,7 +244,7 @@ class BiboumiTest:
xmpp.saved_values.clear() xmpp.saved_values.clear()
if xmpp.server: if xmpp.boundjid.host:
xmpp.accepting_server.close() xmpp.accepting_server.close()
return not failed return not failed
+29 -100
View File
@@ -1,4 +1,4 @@
# oragono IRCd config # ergo IRCd config
# network configuration # network configuration
network: network:
@@ -87,14 +87,15 @@ server:
# casemapping controls what kinds of strings are permitted as identifiers (nicknames, # casemapping controls what kinds of strings are permitted as identifiers (nicknames,
# channel names, account names, etc.), and how they are normalized for case. # channel names, account names, etc.), and how they are normalized for case.
# with the recommended default of 'precis', utf-8 identifiers that are "sane" # the recommended default is 'ascii' (traditional ASCII-only identifiers).
# (according to RFC 8265) are allowed, and the server additionally tries to protect # the other options are 'precis', which allows UTF8 identifiers that are "sane"
# against confusable characters ("homoglyph attacks"). # (according to UFC 8265), with additional mitigations for homoglyph attacks,
# the other options are 'ascii' (traditional ASCII-only identifiers), and 'permissive', # 'permissive', which allows identifiers containing unusual characters like
# which allows identifiers to contain unusual characters like emoji, but makes users # emoji, at the cost of increased vulnerability to homoglyph attacks and potential
# vulnerable to homoglyph attacks. unless you're really confident in your decision, # client compatibility problems, and the legacy mappings 'rfc1459' and
# we recommend leaving this value at its default (changing it once the network is # 'rfc1459-strict'. we recommend leaving this value at its default;
# already up and running is problematic). # however, note that changing it once the network is already up and running is
# problematic.
casemapping: "precis" casemapping: "precis"
# whether to look up user hostnames with reverse DNS # whether to look up user hostnames with reverse DNS
@@ -109,12 +110,12 @@ server:
check-ident: false check-ident: false
# password to login to the server # password to login to the server
# generated using "oragono genpasswd" # generated using "ergo genpasswd"
#password: "" #password: ""
# motd filename # motd filename
# if you change the motd, you should move it to ircd.motd # if you change the motd, you should move it to ircd.motd
motd: # motd:
# motd formatting codes # motd formatting codes
# if this is true, the motd is escaped using formatting codes like $c, $b, and $i # if this is true, the motd is escaped using formatting codes like $c, $b, and $i
@@ -136,7 +137,7 @@ server:
# (comment this out to use passwords only) # (comment this out to use passwords only)
fingerprint: "abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789" fingerprint: "abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789"
# password the gateway uses to connect, made with oragono genpasswd # password the gateway uses to connect, made with ergo genpasswd
password: "$2a$04$sLEFDpIOyUp55e6gTMKbOeroT6tMXTjPFvA0eGvwvImVR9pkwv7ee" password: "$2a$04$sLEFDpIOyUp55e6gTMKbOeroT6tMXTjPFvA0eGvwvImVR9pkwv7ee"
# addresses/CIDRs that can use this webirc command # addresses/CIDRs that can use this webirc command
@@ -209,42 +210,13 @@ server:
# IP cloaking hides users' IP addresses from other users and from channel admins # IP cloaking hides users' IP addresses from other users and from channel admins
# (but not from server admins), while still allowing channel admins to ban # (but not from server admins), while still allowing channel admins to ban
# offending IP addresses or networks. In place of hostnames derived from reverse # offending IP addresses or networks. In place of hostnames derived from reverse
# DNS, users see fake domain names like pwbs2ui4377257x8.oragono. These names are # DNS, users see fake domain names like pwbs2ui4377257x8.ergo. These names are
# generated deterministically from the underlying IP address, but if the underlying # generated deterministically from the underlying IP address, but if the underlying
# IP is not already known, it is infeasible to recover it from the cloaked name. # IP is not already known, it is infeasible to recover it from the cloaked name.
ip-cloaking: ip-cloaking:
# whether to enable IP cloaking # whether to enable IP cloaking
enabled: false enabled: false
# fake TLD at the end of the hostname, e.g., pwbs2ui4377257x8.oragono
netname: "oragono"
# secret key to prevent dictionary attacks against cloaked IPs
# any high-entropy secret is valid for this purpose:
# you MUST generate a new one for your installation.
# suggestion: use the output of `oragono mksecret`
# note that rotating this key will invalidate all existing ban masks.
secret: "siaELnk6Kaeo65K3RCrwJjlWaZ-Bt3WuZ2L8MXLbNb4"
# name of an environment variable to pull the secret from, for use with
# k8s secret distribution:
# secret-environment-variable: "ORAGONO_CLOAKING_SECRET"
# the cloaked hostname is derived only from the CIDR (most significant bits
# of the IP address), up to a configurable number of bits. this is the
# granularity at which bans will take effect for IPv4. Note that changing
# this value will invalidate any stored bans.
cidr-len-ipv4: 32
# analogous granularity for IPv6
cidr-len-ipv6: 64
# number of bits of hash output to include in the cloaked hostname.
# more bits means less likelihood of distinct IPs colliding,
# at the cost of a longer cloaked hostname. if this value is set to 0,
# all users will receive simply `netname` as their cloaked hostname.
num-bits: 64
# secure-nets identifies IPs and CIDRs which are secure at layer 3, # secure-nets identifies IPs and CIDRs which are secure at layer 3,
# for example, because they are on a trusted internal LAN or a VPN. # for example, because they are on a trusted internal LAN or a VPN.
# plaintext connections from these IPs and CIDRs will be considered # plaintext connections from these IPs and CIDRs will be considered
@@ -272,21 +244,6 @@ accounts:
# length of time a user has to verify their account before it can be re-registered # length of time a user has to verify their account before it can be re-registered
verify-timeout: "32h" verify-timeout: "32h"
# callbacks to allow
enabled-callbacks:
- none # no verification needed, will instantly register successfully
# example configuration for sending verification emails via a local mail relay
# callbacks:
# mailto:
# server: localhost
# port: 25
# tls:
# enabled: false
# username: ""
# password: ""
# sender: "admin@my.network"
# throttle account login attempts (to prevent either password guessing, or DoS # throttle account login attempts (to prevent either password guessing, or DoS
# attacks on the server aimed at forcing repeated expensive bcrypt computations) # attacks on the server aimed at forcing repeated expensive bcrypt computations)
login-throttling: login-throttling:
@@ -343,10 +300,16 @@ accounts:
# rename-timeout - this is how long users have 'til they're renamed # rename-timeout - this is how long users have 'til they're renamed
rename-timeout: 30s rename-timeout: 30s
# rename-prefix - this is the prefix to use when renaming clients (e.g. Guest-AB54U31) # format for guest nicknames:
rename-prefix: Guest- # 1. these nicknames cannot be registered or reserved
# 2. if a client is automatically renamed by the server,
# this is the template that will be used (e.g., Guest-nccj6rgmt97cg)
# 3. if force-guest-format (see below) is enabled, clients without
# a registered account will have this template applied to their
# nicknames (e.g., 'katie' will become 'Guest-katie')
guest-nickname-format: Guest-*
# multiclient controls whether oragono allows multiple connections to # multiclient controls whether ergo allows multiple connections to
# attach to the same client/nickname identity; this is part of the # attach to the same client/nickname identity; this is part of the
# functionality traditionally provided by a bouncer like ZNC # functionality traditionally provided by a bouncer like ZNC
multiclient: multiclient:
@@ -379,27 +342,6 @@ accounts:
# (make sure any changes you make here are RFC-compliant) # (make sure any changes you make here are RFC-compliant)
valid-regexp: '^[0-9A-Za-z.\-_/]+$' valid-regexp: '^[0-9A-Za-z.\-_/]+$'
# options controlling users requesting vhosts:
user-requests:
# can users request vhosts at all? if this is false, operators with the
# 'vhosts' capability can still assign vhosts manually
enabled: false
# if uncommented, all new vhost requests will be dumped into the given
# channel, so opers can review them as they are sent in. ensure that you
# have registered and restricted the channel appropriately before you
# uncomment this.
#channel: "#vhosts"
# after a user's vhost has been approved or rejected, they need to wait
# this long (starting from the time of their original request)
# before they can request a new one.
cooldown: 168h
# vhosts that users can take without approval, using `/HS TAKE`
offer-list:
#- "oragono.test"
# support for deferring password checking to an external LDAP server # support for deferring password checking to an external LDAP server
# you should probably ignore this section! consult the grafana docs for details: # you should probably ignore this section! consult the grafana docs for details:
# https://grafana.com/docs/grafana/latest/auth/ldap/ # https://grafana.com/docs/grafana/latest/auth/ldap/
@@ -466,9 +408,8 @@ oper-classes:
# capability names # capability names
capabilities: capabilities:
- "oper:local_kill" - "kill"
- "oper:local_ban" - "ban"
- "oper:local_unban"
- "nofakelag" - "nofakelag"
# network operator # network operator
@@ -479,12 +420,6 @@ oper-classes:
# oper class this extends from # oper class this extends from
extends: "local-oper" extends: "local-oper"
# capability names
capabilities:
- "oper:remote_kill"
- "oper:remote_ban"
- "oper:remote_unban"
# server admin # server admin
"server-admin": "server-admin":
# title shown in WHOIS # title shown in WHOIS
@@ -495,8 +430,7 @@ oper-classes:
# capability names # capability names
capabilities: capabilities:
- "oper:rehash" - "rehash"
- "oper:die"
- "accreg" - "accreg"
- "sajoin" - "sajoin"
- "samode" - "samode"
@@ -522,7 +456,7 @@ opers:
# operators can be authenticated either by password (with the /OPER command), # operators can be authenticated either by password (with the /OPER command),
# or by certificate fingerprint, or both. if a password hash is set, then a # or by certificate fingerprint, or both. if a password hash is set, then a
# password is required to oper up (e.g., /OPER dan mypassword). to generate # password is required to oper up (e.g., /OPER dan mypassword). to generate
# the hash, use `oragono genpasswd`. # the hash, use `ergo genpasswd`.
password: "$2a$04$LiytCxaY0lI.guDj2pBN4eLRD5cdM2OLDwqmGAgB6M2OPirbF5Jcu" password: "$2a$04$LiytCxaY0lI.guDj2pBN4eLRD5cdM2OLDwqmGAgB6M2OPirbF5Jcu"
# if a SHA-256 certificate fingerprint is configured here, then it will be # if a SHA-256 certificate fingerprint is configured here, then it will be
@@ -576,7 +510,7 @@ logging:
# debug options # debug options
debug: debug:
# when enabled, oragono will attempt to recover from certain kinds of # when enabled, ergo will attempt to recover from certain kinds of
# client-triggered runtime errors that would normally crash the server. # client-triggered runtime errors that would normally crash the server.
# this makes the server more resilient to DoS, but could result in incorrect # this makes the server more resilient to DoS, but could result in incorrect
# behavior. deployments that would prefer to "start from scratch", e.g., by # behavior. deployments that would prefer to "start from scratch", e.g., by
@@ -606,7 +540,7 @@ datastore:
host: "localhost" host: "localhost"
# port is unnecessary for connections via unix domain socket: # port is unnecessary for connections via unix domain socket:
#port: 3306 #port: 3306
user: "oragono" user: "ergo"
password: "hunter2" password: "hunter2"
history-database: "oragono_history" history-database: "oragono_history"
timeout: 3s timeout: 3s
@@ -720,11 +654,6 @@ history:
# (and will eventually be deleted from persistent storage, if that's enabled) # (and will eventually be deleted from persistent storage, if that's enabled)
#expire-time: 1w #expire-time: 1w
# if this is set, logged-in users cannot retrieve messages older than their
# account registration date, and logged-out users cannot retrieve messages
# older than their sign-on time (modulo grace-period, see below):
enforce-registration-date: false
# but if this is set, you can retrieve messages that are up to `grace-period` # but if this is set, you can retrieve messages that are up to `grace-period`
# older than the above cutoff time. this is recommended to allow logged-out # older than the above cutoff time. this is recommended to allow logged-out
# users to do session resumption / query history after disconnections. # users to do session resumption / query history after disconnections.
@@ -14,13 +14,13 @@ scenario = (
sequences.connection("irc.localhost", '{jid_two}/{resource_one}'), sequences.connection("irc.localhost", '{jid_two}/{resource_one}'),
expect_unordered( expect_unordered(
[ [
"/presence[@to='{jid_one}/{resource_one}'][@from='#foo%{irc_server_one}/{nick_two}']/muc_user:x/muc_user:item[@affiliation='none'][@jid='{lower_nick_two}%{irc_server_one}/~{nick_two}@irc.localhost'][@role='participant']" "/presence[@to='{jid_one}/{resource_one}'][@from='#foo%{irc_server_one}/{nick_two}']/muc_user:x/muc_user:item[@affiliation='none'][@jid='{lower_nick_two}%{irc_server_one}/~{nick_two}@{irc_host_one}'][@role='participant']"
], ],
[ [
"/presence[@to='{jid_two}/{resource_one}'][@from='#foo%{irc_server_one}/{nick_one}']/muc_user:x/muc_user:item[@affiliation='admin'][@role='moderator']" "/presence[@to='{jid_two}/{resource_one}'][@from='#foo%{irc_server_one}/{nick_one}']/muc_user:x/muc_user:item[@affiliation='admin'][@role='moderator']"
], ],
[ [
"/presence[@to='{jid_two}/{resource_one}'][@from='#foo%{irc_server_one}/{nick_two}']/muc_user:x/muc_user:item[@affiliation='none'][@jid='{lower_nick_two}%{irc_server_one}/~{nick_two}@irc.localhost'][@role='participant']", "/presence[@to='{jid_two}/{resource_one}'][@from='#foo%{irc_server_one}/{nick_two}']/muc_user:x/muc_user:item[@affiliation='none'][@jid='{lower_nick_two}%{irc_server_one}/~{nick_two}@{irc_host_one}'][@role='participant']",
"/presence/muc_user:x/muc_user:status[@code='110']" "/presence/muc_user:x/muc_user:status[@code='110']"
], ],
[ [
@@ -11,7 +11,7 @@ scenario = (
send_stanza("<presence from='{jid_one}/{resource_one}' to='#foo%{irc_server_one}/{nick_three}'><x xmlns='http://jabber.org/protocol/muc'/></presence>"), send_stanza("<presence from='{jid_one}/{resource_one}' to='#foo%{irc_server_one}/{nick_three}'><x xmlns='http://jabber.org/protocol/muc'/></presence>"),
expect_unordered( expect_unordered(
[ [
"/presence[@to='{jid_one}/{resource_one}'][@from='#foo%{irc_server_one}/{nick_two}']/muc_user:x/muc_user:item[@affiliation='none'][@role='participant'][@jid='{lower_nick_two}%{irc_server_one}/~{nick_two}@irc.localhost']" "/presence[@to='{jid_one}/{resource_one}'][@from='#foo%{irc_server_one}/{nick_two}']/muc_user:x/muc_user:item[@affiliation='none'][@role='participant'][@jid='{lower_nick_two}%{irc_server_one}/~{nick_two}@{irc_host_one}']"
], ],
[ [
"/presence[@to='{jid_one}/{resource_one}'][@from='#foo%{irc_server_one}/{nick_one}']/muc_user:x/muc_user:item[@affiliation='admin'][@role='moderator']", "/presence[@to='{jid_one}/{resource_one}'][@from='#foo%{irc_server_one}/{nick_one}']/muc_user:x/muc_user:item[@affiliation='admin'][@role='moderator']",
@@ -9,7 +9,7 @@ scenario = (
# Second user joins # Second user joins
send_stanza("<presence from='{jid_one}/{resource_two}' to='#foo%{irc_server_one}/{nick_one}' ><x xmlns='http://jabber.org/protocol/muc'/></presence>"), send_stanza("<presence from='{jid_one}/{resource_two}' to='#foo%{irc_server_one}/{nick_one}' ><x xmlns='http://jabber.org/protocol/muc'/></presence>"),
expect_stanza("/presence[@to='{jid_one}/{resource_two}'][@from='#foo%{irc_server_one}/{nick_one}']/muc_user:x/muc_user:item[@affiliation='admin'][@jid='{lower_nick_one}%{irc_server_one}/~{nick_one}@irc.localhost'][@role='moderator']", expect_stanza("/presence[@to='{jid_one}/{resource_two}'][@from='#foo%{irc_server_one}/{nick_one}']/muc_user:x/muc_user:item[@affiliation='admin'][@jid='{lower_nick_one}%{irc_server_one}/~{nick_one}@{irc_host_one}'][@role='moderator']",
"/presence/muc_user:x/muc_user:status[@code='110']"), "/presence/muc_user:x/muc_user:status[@code='110']"),
# Receive the history message # Receive the history message
expect_stanza("/message[@from='#foo%{irc_server_one}/{nick_one}']/body[text()='coucou']", expect_stanza("/message[@from='#foo%{irc_server_one}/{nick_one}']/body[text()='coucou']",
@@ -11,7 +11,7 @@ scenario = (
# Second user joins # Second user joins
send_stanza("<presence from='{jid_one}/{resource_two}' to='#foo@{biboumi_host}/{nick_one}' ><x xmlns='http://jabber.org/protocol/muc'/></presence>"), send_stanza("<presence from='{jid_one}/{resource_two}' to='#foo@{biboumi_host}/{nick_one}' ><x xmlns='http://jabber.org/protocol/muc'/></presence>"),
expect_stanza("/presence[@to='{jid_one}/{resource_two}'][@from='#foo@{biboumi_host}/{nick_one}']/muc_user:x/muc_user:item[@affiliation='admin'][@jid='{lower_nick_one}@{biboumi_host}/~{nick_one}@irc.localhost'][@role='moderator']", expect_stanza("/presence[@to='{jid_one}/{resource_two}'][@from='#foo@{biboumi_host}/{nick_one}']/muc_user:x/muc_user:item[@affiliation='admin'][@jid='{lower_nick_one}@{biboumi_host}/~{nick_one}@{irc_host_one}'][@role='moderator']",
"/presence/muc_user:x/muc_user:status[@code='110']"), "/presence/muc_user:x/muc_user:status[@code='110']"),
# Receive the history message # Receive the history message
expect_stanza("/message[@from='#foo@{biboumi_host}/{nick_one}']/body[text()='coucou']", expect_stanza("/message[@from='#foo@{biboumi_host}/{nick_one}']/body[text()='coucou']",
@@ -19,13 +19,13 @@ scenario = (
send_stanza("<presence from='{jid_two}/{resource_one}' to='#foo%{irc_server_one}/{nick_two}'> <x xmlns='http://jabber.org/protocol/muc'><password>SECRET</password></x></presence>"), send_stanza("<presence from='{jid_two}/{resource_one}' to='#foo%{irc_server_one}/{nick_two}'> <x xmlns='http://jabber.org/protocol/muc'><password>SECRET</password></x></presence>"),
expect_unordered( expect_unordered(
[ [
"/presence[@to='{jid_one}/{resource_one}'][@from='#foo%{irc_server_one}/{nick_two}']/muc_user:x/muc_user:item[@affiliation='none'][@role='participant'][@jid='{lower_nick_two}%{irc_server_one}/~{nick_two}@irc.localhost']" "/presence[@to='{jid_one}/{resource_one}'][@from='#foo%{irc_server_one}/{nick_two}']/muc_user:x/muc_user:item[@affiliation='none'][@role='participant'][@jid='{lower_nick_two}%{irc_server_one}/~{nick_two}@{irc_host_one}']"
], ],
[ [
"/presence[@to='{jid_two}/{resource_one}'][@from='#foo%{irc_server_one}/{nick_one}']/muc_user:x/muc_user:item[@affiliation='admin'][@role='moderator']" "/presence[@to='{jid_two}/{resource_one}'][@from='#foo%{irc_server_one}/{nick_one}']/muc_user:x/muc_user:item[@affiliation='admin'][@role='moderator']"
], ],
[ [
"/presence[@to='{jid_two}/{resource_one}'][@from='#foo%{irc_server_one}/{nick_two}']/muc_user:x/muc_user:item[@affiliation='none'][@jid='{lower_nick_two}%{irc_server_one}/~{nick_two}@irc.localhost'][@role='participant']", "/presence[@to='{jid_two}/{resource_one}'][@from='#foo%{irc_server_one}/{nick_two}']/muc_user:x/muc_user:item[@affiliation='none'][@jid='{lower_nick_two}%{irc_server_one}/~{nick_two}@{irc_host_one}'][@role='participant']",
"/presence/muc_user:x/muc_user:status[@code='110']" "/presence/muc_user:x/muc_user:status[@code='110']"
], ],
[ [
@@ -8,13 +8,13 @@ scenario = (
sequences.connection("irc.localhost", '{jid_two}/{resource_one}'), sequences.connection("irc.localhost", '{jid_two}/{resource_one}'),
expect_unordered( expect_unordered(
[ [
"/presence[@to='{jid_one}/{resource_one}'][@from='#foo%{irc_server_one}/{nick_two}']/muc_user:x/muc_user:item[@affiliation='none'][@role='participant'][@jid='{lower_nick_two}%{irc_server_one}/~{nick_two}@irc.localhost']" "/presence[@to='{jid_one}/{resource_one}'][@from='#foo%{irc_server_one}/{nick_two}']/muc_user:x/muc_user:item[@affiliation='none'][@role='participant'][@jid='{lower_nick_two}%{irc_server_one}/~{nick_two}@{irc_host_one}']"
], ],
[ [
"/presence[@to='{jid_two}/{resource_one}'][@from='#foo%{irc_server_one}/{nick_one}']/muc_user:x/muc_user:item[@affiliation='admin'][@role='moderator']" "/presence[@to='{jid_two}/{resource_one}'][@from='#foo%{irc_server_one}/{nick_one}']/muc_user:x/muc_user:item[@affiliation='admin'][@role='moderator']"
], ],
[ [
"/presence[@to='{jid_two}/{resource_one}'][@from='#foo%{irc_server_one}/{nick_two}']/muc_user:x/muc_user:item[@affiliation='none'][@jid='{lower_nick_two}%{irc_server_one}/~{nick_two}@irc.localhost'][@role='participant']", "/presence[@to='{jid_two}/{resource_one}'][@from='#foo%{irc_server_one}/{nick_two}']/muc_user:x/muc_user:item[@affiliation='none'][@jid='{lower_nick_two}%{irc_server_one}/~{nick_two}@{irc_host_one}'][@role='participant']",
"/presence/muc_user:x/muc_user:status[@code='110']" "/presence/muc_user:x/muc_user:status[@code='110']"
], ],
[ [
@@ -11,10 +11,10 @@ scenario = (
# Our presence, sent to the other user, and ourself # Our presence, sent to the other user, and ourself
expect_unordered( expect_unordered(
["/presence[@to='{jid_one}/{resource_one}'][@from='#foo%{irc_server_one}/{nick_two}']/muc_user:x/muc_user:item[@affiliation='none'][@jid='{lower_nick_two}%{irc_server_one}/~{nick_two}@irc.localhost'][@role='participant']"], ["/presence[@to='{jid_one}/{resource_one}'][@from='#foo%{irc_server_one}/{nick_two}']/muc_user:x/muc_user:item[@affiliation='none'][@jid='{lower_nick_two}%{irc_server_one}/~{nick_two}@{irc_host_one}'][@role='participant']"],
["/presence[@to='{jid_two}/{resource_one}'][@from='#foo%{irc_server_one}/{nick_one}']/muc_user:x/muc_user:item[@affiliation='admin'][@role='moderator']"], ["/presence[@to='{jid_two}/{resource_one}'][@from='#foo%{irc_server_one}/{nick_one}']/muc_user:x/muc_user:item[@affiliation='admin'][@role='moderator']"],
[ [
"/presence[@to='{jid_two}/{resource_one}'][@from='#foo%{irc_server_one}/{nick_two}']/muc_user:x/muc_user:item[@affiliation='none'][@jid='{lower_nick_two}%{irc_server_one}/~{nick_two}@irc.localhost'][@role='participant']", "/presence[@to='{jid_two}/{resource_one}'][@from='#foo%{irc_server_one}/{nick_two}']/muc_user:x/muc_user:item[@affiliation='none'][@jid='{lower_nick_two}%{irc_server_one}/~{nick_two}@{irc_host_one}'][@role='participant']",
"/presence/muc_user:x/muc_user:status[@code='110']" "/presence/muc_user:x/muc_user:status[@code='110']"
], ],
["/message[@from='#foo%{irc_server_one}'][@type='groupchat']/subject[not(text())]"], ["/message[@from='#foo%{irc_server_one}'][@type='groupchat']/subject[not(text())]"],
@@ -38,10 +38,10 @@ scenario = (
sequences.connection("irc.localhost", '{jid_two}/{resource_one}'), sequences.connection("irc.localhost", '{jid_two}/{resource_one}'),
# Our presence, sent to the other user # Our presence, sent to the other user
expect_unordered( expect_unordered(
["/presence[@to='{jid_one}/{resource_one}'][@from='#foo%{irc_server_one}/{nick_two}']/muc_user:x/muc_user:item[@affiliation='none'][@jid='{lower_nick_two}%{irc_server_one}/~{nick_two}@irc.localhost'][@role='participant']"], ["/presence[@to='{jid_one}/{resource_one}'][@from='#foo%{irc_server_one}/{nick_two}']/muc_user:x/muc_user:item[@affiliation='none'][@jid='{lower_nick_two}%{irc_server_one}/~{nick_two}@{irc_host_one}'][@role='participant']"],
["/presence[@to='{jid_two}/{resource_one}'][@from='#foo%{irc_server_one}/{nick_one}']/muc_user:x/muc_user:item[@affiliation='admin'][@role='moderator']"], ["/presence[@to='{jid_two}/{resource_one}'][@from='#foo%{irc_server_one}/{nick_one}']/muc_user:x/muc_user:item[@affiliation='admin'][@role='moderator']"],
[ [
"/presence[@to='{jid_two}/{resource_one}'][@from='#foo%{irc_server_one}/{nick_two}']/muc_user:x/muc_user:item[@affiliation='none'][@jid='{lower_nick_two}%{irc_server_one}/~{nick_two}@irc.localhost'][@role='participant']", "/presence[@to='{jid_two}/{resource_one}'][@from='#foo%{irc_server_one}/{nick_two}']/muc_user:x/muc_user:item[@affiliation='none'][@jid='{lower_nick_two}%{irc_server_one}/~{nick_two}@{irc_host_one}'][@role='participant']",
"/presence/muc_user:x/muc_user:status[@code='110']" "/presence/muc_user:x/muc_user:status[@code='110']"
], ],
["/message[@from='#foo%{irc_server_one}'][@type='groupchat']/subject[not(text())]"] ["/message[@from='#foo%{irc_server_one}'][@type='groupchat']/subject[not(text())]"]
+1 -1
View File
@@ -7,5 +7,5 @@ scenario = (
expect_stanza("/message"), expect_stanza("/message"),
send_stanza("<message from='{jid_one}/{resource_one}' to='{irc_server_one}' type='chat'><body>WHOIS {nick_one}</body></message>"), send_stanza("<message from='{jid_one}/{resource_one}' to='{irc_server_one}' type='chat'><body>WHOIS {nick_one}</body></message>"),
expect_stanza("/message[@from='{irc_server_one}'][@type='chat']/body[text()='irc.localhost: {nick_one} ~{nick_one} irc.localhost * {nick_one}']"), expect_stanza("/message[@from='{irc_server_one}'][@type='chat']/body[text()='{irc_host_one}: {nick_one} ~{nick_one} {irc_host_one} * {nick_one}']"),
) )
@@ -9,6 +9,6 @@ scenario = (
expect_stanza("/message"), expect_stanza("/message"),
send_stanza("<message from='{jid_one}/{resource_one}' to='{biboumi_host}' type='chat'><body>WHOIS {nick_one}</body></message>"), send_stanza("<message from='{jid_one}/{resource_one}' to='{biboumi_host}' type='chat'><body>WHOIS {nick_one}</body></message>"),
expect_stanza("/message[@from='{biboumi_host}'][@type='chat']/body[text()='irc.localhost: {nick_one} ~{nick_one} irc.localhost * {nick_one}']"), expect_stanza("/message[@from='{biboumi_host}'][@type='chat']/body[text()='{irc_host_one}: {nick_one} ~{nick_one} {irc_host_one} * {nick_one}']"),
) )
+3 -1
View File
@@ -86,7 +86,9 @@ scenario = (
expect_stanza("/iq[@type='result']/commands:command[@node='configure'][@status='completed']/commands:note[@type='info'][text()='Configuration successfully applied.']"), expect_stanza("/iq[@type='result']/commands:command[@node='configure'][@status='completed']/commands:note[@type='info'][text()='Configuration successfully applied.']"),
send_stanza("<presence from='{jid_one}/{resource_one}' to='#foo%{irc_server_one}/ignored' ><x xmlns='http://jabber.org/protocol/muc'/></presence>"), send_stanza("<presence from='{jid_one}/{resource_one}' to='#foo%{irc_server_one}/ignored' ><x xmlns='http://jabber.org/protocol/muc'/></presence>"),
# Here, the 6 connecting… connected messages from the connection attempt # Here, the 8 connecting… connected messages from the connection attempt
expect_stanza("/message"),
expect_stanza("/message"),
expect_stanza("/message"), expect_stanza("/message"),
expect_stanza("/message"), expect_stanza("/message"),
expect_stanza("/message"), expect_stanza("/message"),
+8 -6
View File
@@ -26,12 +26,14 @@ def connection_begin(irc_host, jid, expected_irc_presence=False, fixed_irc_serve
if expected_irc_presence: if expected_irc_presence:
result += (expect_stanza("/presence[@from='" + irc_host + "@biboumi.localhost']"),) result += (expect_stanza("/presence[@from='" + irc_host + "@biboumi.localhost']"),)
if login is not None:
result += (expect_stanza("/message/body[text()='irc.localhost: You are now logged in as %s']" % (login,)),)
result += ( result += (
expect_stanza("/message/body[text()='irc.localhost: *** Looking up your hostname...']"), expect_stanza("/message/body[text()='irc.localhost: *** Looking up your hostname...']"),
expect_stanza("/message/body[text()='irc.localhost: *** Found your hostname']") expect_stanza("/message/body[text()='irc.localhost: *** Found your hostname']")
) )
if login is not None:
result += (expect_stanza("/message/body[text()='irc.localhost: You are now logged in as %s']" % (login,)),)
return result return result
def connection_tls_begin(irc_host, jid, fixed_irc_server): def connection_tls_begin(irc_host, jid, fixed_irc_server):
@@ -61,12 +63,12 @@ def connection_end(irc_host, jid, fixed_irc_server=False):
xpath_re = "/message[@to='" + jid + "'][@from='" + irc_host + "@biboumi.localhost']/body[re:test(text(), '%s')]" xpath_re = "/message[@to='" + jid + "'][@from='" + irc_host + "@biboumi.localhost']/body[re:test(text(), '%s')]"
irc_host = 'irc.localhost' irc_host = 'irc.localhost'
return ( return (
expect_stanza("/message/body[re:test(text(), '%s')]" % (r'^%s: Your host is %s, running version oragono-2\.0\.0(-[a-z0-9]+)? $' % (irc_host, irc_host))), expect_stanza("/message/body[re:test(text(), '%s')]" % (r'^%s: Your host is %s, running version ergo-2\.\d+\.\d+(-[a-z0-9]+)? $' % (irc_host, irc_host))),
expect_stanza(xpath_re % (r'^%s: This server was created .*$' % irc_host)), expect_stanza(xpath_re % (r'^%s: This server was created .*$' % irc_host)),
expect_stanza(xpath_re % (r'^%s: There are \d+ users and \d+ invisible on \d+ server\(s\)$' % irc_host)), expect_stanza(xpath_re % (r'^%s: There are \d+ users and \d+ invisible on \d+ server\(s\)$' % irc_host)),
expect_stanza(xpath_re % ("%s: \d+ IRC Operators online" % irc_host,)), expect_stanza(xpath_re % ("%s: \\d+ IRC Operators online" % irc_host,)),
expect_stanza(xpath_re % ("%s: \d+ unregistered connections" % irc_host,)), expect_stanza(xpath_re % ("%s: \\d+ unregistered connections" % irc_host,)),
expect_stanza(xpath_re % ("%s: \d+ channels formed" % irc_host,)), expect_stanza(xpath_re % ("%s: \\d+ channels formed" % irc_host,)),
expect_stanza(xpath_re % (r'^%s: I have \d+ clients and \d+ servers$' % irc_host)), expect_stanza(xpath_re % (r'^%s: I have \d+ clients and \d+ servers$' % irc_host)),
expect_stanza(xpath_re % (r'^%s: \d+ \d+ Current local users \d+, max \d+$' % irc_host)), expect_stanza(xpath_re % (r'^%s: \d+ \d+ Current local users \d+, max \d+$' % irc_host)),
expect_stanza(xpath_re % (r'^%s: \d+ \d+ Current global users \d+, max \d+$' % irc_host)), expect_stanza(xpath_re % (r'^%s: \d+ \d+ Current global users \d+, max \d+$' % irc_host)),