/mandos/trunk

To get this branch, use:
bzr branch http://bzr.recompile.se/loggerhead/mandos/trunk

« back to all changes in this revision

Viewing changes to mandos-monitor

  • Committer: teddy at recompile
  • Date: 2020-11-29 22:54:26 UTC
  • Revision ID: teddy@recompile.se-20201129225426-6ud4hwj36zo67igi
Fix flaky test in password-agent

The test_send_password_to_socket_EMSGSIZE function should not use a
hard-coded constant to trigger an EMSGSIZE error from send().

* dracut-module/password-agent.c (send_password_to_socket): Only save
  errno from send() if it returned < 0.  Show strerror(errno) if
  send() does return EMSGSIZE.  Show number of bytes sent if send()
  sends less than all bytes.
  (test_send_password_to_socket_EMSGSIZE): Do not skip this test on
  non-AMD64 platforms.  Try to find a suitable message size to trigger
  EMSGSIZE before testing send_password_to_socket(), and only skip
  this test if such a triggering message size is not found.

Reported-By: Simon McVittie <smcv@debian.org>
Closes: #975457

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
#
24
24
# Contact the authors at <mandos@recompile.se>.
25
25
#
 
26
 
26
27
from __future__ import (division, absolute_import, print_function,
27
28
                        unicode_literals)
28
 
 
29
29
try:
30
30
    from future_builtins import *
31
31
except ImportError:
32
32
    pass
33
33
 
34
34
import sys
35
 
import logging
36
35
import os
37
36
import warnings
38
37
import datetime
39
38
import locale
 
39
import logging
40
40
 
41
41
import urwid.curses_display
42
42
import urwid
49
49
if sys.version_info.major == 2:
50
50
    __metaclass__ = type
51
51
    str = unicode
52
 
    input = raw_input
53
 
 
54
 
# Show warnings by default
55
 
if not sys.warnoptions:
56
 
    warnings.simplefilter("default")
57
52
 
58
53
log = logging.getLogger(os.path.basename(sys.argv[0]))
59
54
logging.basicConfig(level="NOTSET", # Show all messages
69
64
domain = "se.recompile"
70
65
server_interface = domain + ".Mandos"
71
66
client_interface = domain + ".Mandos.Client"
72
 
version = "1.8.15"
 
67
version = "1.8.12"
73
68
 
74
69
try:
75
70
    dbus.OBJECT_MANAGER_IFACE