Skip to content
Snippets Groups Projects
Commit 801a08d9 authored by Guido Gunther's avatar Guido Gunther :zzz:
Browse files

smoketest: Start and stop phosh

This starts and stops phosh to make sure this still works. Future
additions will be screenshots, asan, valgrind, ...

We're using the CI packages of libhandy and wlroots for that.
parent 7efda693
No related branches found
No related tags found
No related merge requests found
variables:
DEPS: build-essential git libwlroots-examples wget gnome-session
gdb weston
before_script:
- apt-get -y update
- apt-get -y install build-essential git libgirepository1.0-dev valac
# We need libhandy in Debian for that
#- apt-get -y build-dep .
- apt-get -y install libgnome-desktop-3-dev libgtk-3-dev libpam0g-dev libupower-glib-dev libwayland-dev meson xvfb xauth
- export DEBIAN_FRONTEND=noninteractive
- apt-get -y update
- apt-get -y install wget gnupg
- echo "deb http://ci.puri.sm/ scratch librem5" > /etc/apt/sources.list.d/ci.list
- wget -O- https://ci.puri.sm/ci-repo.key | apt-key add -
- apt-get -y update
- apt-get -y build-dep .
- apt-get -y install $DEPS
- ulimit -c unlimited
build-native:
stage: build
.tags: &tags
tags:
- librem5
build:native:
<<: *tags
stage: build
artifacts:
paths:
- _build
script:
- export LC_ALL=C.UTF-8
- git clone --depth=1 https://source.puri.sm/Librem5/libhandy
- cd libhandy
- meson . _build -Dgtk_doc=false -Dtests=false -Dexamples=false -Dglade_catalog=false
- ninja -C _build install
- cd ..
- meson . _build
- ninja -C _build
test:native:
<<: *tags
stage: test
dependencies:
- build:native
script:
- export LC_ALL=C.UTF-8
- xvfb-run ninja -C _build test
test:smoke:one-output:
<<: *tags
stage: test
dependencies:
- build:native
script:
- export G_DEBUG=fatal-criticals
- export WLR_X11_OUTPUTS=1
- tests/smoke
test:smoke:two-outputs:
<<: *tags
stage: test
dependencies:
- build:native
script:
- export G_DEBUG=fatal-criticals
- export WLR_X11_OUTPUTS=2
- tests/smoke
#!/bin/bash
RET=1
set -x
set -e
WORKDIR=$(mktemp -d)
PHOSH_LOG="${WORKDIR}/phosh.log"
WLROOTS_LOG="${WORKDIR}/rootston.log"
ROOTSTON_CONFIG="${WORKDIR}/rootston.ini"
function cleanup () {
[ ! -f core ] || echo bt | gdb -c core _build/src/phosh
[ "${RET}" -eq 0 ] || cat ${WLROOTS_LOG} || true
[ "${RET}" -eq 0 ] || cat ${PHOSH_LOG} || true
[ -z "${XVFB_PID}" ] || kill -9 "${XVFB_PID}" || true
[ -z "${PHOSH_PID}" ] || kill -9 "${PHOSH_PID}" >& /dev/null || true
[ -z "${WORKDIR}" ] || rm -rf "${WORKDIR}"
}
trap cleanup EXIT
cat <<EOF > "${ROOTSTON_CONFIG}"
[output:X11-1]
mode = 768x1024
[output:X11-2]
mode = 1280x800
EOF
XVFB_OPTS="-screen 0 768x1024x24 -ac +extension GLX +render -noreset"
export WLR_BACKENDS=x11
export XDG_RUNTIME_DIR="${WORKDIR}"
xvfb-run -s "${XVFB_OPTS}" -a /usr/lib/wlroots/rootston \
-C "${ROOTSTON_CONFIG}" \
-E "printenv | grep WAYLAND_DISPLAY= > ${WORKDIR}/wl-info" \
>& "${WLROOTS_LOG}" &
XVFB_PID=$!
echo "xvfb PID is $XVFB_PID"
# Wait for startup
WAIT=5
while [ ${WAIT} -gt 0 ]; do
[ ! -f "${WORKDIR}/wl-info" ] || break
sleep 1
((WAIT-=1))
done
. "${WORKDIR}"/wl-info
export WAYLAND_DISPLAY
weston-info
_build/run >& "${PHOSH_LOG}" &
PHOSH_PID=$!
echo "Phosh's PID is $PHOSH_PID"
sleep 1 # give it some time to start
echo -n "Checking if phosh is alive..."
kill -0 $PHOSH_PID
echo "yes."
kill -15 $PHOSH_PID
echo -n "Checking if phosh shutted down..."
sleep 1
! kill -0 $PHOSH_PID >&/dev/null
echo "yes."
if grep "WARNING" "${PHOSH_LOG}"; then
echo "Found error log messages"
cat ${PHOSH_LOG}
# We're having warnings due to missing DBus
# services and gnome-session depending on X11
#exit 1
fi
if grep -E "CRITICAL" "${PHOSH_LOG}"; then
echo "Found error log messages"
cat ${PHOSH_LOG}
exit 1
fi
echo "Started/stopped phosh successfully"
RET=0
exit $RET
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment