Skip to content

New tests, autoconf CI, wocky bump #22

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 30 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
syntax_check:
runs-on: ubuntu-latest
container:
image: registry.freedesktop.org/telepathy/telepathy-gabble/debstbl:v1
image: registry.freedesktop.org/telepathy/telepathy-gabble/debstbl:v2
options: -u 0:0
timeout-minutes: 5
steps:
Expand All @@ -25,9 +25,9 @@ jobs:
strategy:
matrix:
image:
- registry.freedesktop.org/telepathy/telepathy-gabble/debstbl:v1
- registry.freedesktop.org/telepathy/telepathy-gabble/osuselp:v1
- registry.freedesktop.org/telepathy/telepathy-gabble/fedoraw:v1
- registry.freedesktop.org/telepathy/telepathy-gabble/debstbl:v2
- registry.freedesktop.org/telepathy/telepathy-gabble/osuselp:v2
- registry.freedesktop.org/telepathy/telepathy-gabble/fedoraw:v2
container:
image: ${{ matrix.image }}
options: -u 0:0
Expand All @@ -50,3 +50,29 @@ jobs:
_b/meson-logs/*
_b/tests/twisted/tools/gabble-testing.log
if: ${{ always() }}

autobuild:
runs-on: ubuntu-18.04
timeout-minutes: 10
steps:
- uses: actions/checkout@v2
- name: Install prereqs
run: |-
sudo apt-get update && sudo apt-get install --no-install-recommends -qq -y build-essential \
ccache automake libtool libglib2.0-dev glib-networking libtelepathy-glib-dev libsasl2-dev \
libxml2-dev libsoup2.4-dev libsasl2-modules-gssapi-mit gnutls-bin libsqlite3-dev xsltproc \
libssl-dev libgnutls28-dev libnice-dev python3-twisted python3-dbus
- name: Bootstrap and Config
run: bash autogen.sh
- name: Build
run: make
- name: Test
run: make check
- name: Artifacts
uses: actions/upload-artifact@v2
with:
name: automake-logs
path: |
tests/twisted/tools/gabble-testing.log
FIXME.out
if: ${{ always() }}
47 changes: 43 additions & 4 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ stages:
- test

variables:
FEDORA_MB: registry.freedesktop.org/telepathy/telepathy-gabble/fedoraw:v1
DEBIAN_MB: registry.freedesktop.org/telepathy/telepathy-gabble/debtest:v1
DEBSTB_MB: registry.freedesktop.org/telepathy/telepathy-gabble/debstbl:v1
SUSELP_MB: registry.freedesktop.org/telepathy/telepathy-gabble/osuselp:v1
FEDORA_MB: registry.freedesktop.org/telepathy/telepathy-gabble/fedoraw:v2
DEBIAN_MB: registry.freedesktop.org/telepathy/telepathy-gabble/debtest:v2
DEBSTB_MB: registry.freedesktop.org/telepathy/telepathy-gabble/debstbl:v2
SUSELP_MB: registry.freedesktop.org/telepathy/telepathy-gabble/osuselp:v2
# OpenSUSE Tumbleweed has broken Twisted, can still be used in wocky CI
SUSETW_MB: registry.freedesktop.org/telepathy/telepathy-gabble/osusetw:v1
WOCKY_DEBUG: all
#G_MESSAGES_DEBUG: all
Expand All @@ -19,6 +20,21 @@ variables:
key: "$CI_JOB_IMAGE:$CI_COMMIT_SHA"
paths: [ _b ]

.def_ac:
before_script:
- sh autogen.sh
cache:
key: "AC:$CI_JOB_IMAGE:$CI_COMMIT_SHA"
paths:
- src/.libs
- plugins/.libs
- extensions/_gen
- extensions/.libs
- lib/gibber/.libs
- lib/ext/wocky/wocky/.libs
- tests/.libs
- tests/twisted/.libs

style-ck-mb:
extends: .def_mb
stage: style-check
Expand Down Expand Up @@ -63,3 +79,26 @@ test-mb:
- $DEBSTB_MB
- $SUSELP_MB

test-ac:
extends: .def_ac
stage: test
image: $image
script:
- make
- make check
artifacts:
reports:
expire_in: 1 week
when: always
paths:
- "FIXME.out"
- "tests/twisted/tools/gabble-testing.log"
parallel:
matrix:
- image:
- $FEDORA_MB
- $DEBIAN_MB
#- $SUSETW_MB
- $DEBSTB_MB
- $SUSELP_MB

21 changes: 21 additions & 0 deletions .gitlab-ci/Dockerfile.gabble-debstbl
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
FROM debian:stable

ENV TZ=UTC
ENV DEBIAN_FRONTEND=noninteractive

RUN apt update -qy \
&& apt install -qy meson git libglib2.0-dev glib-networking \
libtelepathy-glib-dev libxml2-dev xsltproc libnice-dev \
python3-twisted libsasl2-dev gcc ccache libsqlite3-dev \
python3-dbus autoconf gnutls-bin libtool-bin make \
&& apt-get clean -qy


ARG HOST_USER_ID=1000
ENV HOST_USER_ID ${HOST_USER_ID}
RUN useradd -u $HOST_USER_ID -ms /bin/bash user && usermod user -G user

USER user
WORKDIR /home/user

ENV LANG C.UTF-8
21 changes: 21 additions & 0 deletions .gitlab-ci/Dockerfile.gabble-debtest
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
FROM debian:testing

ENV TZ=UTC
ENV DEBIAN_FRONTEND=noninteractive

RUN apt update -qy \
&& apt install -qy meson git libglib2.0-dev glib-networking \
libtelepathy-glib-dev libxml2-dev xsltproc libnice-dev \
python3-twisted libsasl2-dev gcc ccache libsqlite3-dev \
python3-dbus autoconf gnutls-bin libtool-bin make \
&& apt-get clean -qy


ARG HOST_USER_ID=1000
ENV HOST_USER_ID ${HOST_USER_ID}
RUN useradd -u $HOST_USER_ID -ms /bin/bash user && usermod user -G user

USER user
WORKDIR /home/user

ENV LANG C.UTF-8
24 changes: 24 additions & 0 deletions .gitlab-ci/Dockerfile.gabble-fedoraw
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
FROM fedora:rawhide

RUN dnf update -y \
&& dnf install -y 'dnf-command(builddep)' \
&& dnf builddep -y glib-networking telepathy-gabble \
&& dnf clean all
RUN dnf install -y git meson python3-twisted python3-gobject dbus-daemon \
cyrus-sasl-scram cyrus-sasl-md5 cyrus-sasl-plain gnutls-utils \
&& dnf clean all

# Debug the docker if required
#RUN dnf install -y valgrind gdb \
# && dnf debuginfo-install -y cyrus-sasl cyrus-sasl-scram \
# glib glib-networking openssl gnutls

ARG HOST_USER_ID=1000
ENV HOST_USER_ID ${HOST_USER_ID}
RUN useradd -u $HOST_USER_ID -ms /bin/bash user
RUN ln -fs /usr/bin/python3 /usr/local/bin/python

USER user
WORKDIR /home/user

ENV LANG C.UTF-8
29 changes: 29 additions & 0 deletions .gitlab-ci/Dockerfile.gabble-osuselp
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
FROM opensuse/leap:latest

RUN zypper -q update -y \
&& zypper -q install -y -t pattern devel_basis \
&& zypper -q install -y ccache glib2-devel glib-networking \
&& zypper -q clean

RUN zypper -q install -y telepathy-glib-devel telepathy-gabble \
meson python3-Twisted python3-dbus-python git \
libxslt-tools libnice-devel dbus-1-glib-devel \
libxml2-devel libsoup-devel sqlite3-devel \
cyrus-sasl-digestmd5 cyrus-sasl-plain gnutls \
cyrus-sasl-devel cyrus-sasl-scram \
&& zypper -q clean

# Debug the docker if required
#RUN zypper install -y valgrind gdb git vim

ARG HOST_USER_ID=1000
ENV HOST_USER_ID ${HOST_USER_ID}
RUN useradd -u $HOST_USER_ID -ms /bin/bash user
RUN ln -fs /usr/bin/python3 /usr/local/bin/python
RUN dbus-uuidgen --ensure

USER user
WORKDIR /home/user

ENV LANG C.UTF-8

3 changes: 2 additions & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ if test "$with_ca_certificates" = "no"; then
else
if test -z "$with_ca_certificates"; then
for f in /etc/pki/tls/certs/ca-bundle.crt \
/etc/ssl/ca-bundle.pem \
/etc/ssl/certs/ca-certificates.crt; do
if test -f "$f"; then
with_ca_certificates="$f"
Expand Down Expand Up @@ -293,7 +294,7 @@ if test -z "$XSLTPROC"; then
AC_MSG_ERROR([xsltproc (from the libxslt source package) is required])
fi

AM_PATH_PYTHON([2.5])
AM_PATH_PYTHON([3.6])

# Check for a Python >= 2.5 with Twisted, to run the tests
AC_MSG_CHECKING([for Python with Twisted and XMPP protocol support])
Expand Down
2 changes: 1 addition & 1 deletion lib/ext/wocky
Submodule wocky updated 113 files
17 changes: 17 additions & 0 deletions src/im-factory.c
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,23 @@ im_factory_message_cb (
gboolean create_if_missing;
gboolean sent;

/* CVE-2017-5589+ verification */
if (wocky_node_get_child_ns (wocky_stanza_get_top_node (message), "received", NS_CARBONS)
|| wocky_node_get_child_ns (wocky_stanza_get_top_node (message), "sent", NS_CARBONS))
{
if ((from = wocky_stanza_get_from (message)) != NULL)
{
TpBaseConnection *conn = TP_BASE_CONNECTION (fac->priv->conn);
TpHandleRepoIface *handles = tp_base_connection_get_handles (conn,
TP_HANDLE_TYPE_CONTACT);
TpHandle from_handle = tp_handle_ensure (handles, from, NULL, NULL);
TpHandle self_handle = tp_base_connection_get_self_handle (conn);

if (from_handle != self_handle)
return FALSE;
}
}

