offlineimap3 dep8 failure with testgsshmail

Bug #2048846 reported by Bryce Harrington
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
offlineimap3 (Ubuntu)
Fix Released
Medium
Unassigned

Bug Description

1121s testsshmail FAIL non-zero exit status 1

noble has a git snapshot of this package from Dec 1st. Debian updated it on Dec 18 to a version with a new DEP8 test, named testsshmail, in version 0.0~git20231218.d29a4dc+dfsg-1. A -2 version was uploaded the next day to "Fix autopkgtest." which switched the script from using init.d to systemd for restarting ssh. This test does not yet pass on Ubuntu, however.

Unfortunately the test is not run with `set -x` so the autopkgtest logs do not indicate where in the script it is failing. However, if I run the test locally I can reproduce the failure, and by adding `-x` I found it is failing on the indicated line:

    echo "Port 22222" >> /etc/ssh/sshd_config
    systemctl restart ssh.service
    ...
    cd /home/${user_login}
    su ${user_login} -c "ssh-keygen -f testkey -N \"\""
    su ${user_login} -c "mkdir -p ~/.ssh"
    su ${user_login} -c "ssh-keyscan -p 22222 localhost > ~/.ssh/known_hosts" # <-- ERROR
    su ${user_login} -c "sshpass -p ${user_pass} ssh-copy-id -p 22222 -i ~/testkey ${user_login}@localhost"
    su ${user_login} -c "offlineimap --info -c offlinerc.test"
    su ${user_login} -c "offlineimap -o -c offlinerc.test"

Logging in as ${user_login} and running ssh-keyscan manually, it works with -p 22 but not -p 22222. In examining the /etc/ssh/sshd_config, I see the following:

    # Port and ListenAddress options are not used when sshd is socket-activated,
    # which is now the default in Ubuntu. See sshd_config(5) and
    # /usr/share/doc/openssh-server/README.Debian.gz for details.
    #Port 22
    ...
    Port 22222

So, appending a Port argument to the ssh config file is invalid in Ubuntu, for the documented reasons. For this reason, the test case may pass on Debian but won't on Ubuntu, since the sshd service won't be accessible on this port.

Revision history for this message
Bryce Harrington (bryce) wrote :

(Note that there are warnings about the python crypt module being deprecated. That is a red herring; all three dep8 tests are set to ignore stderr so don't appear to treat that warning as a failure.)

tags: added: update-excuse
Revision history for this message
Bryce Harrington (bryce) wrote :

These links suggest alternative approaches to make this function properly in Ubuntu:

  https://discourse.ubuntu.com/t/sshd-now-uses-socket-based-activation-ubuntu-22-10-and-later/30189
  https://askubuntu.com/questions/1439461/ssh-default-port-not-changing-ubuntu-22-10

The workarounds should perhaps be conditionalized to only take effect on Ubuntu, and the changes should probably be discussed with Debian in hopes they can be integrated there so that we do not need to carry a delta.

For now, I'm simply going to disable the test in question, since even with the workaround it'll probably require further testing and refinements, and leave the real fix to a future merge.

Revision history for this message
Bryce Harrington (bryce) wrote :

(As a side-note I ran into while debugging this locally, the DEP8 tests each startup dovecot, and then terminate it at the end of the test. However if the test case fails, as testsshmail did in this case, it doesn't hit the termination line and leaves dovecot running. This was causing subsequent test runs to all fail. It may be better to trap the EXIT signal and then perform the teardown.)

Bryce Harrington (bryce)
Changed in offlineimap3 (Ubuntu):
importance: Undecided → Medium
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package offlineimap3 - 0.0~git20231218.d29a4dc+dfsg-3ubuntu1

---------------
offlineimap3 (0.0~git20231218.d29a4dc+dfsg-3ubuntu1) noble; urgency=medium

  * d/t/test*mail: Enable printing of commands as executed
  * d/t/control: Disable testsshmail.
    - This new test case relies on overriding the sshd Port setting,
      but sshd uses socket-based activation in Ubuntu 22.10 and newer.
      (LP: #2048846)

 -- Bryce Harrington <email address hidden> Wed, 10 Jan 2024 02:37:29 +0000

Changed in offlineimap3 (Ubuntu):
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.