guix-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#26173: [PATCH 4/4] tests: ssh: Add a test for SFTP.


From: Ludovic Courtès
Subject: bug#26173: [PATCH 4/4] tests: ssh: Add a test for SFTP.
Date: Mon, 20 Mar 2017 21:25:16 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux)

Clément Lassieur <address@hidden> skribis:

> * gnu/tests/ssh.scm (run-ssh-test): Introduce "SFTP file writing and reading".
> Make 'sftp' a keyword parameter.

Woohoo!

Please also mention the change to ‘%test-openssh’.

> +(define* (run-ssh-test name ssh-service pid-file #:key (sftp #f))
>    "Run a test of an OS running SSH-SERVICE, which writes its PID to PID-FILE.
>  SSH-SERVICE must be configured to listen on port 22 and to allow for root and
>  empty-password logins."

Nitpick: call it ‘sftp?’ (with a question mark) to make it clear it’s a
Boolean, and mention it in the docstring.

> +            ;; Connect to the guest over SFTP.  Make sure we can write and
> +            ;; read a file there.
> +            (when #$sftp
> +              (test-equal "SFTP file writing and reading"

You can write it like this:

  (unless #$sftp?
    (test-skip 1))

  (test-equal …)

That way the test will be marked as skipped when SFTP support is
missing, which is marginally nicer.

Thanks for taking the time to write this test!

Ludo’.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]