Running WLCS against Weston

We’re looking getting a first release of WLCS, the aspirationally-named WayLand Conformance Suite we’re writing as a part of getting Mir’s Wayland support into a fully-featured and properly supported state.

As a part of this, I’m writing the necessary integration shim to run Weston against the WLCS tests to validate that what we’ve got isn’t unreasonably tied to what’s easy to do in Mir.

And we find a bug!

 chris@Behemoth  ~/Canonical/Mir/wlcs/build-ninja   master ●  WESTON_MODULE_MAP="desktop-shell.so=/home/chris/Canonical/Mir/weston/build/desktop-shell/desktop-shell.so;weston-keyboard=/home/chris/Canonical/Mir/weston/build/clients/weston-keyboard;weston-desktop-shell=/home/chris/Canonical/Mir/weston/build/clients/weston-desktop-shell;headless-backend.so=/home/chris/Canonical/Mir/weston/build/libweston/headless-backend.so" ./wlcs ../../weston/build/compositor/wlcs-integration.so --gtest_filter=BadBufferTest.\*
Note: Google Test filter = BadBufferTest.*
[==========] Running 2 tests from 1 test case.
[----------] Global test environment set-up.
[----------] 2 tests from BadBufferTest
[ RUN      ] BadBufferTest.test_truncated_shm_file
Date: 2019-03-08 AEDT
[17:27:01.235] weston 5.0.90
               https://wayland.freedesktop.org
               Bug reports to: https://gitlab.freedesktop.org/wayland/weston/issues/
               Build: 5.0.0-75-gcb2f6e21+
[17:27:01.236] Command line: ./wlcs --backend headless-backend.so
[17:27:01.236] OS: Linux, 4.20.0+bcachefs.git20190130.d1f70147-1-generic, #0 SMP Wed Feb 6 17:29:41 AEDT 2019, x86_64
[17:27:01.236] Starting with no config file.
[17:27:01.236] Output repaint window is 7 ms maximum.
[17:27:01.236] Loading module '/home/chris/Canonical/Mir/weston/build/libweston/headless-backend.so'
[17:27:01.236] Registered plugin API 'weston_windowed_output_api_v1' of size 16
[17:27:01.236] Output 'headless' enabled with head(s) headless
[17:27:01.236] Compositor capabilities:
               arbitrary surface rotation: no
               screen capture uses y-flip: no
               presentation clock: CLOCK_MONOTONIC_RAW, id 4
               presentation clock resolution: 0.000000001 s
[17:27:01.236] Loading module '/home/chris/Canonical/Mir/weston/build/desktop-shell/desktop-shell.so'
[17:27:01.237] launching '/home/chris/Canonical/Mir/weston/build/clients/weston-keyboard'
[17:27:01.238] launching '/home/chris/Canonical/Mir/weston/build/clients/weston-desktop-shell'
[17:27:01.248] libwayland: error in client communication (pid 12315)
wl_buffer@11: error 2: error accessing SHM buffer
[       OK ] BadBufferTest.test_truncated_shm_file (14 ms)
[ RUN      ] BadBufferTest.client_lies_about_buffer_size
[17:27:01.249] weston 5.0.90
               https://wayland.freedesktop.org
               Bug reports to: https://gitlab.freedesktop.org/wayland/weston/issues/
               Build: 5.0.0-75-gcb2f6e21+
[17:27:01.249] Command line: ./wlcs --backend headless-backend.so
[17:27:01.249] OS: Linux, 4.20.0+bcachefs.git20190130.d1f70147-1-generic, #0 SMP Wed Feb 6 17:29:41 AEDT 2019, x86_64
[17:27:01.249] Starting with no config file.
[17:27:01.249] Output repaint window is 7 ms maximum.
[17:27:01.249] Loading module '/home/chris/Canonical/Mir/weston/build/libweston/headless-backend.so'
[17:27:01.249] Registered plugin API 'weston_windowed_output_api_v1' of size 16
[17:27:01.249] Output 'headless' enabled with head(s) headless
[17:27:01.249] Compositor capabilities:
               arbitrary surface rotation: no
               screen capture uses y-flip: no
               presentation clock: CLOCK_MONOTONIC_RAW, id 4
               presentation clock resolution: 0.000000001 s
[17:27:01.250] libwayland: unable to lock lockfile /run/user/1000/wayland-0.lock, maybe another compositor is running
[17:27:01.250] Loading module '/home/chris/Canonical/Mir/weston/build/desktop-shell/desktop-shell.so'
[17:27:01.250] launching '/home/chris/Canonical/Mir/weston/build/clients/weston-keyboard'
[17:27:01.250] launching '/home/chris/Canonical/Mir/weston/build/clients/weston-desktop-shell'
../tests/test_bad_buffer.cpp:150: Failure
Failed
Expected protocol error not raised
[  FAILED  ] BadBufferTest.client_lies_about_buffer_size (36 ms)
[----------] 2 tests from BadBufferTest (50 ms total)

[----------] Global test environment tear-down
[==========] 2 tests from 1 test cases run. (50ms total elapsed)
[  PASSED  ] 1 test
[  FAILED  ] 1 test failed:
[  FAILED  ] BadBufferTest.client_lies_about_buffer_size
ERROR loading icon from file '/usr/local/share/weston/terminal.png', error: 'file not found'                                                                                                                       
ERROR loading icon from file '/usr/local/share/weston/terminal.png', error: 'file not found'

Weston fails to detect when a client submits a buffer with a definitely-incorrect stride.

There are some rather heavy caveats to the current state; most particularly, the reason I’m only showing the output for the BadBufferTest tests is that I’ve not yet hooked up the machinery to send fake pointer events, so currently most of the tests die with a segfault :slight_smile:

Once that’s hooked up (with the other bits of missing functionality, like moving windows to known locations and fake touch events) this will be cleaned up and submitted upstream to Weston. Then we can hopefully have two different compositor projects running and adding tests. Maybe we can even have people who propose protocol extensions add tests to the testsuite in much the same way that they add implementations to weston; sometimes a test can be a more comprehensible way of demonstrating how a protocol should work (edge-cases can be added as they are found, and everyone using the test-suite can behave the same way and ponies and unicorns roam the verdant land).

2 Likes