Skip to content

Arctic ‐ Recording & Playback setup for Jenkins execution in Xvfb

Andrew Leonard edited this page May 30, 2025 · 21 revisions

To allow aqa-test Jenkins automation of Arctic playback, it is necessary to do a recording in an equivalent Xvfb session. It is essential that the recording and playback environment are identical from perspectives of Xvfb resolution and format, and also System settings like Fonts.

The following guides how to setup a VM environment for performing Arctic recordings that are then compatible to playback within a Jenkins job:

Recording VM setup

  • Required packages:

    • Xvfb
    • x11vnc
    • twm
  • Required System setup:

    • Ensure LC env is POSIX to give same character encodings:
export LC_ALL=POSIX
  • Available "System" Fonts must be identical to the Playback environment. OpenJDK will load the System Physical Fonts for "rendering" which must be identical for Arctic pixel comparison to succeed

    • Typically the JVM loads the System TrueType fonts from /usr/share/fonts/truetype, although also they can be loaded from /usr/share/fonts generally
    • Use this command to compare System fonts installed on record vs playback nodes: fc-list
  • Xvfb process:

    • Choose a suitable X11 display number "NN"
    • Xvfb :<NN> -screen 0 1024x768x24 -nolisten tcp &
  • x11vnc process to expose Xvfb session for recording interaction:

    • x11vnc -storepasswd
      • To store passwd in $HOME/.vnc/passwd
    • x11vnc -xkb -noxrecord -display :<NN> -rfbauth $HOME/.vnc/passwd -rfbport 59<NN> -localhost -forever &
  • TWM must be setup to be compatible for running Arctic workbench and with Fonts available on both Recording & Playback environments:

cp /etc/X11/twm/system.twmrc $HOME/.twmrc
echo 'RightTitleButton "xlogo11" = f.delete' >> $HOME/.twmrc
echo 'Button3 = : root : f.menu "windowops"' >> $HOME/.twmrc
echo 'RandomPlacement'                       >> $HOME/.twmrc

# Ensure fonts match recording vs playback
sed -i 's/MenuFont.*$/MenuFont    "-misc-fixed-bold-r-normal--15-140-75-75-c-90-iso8859-1"/g' $HOME/.twmrc
sed -i 's/TitleFont .*$/TitleFont   "-misc-fixed-bold-r-normal--15-140-75-75-c-90-iso8859-1"/g' $HOME/.twmrc
sed -i 's/IconFont .*$/IconFont    "-misc-fixed-bold-r-normal--15-140-75-75-c-90-iso8859-1"/g' $HOME/.twmrc
sed -i 's/ResizeFont .*$/ResizeFont    "-misc-fixed-bold-r-normal--15-140-75-75-c-90-iso8859-1"/g' $HOME/.twmrc
sed -i 's/IconManagerFont .*$/IconManagerFont    "-misc-fixed-bold-r-normal--15-140-75-75-c-90-iso8859-1"/g' $HOME/.twmrc

# Ensure consistent colors
sed -i 's/BorderColor.*$/BorderColor "slategrey"/g' $HOME/.twmrc
sed -i 's/DefaultBackground.*$/DefaultBackground "rgb:2\/a\/9"/g' $HOME/.twmrc
sed -i 's/DefaultForeground.*$/DefaultForeground "gray85"/g' $HOME/.twmrc
sed -i 's/TitleBackground.*$/TitleBackground "rgb:2\/a\/9"/g' $HOME/.twmrc
sed -i 's/TitleForeground.*$/TitleForeground "gray85"/g' $HOME/.twmrc
sed -i 's/MenuBackground.*$/MenuBackground "rgb:2\/a\/9"/g' $HOME/.twmrc
sed -i 's/MenuForeground.*$/MenuForeground "gray85"/g' $HOME/.twmrc
sed -i 's/MenuBorderColor.*$/MenuBorderColor "slategrey"/g' $HOME/.twmrc
sed -i 's/MenuTitleBackground.*$/MenuTitleBackground "gray70"/g' $HOME/.twmrc
sed -i 's/MenuTitleForeground.*$/MenuTitleForeground "rgb:2\/a\/9"/g' $HOME/.twmrc
sed -i 's/IconBackground.*$/IconBackground "rgb:2\/a\/9"/g' $HOME/.twmrc
sed -i 's/IconForeground.*$/IconForeground "gray85"/g' $HOME/.twmrc
sed -i 's/IconBorderColor.*$/IconBorderColor "gray85"/g' $HOME/.twmrc
sed -i 's/IconManagerBackground.*$/IconManagerBackground "rgb:2\/a\/9"/g' $HOME/.twmrc
sed -i 's/IconManagerForeground.*$/IconManagerForeground "gray85"/g' $HOME/.twmrc
  • Start TWM in Xvfb session:
    • export DISPLAY=:NN
    • twm &

