mbox

[bug#39729,0/7] Testing the graphical installer

Message ID 20200221231652.27632-1-ludo@gnu.org
Headers show

Message

Ludovic Courtès Feb. 21, 2020, 11:16 p.m. UTC
Hello!

Here’s a test for the graphical installer, as discussed earlier at:

  https://lists.gnu.org/archive/html/guix-devel/2020-01/msg00407.html

The first part of this patch series implements client support in the
installer as discussed above (only more robust to multiple clients,
disconnections, etc.).  A dirty bit there is the
‘close-port-and-reuse-fd’ hack, which works around the fact that Newt
does not provide a ‘form-unwatch-fd’ procedure.  Good enough for now!
There are also two hacks to (1) skip connectivity checks and (2) to
pass ‘--no-grafts’ to ‘guix system init’.

The second part implements the actual test.  The new (gnu installer
tests) module provides tools to implement a dialogue with the installer,
and the new “gui-installed-os” test uses it to perform a bare-bones
style installation.  There’s a commented out variant that does it on
an encrypted root, but it currently fails presumably due to
<https://issues.guix.gnu.org/issue/39712>.

That’s it!

Feedback welcome!

Ludo’.

PS: This patch series is also available as ‘wip-installer-test’.

Ludovic Courtès (7):
  tests: 'run-basic-test' can enter a root password.
  installer: Use a Guile-Newt snapshot that supports 'form-watch-fd'.
  installer: Implement a dialog on /var/guix/installer-socket.
  installer: Bypass connectivity check when /tmp/installer-assume-online
    exists.
  installer: Run commands without hopping through the shell.
  installer: Honor /tmp/installer-system-init-options.
  tests: install: Add "gui-installed-os".

 gnu/installer.scm                |  21 ++
 gnu/installer/final.scm          |  21 +-
 gnu/installer/newt/final.scm     |  40 ++-
 gnu/installer/newt/network.scm   |  10 +-
 gnu/installer/newt/page.scm      | 569 ++++++++++++++++++++-----------
 gnu/installer/newt/partition.scm |   8 +-
 gnu/installer/newt/user.scm      |  64 ++--
 gnu/installer/newt/welcome.scm   |  44 ++-
 gnu/installer/steps.scm          |  25 +-
 gnu/installer/tests.scm          | 340 ++++++++++++++++++
 gnu/installer/utils.scm          | 152 +++++++--
 gnu/local.mk                     |   3 +-
 gnu/tests/base.scm               |  23 +-
 gnu/tests/install.scm            | 200 ++++++++++-
 14 files changed, 1212 insertions(+), 308 deletions(-)
 create mode 100644 gnu/installer/tests.scm

Comments

Mathieu Othacehe Feb. 27, 2020, 4:10 p.m. UTC | #1
Hey!

> The second part implements the actual test.  The new (gnu installer
> tests) module provides tools to implement a dialogue with the installer,
> and the new “gui-installed-os” test uses it to perform a bare-bones
> style installation.  There’s a commented out variant that does it on
> an encrypted root, but it currently fails presumably due to
> <https://issues.guix.gnu.org/issue/39712>.
>
> That’s it!
>
> Feedback welcome!

This serie LGTM, this is really impressive :) About the umounting issue,
you were right. Umounting failed for both %test-gui-installed-os and
%test-gui-installed-os-encrypted.

The issue was that guix-daemon was keeping open files inside the
cow-store, preventing the umount. I discovered then a second issue, some
udevd workers, started while the cow-store was active were also
preventing the umounting.

I published a few patches on top of yours on wip-installer-test to fix
those issues.

Thanks,

Mathieu

PS: I had a hard time debugging the marionette, couldn't find better to
add some syslog, wait an hour to test & repeat. Do you have a better
approach? Would it be possible to have a debug ssh in the marionette?
Ludovic Courtès March 5, 2020, 10:46 p.m. UTC | #2
Hi Mathieu!

Mathieu Othacehe <m.othacehe@gmail.com> skribis:

>> The second part implements the actual test.  The new (gnu installer
>> tests) module provides tools to implement a dialogue with the installer,
>> and the new “gui-installed-os” test uses it to perform a bare-bones
>> style installation.  There’s a commented out variant that does it on
>> an encrypted root, but it currently fails presumably due to
>> <https://issues.guix.gnu.org/issue/39712>.
>>
>> That’s it!
>>
>> Feedback welcome!
>
> This serie LGTM, this is really impressive :) About the umounting issue,
> you were right. Umounting failed for both %test-gui-installed-os and
> %test-gui-installed-os-encrypted.
>
> The issue was that guix-daemon was keeping open files inside the
> cow-store, preventing the umount. I discovered then a second issue, some
> udevd workers, started while the cow-store was active were also
> preventing the umounting.
>
> I published a few patches on top of yours on wip-installer-test to fix
> those issues.

Well done, woohoo!

I’ve pushed the whole series on ‘master’, including your bug fixes.

We can think about writing installer tests for other configurations
now.  That should be the easy part.  :-)

> PS: I had a hard time debugging the marionette, couldn't find better to
> add some syslog, wait an hour to test & repeat. Do you have a better
> approach? Would it be possible to have a debug ssh in the marionette?

I don’t really have a better approach.  If you want to see the output of
‘guix system init’, you can redirect its stderr to /dev/console (wrap
the ‘invoke’ call in ‘with-error-to-file’), and then you get a better
idea of what’s going on.  But that’s about it.

SSH wouldn’t be very helpful because the test process is non-interactive.

Thanks!

Ludo’.