if (!gabble_message_util_parse_incoming_message (message, &from, &to, &stamp,
&msgtype, &id, &body, &state, &send_error, &delivery_status, &delivery_token, &sent))
return TRUE;
Expand Down
17 changes: 17 additions & 0 deletions src/muc-factory.c
Original file line number Diff line number Diff line change
Expand Up @@ -782,6 +782,23 @@ muc_factory_message_cb (
TpDeliveryStatus delivery_status;
gboolean sent;

/* CVE-2017-5589+ verification */
if (wocky_node_get_child_ns (wocky_stanza_get_top_node (message), "received", NS_CARBONS)
|| wocky_node_get_child_ns (wocky_stanza_get_top_node (message), "sent", NS_CARBONS))
{
if ((from = wocky_stanza_get_from (message)) != NULL)
{
TpBaseConnection *conn = TP_BASE_CONNECTION (priv->conn);
TpHandleRepoIface *handles = tp_base_connection_get_handles (conn,
TP_HANDLE_TYPE_CONTACT);
TpHandle from_handle = tp_handle_ensure (handles, from, NULL, NULL);
TpHandle self_handle = tp_base_connection_get_self_handle (conn);

if (from_handle != self_handle)
return FALSE;
}
}

/* FIXME: handle sent? */
if (!gabble_message_util_parse_incoming_message (message, &from, &to, &stamp,
&msgtype, &id, &body, &state, &send_error, &delivery_status, &delivery_token, &sent))
Expand Down
4 changes: 4 additions & 0 deletions tests/twisted/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ TWISTED_TESTS = \
roster/test-roster.py \
roster/test-roster-subscribe.py \
roster/test-save-alias-to-roster.py \
roster/test-roster-cache.py \
sasl/abort.py \
sasl/close.py \
sasl/complex.py \
Expand All @@ -111,13 +112,15 @@ TWISTED_TESTS = \
text/initiate.py \
text/initiate-requestotron.py \
text/receipts.py \
text/markers.py \
text/respawn.py \
text/send-error.py \
text/send-to-correct-resource.py \
text/test-chat-state.py \
text/test-text-delayed.py \
text/test-text-no-body.py \
text/test-text.py \
text/test-carbons.py \
tls/legacy-jabber.py \
tls/server-tls-channel.py \
version.py \
Expand Down Expand Up @@ -163,6 +166,7 @@ TWISTED_VCARD_TESTS = \
vcard/test-avatar.py \
vcard/test-avatar-retrieved.py \
vcard/test-avatar-tokens.py \
vcard/test-avatar-pep.py \
vcard/test-save-alias-to-vcard.py \
vcard/test-set-alias.py \
vcard/test-vcard-cache.py \
Expand Down
Loading