Making an Arctic Recording

  1. Open a VNC viewer against the x11vnc rfbport
  • If the Xvfb/X11vnc server is remote, start a ssh tunnel from your local machine where you are running the VNC viewer, eg:
    • ssh -L 59NN:localhost:59NN user@host
    • Open VNCViewer against localhost:59NN
  1. Try and use the same JDK version used for "recording" and "playback" to avoid any possible Arctic differences by JDK version:
  1. Run an Arctic recording as per guide: https://github.com/adoptium/aqa-tests/wiki/Arctic-Project-Guide#making-an-arctic-recording

Playback via Jenkins automation

  1. Copy Arctic recording to job
  2. Setup job environment (before starting Xvfb session):
  • LC locale
export LC_ALL=POSIX
  • Identical JDK to recording, download same JDK as recording and setup:
export PATH=<JDK>/bin:$PATH
export JAVA_HOME=<JDK>
  • TWM must be same as recording:
cp /etc/X11/twm/system.twmrc $HOME/.twmrc
echo 'RightTitleButton "xlogo11" = f.delete' >> $HOME/.twmrc
echo 'Button3 = : root : f.menu "windowops"' >> $HOME/.twmrc
echo 'RandomPlacement'                       >> $HOME/.twmrc

# Ensure fonts match recording vs playback
sed -i 's/MenuFont.*$/MenuFont    "-misc-fixed-bold-r-normal--15-140-75-75-c-90-iso8859-1"/g' $HOME/.twmrc
sed -i 's/TitleFont .*$/TitleFont   "-misc-fixed-bold-r-normal--15-140-75-75-c-90-iso8859-1"/g' $HOME/.twmrc
sed -i 's/IconFont .*$/IconFont    "-misc-fixed-bold-r-normal--15-140-75-75-c-90-iso8859-1"/g' $HOME/.twmrc
sed -i 's/ResizeFont .*$/ResizeFont    "-misc-fixed-bold-r-normal--15-140-75-75-c-90-iso8859-1"/g' $HOME/.twmrc
sed -i 's/IconManagerFont .*$/IconManagerFont    "-misc-fixed-bold-r-normal--15-140-75-75-c-90-iso8859-1"/g' $HOME/.twmrc

# Ensure consistent colors
sed -i 's/BorderColor.*$/BorderColor "slategrey"/g' $HOME/.twmrc
sed -i 's/DefaultBackground.*$/DefaultBackground "rgb:2\/a\/9"/g' $HOME/.twmrc
sed -i 's/DefaultForeground.*$/DefaultForeground "gray85"/g' $HOME/.twmrc
sed -i 's/TitleBackground.*$/TitleBackground "rgb:2\/a\/9"/g' $HOME/.twmrc
sed -i 's/TitleForeground.*$/TitleForeground "gray85"/g' $HOME/.twmrc
sed -i 's/MenuBackground.*$/MenuBackground "rgb:2\/a\/9"/g' $HOME/.twmrc
sed -i 's/MenuForeground.*$/MenuForeground "gray85"/g' $HOME/.twmrc
sed -i 's/MenuBorderColor.*$/MenuBorderColor "slategrey"/g' $HOME/.twmrc
sed -i 's/MenuTitleBackground.*$/MenuTitleBackground "gray70"/g' $HOME/.twmrc
sed -i 's/MenuTitleForeground.*$/MenuTitleForeground "rgb:2\/a\/9"/g' $HOME/.twmrc
sed -i 's/IconBackground.*$/IconBackground "rgb:2\/a\/9"/g' $HOME/.twmrc
sed -i 's/IconForeground.*$/IconForeground "gray85"/g' $HOME/.twmrc
sed -i 's/IconBorderColor.*$/IconBorderColor "gray85"/g' $HOME/.twmrc
sed -i 's/IconManagerBackground.*$/IconManagerBackground "rgb:2\/a\/9"/g' $HOME/.twmrc
sed -i 's/IconManagerForeground.*$/IconManagerForeground "gray85"/g' $HOME/.twmrc
  1. Start the Xvfb session (aqa-test jobs do this by default resolution 1024x768x24)
  2. Run an automated Arctic playback for the recording as per guide: https://github.com/adoptium/aqa-tests/wiki/Arctic-Project-Guide#automated-arctic-playback
Clone this wiki locally