Commit 18f890d4 authored by Thomas Haller's avatar Thomas Haller

build,tests: merge branch 'th/fix-python-test'

!287
parents 85bdf421 b40a3aa7
Pipeline #66396 canceled with stages
......@@ -16,7 +16,7 @@ stages:
- date '+%Y%m%d-%H%M%S'; ! grep -q '^NAME=.*\(CentOS\)' /etc/os-release || (yum install -y glibc-common && localedef -c -i pl_PL -f UTF-8 pl_PL.UTF-8 && locale -a)
- date '+%Y%m%d-%H%M%S'; NM_INSTALL="yum install -y" ./contrib/fedora/REQUIRED_PACKAGES
- date '+%Y%m%d-%H%M%S'; NM_NO_EXTRA=1 NM_INSTALL="yum install -y" ./contrib/fedora/REQUIRED_PACKAGES
- date '+%Y%m%d-%H%M%S'; yum install -y glibc-langpack-pl ccache clang which
# containers have "tsflags=nodocs" in /etc/dnf/dnf.conf. We need /usr/shared/gtk-doc/html
......@@ -84,6 +84,7 @@ t_fedora:28:
<<: *fedora_install
image: fedora:28
<<: *do_build
when: manual
t_fedora:29:
<<: *fedora_install
......@@ -103,6 +104,11 @@ t_fedora:30:
image: fedora:30
<<: *do_build
t_fedora:31:
<<: *fedora_install
image: fedora:31
<<: *do_build
t_fedora:rawhide:
<<: *fedora_install
image: fedora:rawhide
......
......@@ -566,10 +566,10 @@ class TestNmcli(NmTestBase):
if lang is None or lang == 'C':
lang = 'C'
language = ''
elif lang is 'de':
elif lang == 'de':
lang = 'de_DE.utf8'
language = 'de'
elif lang is 'pl':
elif lang == 'pl':
lang = 'pl_PL.UTF-8'
language = 'pl'
else:
......@@ -764,7 +764,7 @@ class TestNmcli(NmTestBase):
self.fail("Unexpected output of command, expected %s. Rerun test with NM_TEST_REGENERATE=1 to regenerate files" % (filename))
if regenerate:
content_new = ''.join([r['content'] for r in results])
content_new = b''.join([r['content'] for r in results])
if content_new != content_expect:
try:
with open(filename, 'wb') as content_file:
......
......@@ -10,24 +10,40 @@
# Not all of these packages are strictly speaking necessary.
# This is a generous list of related packages.
set -xe
DNF="$(which dnf &>/dev/null && echo dnf || echo yum)"
install() {
if [ "$NM_INSTALL" != "" ]; then
$NM_INSTALL "$@"
else
sudo "$(which dnf &>/dev/null && echo dnf || echo yum)" install -y "$@"
sudo "$DNF" install -y "$@"
fi
}
install_ignore_missing() {
for p; do
install "$p" || :
done
}
if test "$NM_NO_EXTRA" != 1; then
# these packages are convenient for developing, but not necessary
# for CI testing.
EXTRA_PACKAGES=(
bash-completion \
cscope \
)
else
EXTRA_PACKAGES=()
fi
install \
\
ModemManager-devel \
ModemManager-glib-devel \
mobile-broadband-provider-info-devel \
audit-libs-devel \
bash-completion \
bluez-libs-devel \
bzip2 \
cscope \
dbus-devel \
dbus-python \
dbus-x11 \
......@@ -50,13 +66,13 @@ install \
libuuid-devel \
make \
meson \
mobile-broadband-provider-info-devel \
newt-devel \
nss-devel \
polkit-devel \
ppp \
ppp-devel \
pygobject3-base \
python-gobject-base \
python3-dbus \
python3-gobject \
qt-devel \
......@@ -67,6 +83,9 @@ install \
vala-devel \
vala-tools \
valgrind \
wireless-tools-devel \
\
"${EXTRA_PACKAGES[@]}"
# some packages don't exist in certain distributions. Install them one-by-one, and ignore errors.
install_ignore_missing \
python-gobject-base \
#end
......@@ -7,8 +7,6 @@
# Note that it contains __PLACEHOLDERS__ that will be replaced by the accompanying 'build.sh' script.
%global wireless_tools_version 1:28-0pre9
%global wpa_supplicant_version 1:1.1
%global ppp_version %(sed -n 's/^#define\\s*VERSION\\s*"\\([^\\s]*\\)"$/\\1/p' %{_includedir}/pppd/patchlevel.h 2>/dev/null | grep . || echo bad)
......@@ -183,9 +181,6 @@ BuildRequires: intltool
BuildRequires: gettext-devel
BuildRequires: dbus-devel >= %{dbus_version}
%if 0%{?fedora}
BuildRequires: wireless-tools-devel >= %{wireless_tools_version}
%endif
BuildRequires: glib2-devel >= 2.40.0
BuildRequires: gobject-introspection-devel >= 0.10.3
%if %{with ppp}
......
......@@ -280,7 +280,7 @@ if enable_introspection
name,
input: libnm_gir[0],
output: name,
command: [generate_setting_docs_env, generate_setting_docs, '--lib-path', meson.current_build_dir(), '--gir', '@INPUT@', '--output', '@OUTPUT@'],
command: [generate_setting_docs_env, python.path(), generate_setting_docs, '--lib-path', meson.current_build_dir(), '--gir', '@INPUT@', '--output', '@OUTPUT@'],
depends: libnm_gir,
)
......@@ -289,7 +289,7 @@ if enable_introspection
name,
input: libnm_gir[0],
output: name,
command: [generate_setting_docs_env, generate_setting_docs, '--lib-path', meson.current_build_dir(), '--gir', '@INPUT@', '--overrides', nm_settings_docs_overrides, '--output', '@OUTPUT@'],
command: [generate_setting_docs_env, python.path(), generate_setting_docs, '--lib-path', meson.current_build_dir(), '--gir', '@INPUT@', '--overrides', nm_settings_docs_overrides, '--output', '@OUTPUT@'],
depends: libnm_gir,
)
endif
......
......@@ -2343,8 +2343,10 @@ def main():
raise AssertionError("Failure to request D-Bus name org.freedesktop.NetworkManager")
# Watch stdin; if it closes, assume our parent has crashed, and exit
id1 = GLib.IOChannel(0).add_watch(GLib.IOCondition.HUP,
lambda io, condition: gl.mainloop.quit() or True)
id1 = GLib.io_add_watch(GLib.IOChannel.unix_new(0),
GLib.PRIORITY_DEFAULT,
GLib.IO_HUP,
lambda io, condition: gl.mainloop.quit() or True)
gl.mainloop.run()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment