Skip to content
Snippets Groups Projects

test_with_chroot.sh: do not require superuser privileges

2 unresolved threads

Use mmdebstrap and podman to prevent using superuser privileges. Marking as draft because:

Merge request reports

Members who can merge are allowed to add commits.

Pipeline #2090 failed

Pipeline failed for 86ebc8a3 on josch:vnc

Ready to merge by members who can write to the target branch.
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
    • Maintainer

      @josch So I find your setup pretty awesome, but I'm running into some troubles, some of which I've identified as connected to the above issues. Beyond that, the 'installed manual' run works best, 'installed scripted' seems to be hit-or-miss at "handling line: wait_visible patterns/keyboard_layout.png 10", sometimes the server seems to send back the expected visual pattern and sometimes I run into "Exception: no match for patterns/keyboard_layout.png found within 10 s". Both "build scripted" and "build manual" for me don't get beyond "Exception: no match for patterns/get_started.png found within 30 s".

    • some of which I've identified as connected to the above issues

      Those should be taken care of now. Thank you for your feedback!

      Both "build scripted" and "build manual" for me don't get beyond "Exception: no match for patterns/get_started.png found within 30 s".

      It is not unlikely that the code which searches for bitmaps in the screenshots need to be able to do this search with some adjustable amount of fuzz. Can you try this patch and see if afterwards the "manual" methods still work?

      --- a/test_with_chroot.sh
      +++ b/test_with_chroot.sh
      @@ -108,7 +108,7 @@ case "$AUTOMATIONTYPE" in
              'manual')
                      cat << END | env --chdir=tests python3 minivncdotool.py
       connect 127.0.0.1 5910 30
      -wait_visible patterns/get_started.png 30
      +sleep 30
       END
                      vinagre 127.0.0.1::5910
                      ;;
    • Maintainer

      This indeed gets me a little bit further, to WayVNC starting into a gray screen, and the shell outputting (note I set the script to +x for debugging purposes):

      handling line: sleep 30
      + vinagre 127.0.0.1::5910
      
      (vinagre:545956): dbind-WARNING **: 23:09:08.610: AT-SPI: Error retrieving accessibility bus address: org.freedesktop.DBus.Error.ServiceUnknown: The name org.a11y.Bus was not provided by any .service files
      
      ** (vinagre:545956): WARNING **: 23:09:08.650: Failed to initialize mDNS browser: Failed to create avahi client: Daemon not running
      
      
      (vinagre:545956): Gtk-WARNING **: 23:09:08.683: Theme parsing error: <data>:2:28: The style property GtkButton:default-border is deprecated and shouldn't be used anymore. It will be removed in a future version
      
      (vinagre:545956): Gtk-WARNING **: 23:09:08.683: Theme parsing error: <data>:3:36: The style property GtkButton:default-outside-border is deprecated and shouldn't be used anymore. It will be removed in a future version
      
      (vinagre:545956): Gtk-WARNING **: 23:09:08.683: Theme parsing error: <data>:4:25: The style property GtkButton:inner-border is deprecated and shouldn't be used anymore. It will be removed in a future version
      
      (vinagre:545956): Gtk-WARNING **: 23:09:08.683: Theme parsing error: <data>:5:30: The style property GtkWidget:focus-line-width is deprecated and shouldn't be used anymore. It will be removed in a future version
      
      (vinagre:545956): Gtk-WARNING **: 23:09:08.683: Theme parsing error: <data>:6:27: The style property GtkWidget:focus-padding is deprecated and shouldn't be used anymore. It will be removed in a future version
      
      (vinagre:545956): Gtk-WARNING **: 23:09:08.688: Drawing a gadget with negative dimensions. Did you forget to allocate a size? (node box owner ViewAutoDrawer)

      (the latter warning repeating into infinity)

      (Note that this may possibly all just be the fault of my own exotic system set-ups …)

    • handling line: sleep 30

      Could you copypaste the lines above this one? What is most interesting is the output of sway as it tries starting the reform-setup-wizard.

      (Note that this may possibly all just be the fault of my own exotic system set-ups …)

      One of the main points in this exercise is to make testing the wizard independent of exotic system set-ups by running things inside a light container environment. It of course could still be your setup but lets see. :smile:

    • Maintainer

      All the glory:

      $ ./test_with_chroot.sh build manual
      + set -eu
      + [  = lxc ]
      + [ 2 -ne 2 ]
      + TESTTYPE=build
      + AUTOMATIONTYPE=manual
      + :
      + [ ! -e swayvnc-build.tar ]
      + set -- --customize-hook=mkdir -p "$1"/usr/share/reform-setup-wizard/cleanup.d/ --customize-hook=copy-in cleanup.sh /usr/share/reform-setup-wizard/cleanup.d/ --customize-hook=copy-in reform-setup-sway-config /usr/share/reform-setup-wizard/ --customize-hook=! test -e /usr/bin/reform-setup --customize-hook=upload ./target/debug/reform-setup /usr/bin/reform-setup
      + mmdebstrap --include=python3,python3-gi,sway,wayvnc,socat,dbus-daemon,libglib2.0-bin,libgdk-pixbuf2.0-bin,gsettings-desktop-schemas,gnome-settings-daemon,librsvg2-common,libopengl0,grim,gir1.2-gdkpixbuf-2.0 --customize-hook=copy-in tests/swayvnc.sh / --customize-hook=mkdir -p "$1"/root/.config/wayvnc "$1"/root/.config/dconf --customize-hook=copy-in tests/sway.conf /etc/sway/config.d/ --customize-hook=upload tests/wayvnc.conf /root/.config/wayvnc/config --customize-hook=mkdir -p "$1"/etc/skel/.config/ --customize-hook=touch "$1"/etc/skel/.config/wayfire.ini --customize-hook=openssl req -x509 -newkey rsa:4096 -sha256 -days 3650 -nodes -keyout "$1"/root/key.pem -out "$1"/root/cert.pem -subj /CN=localhost -addext subjectAltName=DNS:localhost,DNS:localhost,IP:127.0.0.1 --customize-hook=mkdir -p "$1"/usr/share/reform-setup-wizard/cleanup.d/ --customize-hook=copy-in cleanup.sh /usr/share/reform-setup-wizard/cleanup.d/ --customize-hook=copy-in reform-setup-sway-config /usr/share/reform-setup-wizard/ --customize-hook=! test -e /usr/bin/reform-setup --customize-hook=upload ./target/debug/reform-setup /usr/bin/reform-setup unstable swayvnc-build.tar
      I: automatically chosen mode: unshare
      I: chroot architecture amd64 is equal to the host's architecture
      I: finding correct signed-by value...
      done
      I: automatically chosen format: tar
      I: using /tmp/mmdebstrap.IoAbdNvzAj as tempdir
      dpkg: warning: failed to open configuration file '/home/plom/.dpkg.cfg' for reading: Permission denied
      I: running apt-get update...
      done
      I: downloading packages with apt...
      done
      I: extracting archives...
      done
      I: installing essential packages...
      done
      I: installing remaining packages inside the chroot...
      done
      done
      done
      done
      I: running special hook: copy-in tests/swayvnc.sh /
      I: running --customize-hook in shell: sh -c 'mkdir -p "$1"/root/.config/wayvnc "$1"/root/.config/dconf' exec /tmp/mmdebstrap.IoAbdNvzAj
      I: running special hook: copy-in tests/sway.conf /etc/sway/config.d/
      I: running special hook: upload tests/wayvnc.conf /root/.config/wayvnc/config
      I: running --customize-hook in shell: sh -c 'mkdir -p "$1"/etc/skel/.config/' exec /tmp/mmdebstrap.IoAbdNvzAj
      I: running --customize-hook in shell: sh -c 'touch "$1"/etc/skel/.config/wayfire.ini' exec /tmp/mmdebstrap.IoAbdNvzAj
      I: running --customize-hook in shell: sh -c 'openssl req -x509 -newkey rsa:4096 -sha256 -days 3650 -nodes -keyout "$1"/root/key.pem -out "$1"/root/cert.pem -subj /CN=localhost -addext subjectAltName=DNS:localhost,DNS:localhost,IP:127.0.0.1' exec /tmp/mmdebstrap.IoAbdNvzAj
      .......+.+..+.......+...+..+....+........................+.....+.+..+...............+.......+.....+.+.....+.+.........+..+....+...........+...+++++++++++++++++++++++++++++++++++++++++++++*.+...+..+..........+........+.........+.......+.....+.+.........+...+++++++++++++++++++++++++++++++++++++++++++++*....+.+...+......+...+..+...+.......+.........+...............+.....+......+...+............+.+....................+...+.......+............+......+..+.............+..+...+....+..+...............+...+.............+..+.......+..................+.....+...+....+.....+......+....+......+.........+.....+.+.........+........+...+............+.............+.....+...+..........+..+.............+.....+....+...+...+...........+.+.................+.....................+.......+.....+..........+.........+........+.+..............+.+.....+.+.....+..................+.+.........+.....................+.................+.......+..+....+......+...+.....+......+....+..+..................+.............+.....+.......+........+.............+...........+......+..........+...+............+..+...............+.+......+...+..+.........+......+....+...........+......+.......+....................+.+..+.........+.+..+............+.............+..+.+........+....+...........+........................+.+..+....+...+...+............+......+......+++++
      ..+.+......+.........+..............+++++++++++++++++++++++++++++++++++++++++++++*.+....+++++++++++++++++++++++++++++++++++++++++++++*.+.........+...+.+.........+....................+.............+...+......+........+.......+...+..+................+...+.....+.......+.........+...+......+.....+.........+...+.......+..+...+...............+......+............+...............+.......+...+...+..+....+.....+...+......+.+..................+......+...........+.........+.+...+.......................+............+.......+...+.....+......+.+...+...+..+.....................+.........+.+..+....+...+..+..........+...+................................+....+.....+..........+..+...+..........+......+.....+...+............+.........+...............+.......+.....+....+........+...+...+....+...+++++
      -----
      I: running --customize-hook in shell: sh -c 'mkdir -p "$1"/usr/share/reform-setup-wizard/cleanup.d/' exec /tmp/mmdebstrap.IoAbdNvzAj
      I: running special hook: copy-in cleanup.sh /usr/share/reform-setup-wizard/cleanup.d/
      I: running special hook: copy-in reform-setup-sway-config /usr/share/reform-setup-wizard/
      I: running --customize-hook in shell: sh -c '! test -e /usr/bin/reform-setup' exec /tmp/mmdebstrap.IoAbdNvzAj
      I: running special hook: upload ./target/debug/reform-setup /usr/bin/reform-setup
      I: cleaning package lists and apt cache...
      done
      done
      I: creating tarball...
      I: done
      I: removing tempdir /tmp/mmdebstrap.IoAbdNvzAj...
      I: success in 173.7620 seconds
      + podman rmi -f swayvnc
      Untagged: localhost/swayvnc:latest
      Deleted: 991bbf90f54b69c689febfd667d8b42e889b914c7db304a1357db54d52877200
      + podman import swayvnc-build.tar swayvnc
      Getting image source signatures
      Copying blob 8426b0869342 done   | 
      Copying config 56211fdb10 done   | 
      Writing manifest to image destination
      sha256:56211fdb1090596a37ad5b061d11b0ac2e30216ad7bf3d3952b8725864b0789b
      + set --
      + grep --quiet /docker/ /proc/self/mountinfo
      + rm -f mycid
      + PODMANPID=561083
      + setpriv --pdeathsig TERM podman run --cidfile=mycid --cap-add SYS_ADMIN --uts=private -p127.0.0.1:5910:5910 -p127.0.0.1:7023:7023 swayvnc /swayvnc.sh
      + cat
      + env --chdir=tests python3 minivncdotool.py
      handling line: connect 127.0.0.1 5910 30
      connected
      + systemd-machine-id-setup
      Initializing machine ID from random generator.
      + dbus-daemon --fork --session --print-address=3 --print-pid=4
      + cat /tmp/dbus-session-bus-address
      + DBUS_SESSION_BUS_ADDRESS=unix:path=/tmp/dbus-Df2UJ27WAg,guid=51186e5690e4716da8d2838a6647cd6d
      + exec env --chdir=/root DBUS_SESSION_BUS_ADDRESS=unix:path=/tmp/dbus-Df2UJ27WAg,guid=51186e5690e4716da8d2838a6647cd6d SWAYSOCK=/tmp/sway-ipc.sock WLR_LIBINPUT_NO_DEVICES=1 WLR_BACKENDS=headless WLR_RENDERER=pixman WLR_RENDERER_ALLOW_SOFTWARE=1 XDG_RUNTIME_DIR=/tmp CHROOT_MODE=1 sway --config /usr/share/reform-setup-wizard/reform-setup-sway-config
      00:00:00.041 [ERROR] [wlr] [xwayland/server.c:454] Cannot find Xwayland binary "/usr/bin/Xwayland"
      00:00:00.041 [ERROR] [sway/server.c:363] Failed to start Xwayland
      Environment variable $DISPLAY not set, ignoring.
      Failed to import environment: Process org.freedesktop.systemd1 exited with status 1
      Environment variable $DISPLAY not set, ignoring.
      Failed to import environment: Process org.freedesktop.systemd1 exited with status 1
      Cannot open display: 
      sh: 1: reform-setup: Permission denied
      2024-05-17 21:34:37 - [main.c:282] Found config * for output HEADLESS-1 ((null))
      2024-05-17 21:34:37 - [background-image.c:30] Failed to load background image (Failed to open file “/usr/share/backgrounds/reform-mountains.jpg”: No such file or directory).
      2024-05-17 21:34:37 - [main.c:610] Failed to load image: /usr/share/backgrounds/reform-mountains.jpg
      2024-05-17 21:34:37 - [background-image.c:30] Failed to load background image (Failed to open file “/usr/share/backgrounds/reform-mountains.jpg”: No such file or directory).
      2024-05-17 21:34:37 - [main.c:610] Failed to load image: /usr/share/backgrounds/reform-mountains.jpg
      cannot read, retrying...
      connected
      received intro
      leaving loop
      handling line: sleep 30
      + vinagre 127.0.0.1::5910
      
      (vinagre:561221): dbind-WARNING **: 23:35:09.841: AT-SPI: Error retrieving accessibility bus address: org.freedesktop.DBus.Error.ServiceUnknown: The name org.a11y.Bus was not provided by any .service files
    • sh: 1: reform-setup: Permission denied

      Can you try this patch:

      --- a/test_with_chroot.sh
      +++ b/test_with_chroot.sh
      @@ -57,7 +57,7 @@ if [ ! -e "swayvnc-$TESTTYPE.tar" ]; then
                                      --customize-hook='copy-in cleanup.sh /usr/share/reform-setup-wizard/cleanup.d/' \
                                      --customize-hook='copy-in reform-setup-sway-config /usr/share/reform-setup-wizard/' \
                                      --customize-hook='! test -e /usr/bin/reform-setup' \
      -                               --customize-hook='upload ./target/debug/reform-setup /usr/bin/reform-setup'
      +                               --customize-hook='copy-in ./target/debug/reform-setup /usr/bin/'
                              ;;
                      *)
                              echo "invalid test-type -- can be either 'build' or 'installed'" >&2
    • Maintainer

      Ok, from the new hook on:

      I: running special hook: copy-in ./target/debug/reform-setup /usr/bin/
      I: cleaning package lists and apt cache...
      done
      done
      I: creating tarball...
      I: done
      I: removing tempdir /tmp/mmdebstrap.Wc_GD_rRP7...
      I: success in 179.1798 seconds
      + podman rmi -f swayvnc
      Untagged: localhost/swayvnc:latest
      Deleted: 56211fdb1090596a37ad5b061d11b0ac2e30216ad7bf3d3952b8725864b0789b
      + podman import swayvnc-build.tar swayvnc
      Getting image source signatures
      Copying blob 9b5e8c3a4c47 done   | 
      Copying config f0d5321027 done   | 
      Writing manifest to image destination
      sha256:f0d53210277cb6765a527e71f90810bb36fe79caddca00c83eccaf707b3290f0
      + set --
      + grep --quiet /docker/ /proc/self/mountinfo
      + rm -f mycid
      + PODMANPID=569973
      + setpriv --pdeathsig TERM podman run --cidfile=mycid --cap-add SYS_ADMIN --uts=private -p127.0.0.1:5910:5910 -p127.0.0.1:7023:7023 swayvnc /swayvnc.sh
      + cat
      + env --chdir=tests python3 minivncdotool.py
      handling line: connect 127.0.0.1 5910 30
      connected
      + systemd-machine-id-setup
      Initializing machine ID from random generator.
      + dbus-daemon --fork --session --print-address=3 --print-pid=4
      + cat /tmp/dbus-session-bus-address
      + DBUS_SESSION_BUS_ADDRESS=unix:path=/tmp/dbus-7bZnFCpoD3,guid=a0a50be1fbc0518030b33fba6647d65a
      + exec env --chdir=/root DBUS_SESSION_BUS_ADDRESS=unix:path=/tmp/dbus-7bZnFCpoD3,guid=a0a50be1fbc0518030b33fba6647d65a SWAYSOCK=/tmp/sway-ipc.sock WLR_LIBINPUT_NO_DEVICES=1 WLR_BACKENDS=headless WLR_RENDERER=pixman WLR_RENDERER_ALLOW_SOFTWARE=1 XDG_RUNTIME_DIR=/tmp CHROOT_MODE=1 sway --config /usr/share/reform-setup-wizard/reform-setup-sway-config
      00:00:00.045 [ERROR] [wlr] [xwayland/server.c:454] Cannot find Xwayland binary "/usr/bin/Xwayland"
      00:00:00.045 [ERROR] [sway/server.c:363] Failed to start Xwayland
      Environment variable $DISPLAY not set, ignoring.
      Failed to import environment: Process org.freedesktop.systemd1 exited with status 1
      Environment variable $DISPLAY not set, ignoring.
      Failed to import environment: Process org.freedesktop.systemd1 exited with status 1
      cannot read, retrying...
      Cannot open display: 
      2024-05-17 22:12:42 - reform-setup: error while loading shared libraries: libadwaita-1.so.0: cannot open shared object file: No such file or directory
      [main.c:282] Found config * for output HEADLESS-1 ((null))
      2024-05-17 22:12:42 - [background-image.c:30] Failed to load background image (Failed to open file “/usr/share/backgrounds/reform-mountains.jpg”: No such file or directory).
      2024-05-17 22:12:42 - [main.c:610] Failed to load image: /usr/share/backgrounds/reform-mountains.jpg
      2024-05-17 22:12:42 - [background-image.c:30] Failed to load background image (Failed to open file “/usr/share/backgrounds/reform-mountains.jpg”: No such file or directory).
      2024-05-17 22:12:42 - [main.c:610] Failed to load image: /usr/share/backgrounds/reform-mountains.jpg
      connected
      received intro
      leaving loop
      handling line: sleep 30
      + vinagre 127.0.0.1::5910
      
      (vinagre:570169): dbind-WARNING **: 00:13:14.260: AT-SPI: Error retrieving accessibility bus address: org.freedesktop.DBus.Error.ServiceUnknown: The name org.a11y.Bus was not provided by any .service files
      
      ** (vinagre:570169): WARNING **: 00:13:14.300: Failed to initialize mDNS browser: Failed to create avahi client: Daemon not running

      (wayvnc still only showing drab grayness)

    • Maintainer

      Notably, the "Permission denied" has been replaced by a failure to load libadwaita-1.so.0 …

    • Yes, because now you are not installing the reform-setup-wizard package so you don't get its dependencies anymore. Try this patch:

      --- a/test_with_chroot.sh
      +++ b/test_with_chroot.sh
      @@ -53,7 +53,8 @@ if [ ! -e "swayvnc-$TESTTYPE.tar" ]; then
       		installed) set -- --include=reform-setup-wizard ;;
       		build)
       			set -- \
      +				--include=libadwaita-1-0,libgdk-pixbuf-2.0-0,libglib2.0-0t64,libgtk-4-1,librsvg2-common \
       				--customize-hook='mkdir -p "$1"/usr/share/reform-setup-wizard/cleanup.d/' \
       				--customize-hook='copy-in cleanup.sh /usr/share/reform-setup-wizard/cleanup.d/' \
       				--customize-hook='copy-in reform-setup-sway-config /usr/share/reform-setup-wizard/' \
       				--customize-hook='! test -e /usr/bin/reform-setup' \
    • Maintainer

      It ("build manual") works! Though the final shell output seems a bit unsatisfied with the cleanup:

      STDERR: rm: cannot remove '/etc/profile.d/reform-setup.sh': No such file or directory
      rm: cannot remove '/etc/systemd/system/getty@tty1.service.d/override.conf': No such file or directory
      System has not been booted with systemd as init system (PID 1). Can't operate.
      Failed to connect to bus: Host is down
      Failed to enable unit: Unit greetd.service does not exist
      System has not been booted with systemd as init system (PID 1). Can't operate.
      Failed to connect to bus: Host is down
      
      Terminated
      ERROR: ../src/main.c: 491: Compositor has gone away. Exiting...
      ^C
    • Yes, but none of the above failures (ignored because the cleanup script does not use set -e) is a regression compared to the current version of test_with_chroot.sh in main because there you just had a plain chroot and thus also no systemd as pid 1 nor did it auto-login with /etc/profile.d/reform-setup.s.

      ^C

      You should not need to ctrl+c. Sway should automatically be killed by cleanup.sh.

      Does "build scripted" work?

    • Maintainer

      Yup, works as well now! Awesome :)

    • Maintainer

      Also, "build manual" now works without the "sleep 30" hack.

    • Maintainer

      I still unpredictably (sometimes yes, sometimes no) run into "Exception: no match for patterns/keyboard_layout.png found within 10 s" with "installed scripted" though, here's the log of one of such cases:

      $ ./test_with_chroot.sh installed scripted
      + set -eu
      + [  = lxc ]
      + [ 2 -ne 2 ]
      + TESTTYPE=installed
      + AUTOMATIONTYPE=scripted
      + :
      + [ ! -e swayvnc-installed.tar ]
      + set -- --include=reform-setup-wizard
      + mmdebstrap --include=python3,python3-gi,sway,wayvnc,socat,dbus-daemon,libglib2.0-bin,libgdk-pixbuf2.0-bin,gsettings-desktop-schemas,gnome-settings-daemon,librsvg2-common,libopengl0,grim,gir1.2-gdkpixbuf-2.0 --customize-hook=copy-in tests/swayvnc.sh / --customize-hook=mkdir -p "$1"/root/.config/wayvnc "$1"/root/.config/dconf --customize-hook=copy-in tests/sway.conf /etc/sway/config.d/ --customize-hook=upload tests/wayvnc.conf /root/.config/wayvnc/config --customize-hook=mkdir -p "$1"/etc/skel/.config/ --customize-hook=touch "$1"/etc/skel/.config/wayfire.ini --customize-hook=openssl req -x509 -newkey rsa:4096 -sha256 -days 3650 -nodes -keyout "$1"/root/key.pem -out "$1"/root/cert.pem -subj /CN=localhost -addext subjectAltName=DNS:localhost,DNS:localhost,IP:127.0.0.1 --include=reform-setup-wizard unstable swayvnc-installed.tar
      I: automatically chosen mode: unshare
      I: chroot architecture amd64 is equal to the host's architecture
      I: finding correct signed-by value...
      done
      I: automatically chosen format: tar
      I: using /tmp/mmdebstrap.kMTkqCwE6Z as tempdir
      dpkg: warning: failed to open configuration file '/home/plom/.dpkg.cfg' for reading: Permission denied
      I: running apt-get update...
      done
      I: downloading packages with apt...
      done
      I: extracting archives...
      done
      I: installing essential packages...
      done
      I: installing remaining packages inside the chroot...
      done
      done
      done
      done
      I: running special hook: copy-in tests/swayvnc.sh /
      I: running --customize-hook in shell: sh -c 'mkdir -p "$1"/root/.config/wayvnc "$1"/root/.config/dconf' exec /tmp/mmdebstrap.kMTkqCwE6Z
      I: running special hook: copy-in tests/sway.conf /etc/sway/config.d/
      I: running special hook: upload tests/wayvnc.conf /root/.config/wayvnc/config
      I: running --customize-hook in shell: sh -c 'mkdir -p "$1"/etc/skel/.config/' exec /tmp/mmdebstrap.kMTkqCwE6Z
      I: running --customize-hook in shell: sh -c 'touch "$1"/etc/skel/.config/wayfire.ini' exec /tmp/mmdebstrap.kMTkqCwE6Z
      I: running --customize-hook in shell: sh -c 'openssl req -x509 -newkey rsa:4096 -sha256 -days 3650 -nodes -keyout "$1"/root/key.pem -out "$1"/root/cert.pem -subj /CN=localhost -addext subjectAltName=DNS:localhost,DNS:localhost,IP:127.0.0.1' exec /tmp/mmdebstrap.kMTkqCwE6Z
      ...+.....+...+............+.+..+..........+..+....+..+...............+.............+..+...+.+...+.....+..........+...........+.........+...+...+.+..............+.+...+..+.+.....+...+.......+..+.+....................+.......+..+.+......+...+.....+.+...............+.....+.+.....+.+.........+...+....................+.+++++++++++++++++++++++++++++++++++++++++++++*..+............+.....+++++++++++++++++++++++++++++++++++++++++++++*.........+.............................+....+...+..+...+.......+..+......+............+.+..+.........+...+.............+.....+.........+.+.....+..........+........+......+...+..........+..+...+.......+...+...+..+.............+..+.............+........+......+......+....+.................................+..+....+..+...+.+...............+...+.......................+...+.+...+........+..........+........+....+........+..................+................+.........+.....+.........+.+......+.....+...+............+....+.........+........+....+.....+..........+........+......+....+..+..................+.............+........+....+..+.+............+..+.+..+...+..................+.......+................................+.+.........+........+..................+....+...............+...............+........+.............+..............+.+.........+..+...+.......+...+......+............+..+.+..+...............+...................+..............+......+.+..+......................+......+............+..+.+.....+..................+.......+..+.+......+..............+.......+..+............+..........+...+......+............+...+......+........+..........+........+...+....+.....+............+....+.....+.+.....+...............+++++
      ......+....+.....+.+..+....+...+++++++++++++++++++++++++++++++++++++++++++++*.+...+.....+...+.+......+..+......+................+...+..+......+....+++++++++++++++++++++++++++++++++++++++++++++*......+..+.........+..........+...+..+...+++++
      -----
      I: cleaning package lists and apt cache...
      done
      done
      I: creating tarball...
      I: done
      I: removing tempdir /tmp/mmdebstrap.kMTkqCwE6Z...
      I: success in 184.0641 seconds
      + podman rmi -f swayvnc
      + podman import swayvnc-installed.tar swayvnc
      Getting image source signatures
      Copying blob fadb36369c3b done   | 
      Copying config 02a0a7233a done   | 
      Writing manifest to image destination
      sha256:02a0a7233ab0f6f53cd4ad9855244684265cbc4a567898af786ff790495e506f
      + set --
      + grep --quiet /docker/ /proc/self/mountinfo
      + rm -f mycid
      + PODMANPID=611367
      + mkdir -p tests/screenshots
      + setpriv --pdeathsig TERM podman run --cidfile=mycid --cap-add SYS_ADMIN --uts=private -p127.0.0.1:5910:5910 -p127.0.0.1:7023:7023 swayvnc /swayvnc.sh
      + env --chdir=tests python3 minivncdotool.py
      handling line: connect 127.0.0.1 5910 60
      connected
      + systemd-machine-id-setup
      Initializing machine ID from random generator.
      + dbus-daemon --fork --session --print-address=3 --print-pid=4
      + cat /tmp/dbus-session-bus-address
      + DBUS_SESSION_BUS_ADDRESS=unix:path=/tmp/dbus-os9VqsDnCo,guid=f7bf9872a376c04684ffb8296647e609
      + exec env --chdir=/root DBUS_SESSION_BUS_ADDRESS=unix:path=/tmp/dbus-os9VqsDnCo,guid=f7bf9872a376c04684ffb8296647e609 SWAYSOCK=/tmp/sway-ipc.sock WLR_LIBINPUT_NO_DEVICES=1 WLR_BACKENDS=headless WLR_RENDERER=pixman WLR_RENDERER_ALLOW_SOFTWARE=1 XDG_RUNTIME_DIR=/tmp CHROOT_MODE=1 sway --config /usr/share/reform-setup-wizard/reform-setup-sway-config
      00:00:00.044 [ERROR] [wlr] [xwayland/server.c:454] Cannot find Xwayland binary "/usr/bin/Xwayland"
      00:00:00.044 [ERROR] [sway/server.c:363] Failed to start Xwayland
      Environment variable $DISPLAY not set, ignoring.
      Failed to import environment: Process org.freedesktop.systemd1 exited with status 1
      Environment variable $DISPLAY not set, ignoring.
      Failed to import environment: Process org.freedesktop.systemd1 exited with status 1
      Cannot open display: 
      2024-05-17 23:19:37 - [main.c:282] Found config * for output HEADLESS-1 ((null))
      2024-05-17 23:19:37 - [background-image.c:30] Failed to load background image (Failed to open file “/usr/share/backgrounds/reform-mountains.jpg”: No such file or directory).
      2024-05-17 23:19:37 - [main.c:610] Failed to load image: /usr/share/backgrounds/reform-mountains.jpg
      cannot read, retrying...
      2024-05-17 23:19:37 - [background-image.c:30] Failed to load background image (Failed to open file “/usr/share/backgrounds/reform-mountains.jpg”: No such file or directory).
      2024-05-17 23:19:37 - [main.c:610] Failed to load image: /usr/share/backgrounds/reform-mountains.jpg
      
      (reform-setup:74): Gtk-WARNING **: 23:19:38.051: Unable to acquire the address of the accessibility bus: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.a11y.Bus was not provided by any .service files. If you are attempting to run GTK without a11y support, GTK_A11Y should be set to 'none'.
      MESA: error: ZINK: vkCreateInstance failed (VK_ERROR_INCOMPATIBLE_DRIVER)
      libEGL warning: egl: failed to create dri2 screen
      connected
      received intro
      leaving loop
      handling line: wait_visible patterns/get_started.png 60
      handling line: mousemove patterns/get_started.png
      found match for patterns/get_started.png at Point(x=1101, y=1010)
      handling line: capture screenshots/00welcome.png
      handling line: click
      handling line: wait_visible patterns/keyboard_layout.png 10
      Traceback (most recent call last):
        File "/home/plom/del/josch/mnt-reform-setup-wizard/tests/minivncdotool.py", line 367, in <module>
          main()
        File "/home/plom/del/josch/mnt-reform-setup-wizard/tests/minivncdotool.py", line 356, in main
          raise Exception(
      Exception: no match for patterns/keyboard_layout.png found within 10 s
    • You can try out two things:

      1. increase the timeout from 10 seconds to 20 seconds
      2. take a screenshot using capture screenshot.png and then have a look at screenshot.png if you can find patterns/keyboard_layout.png in it or not
    • Maintainer

      The timeout increase has no effect, however the screenshot comparison leads to quite a fascinating result: In cases where the whole process fails, the color scheme of the whole layout is black-on-(greyish)-white(-background), but when it succeeds it's white-on-black (which is what the keyboard_layout.png pattern seems to expect). So for some reason the layout color scheme seems to be off sometimes, causing the failure. Hmmmmmm …

    • Perfect! The test already found its first bug. Nice!!

    • FWIW, this bug (white UI, which means GTK's dark mode is not active, but another (default) theme), does not occur in production, only in your testing.

    • Yes, this is absolutely a problem with the test environment and I have to yet figure out its root cause. For example there is different behaviour on riscv64 and s390x. None of these architectures are relevant for the reform, so this is not a problem for MNT but a problem I created for myself to fix.

    • Please register or sign in to reply
    • Maintainer

      Also it would be cool to list what packages are needed for the testing script, e.g. mmdebstrap, podman, rootlesskit, slirp4netns, vinagre …

    • What is "rootlesskit"?

      Also related: do you have a preferred vnc client or is it fine for you to hard-code vinagre?

    • Maintainer

      Hmm, for some reason I wrote down rootlesskit as one of the things I ended up installing to get the script to run, possibly wrongly so. Ignore!

      As for VNC clients, I have no preference.

    • Please register or sign in to reply
  • added 1 commit

    • 86ebc8a3 - test_with_chroot.sh: do not require superuser privileges

    Compare with previous version

  • Please register or sign in to reply
    Loading