"""
Handle osdfailsafe configuration settings (nearfull ratio and full ratio)
"""
-from io import BytesIO
+from io import StringIO
import logging
-import six
import time
from teuthology.orchestra import run
'ceph', '-w'
],
stdin=run.PIPE,
- stdout=BytesIO(),
+ stdout=StringIO(),
wait=False,
)
proc.stdin.close() # causes daemon-helper send SIGKILL to ceph -w
proc.wait()
- lines = six.ensure_str(proc.stdout.getvalue()).split('\n')
+ lines = proc.stdout.getvalue().split('\n')
count = len(filter(lambda line: '[WRN] OSD near full' in line, lines))
assert count == 2, 'Incorrect number of warning messages expected 2 got %d' % count
'ceph', '-w'
],
stdin=run.PIPE,
- stdout=BytesIO(),
+ stdout=StringIO(),
wait=False,
)
proc.stdin.close() # causes daemon-helper send SIGKILL to ceph -w
proc.wait()
- lines = six.ensure_str(proc.stdout.getvalue()).split('\n')
+ lines = proc.stdout.getvalue().split('\n')
count = len(filter(lambda line: '[ERR] OSD full dropping all updates' in line, lines))
assert count == 2, 'Incorrect number of error messages expected 2 got %d' % count
'ceph', '-w'
],
stdin=run.PIPE,
- stdout=BytesIO(),
+ stdout=StringIO(),
wait=False,
)
proc.stdin.close() # causes daemon-helper send SIGKILL to ceph -w
proc.wait()
- lines = six.ensure_str(proc.stdout.getvalue()).split('\n')
+ lines = proc.stdout.getvalue().split('\n')
count = len(filter(lambda line: '[WRN] OSD near full' in line, lines))
assert count == 1 or count == 2, 'Incorrect number of warning messages expected 1 or 2 got %d' % count
'ceph', '-w'
],
stdin=run.PIPE,
- stdout=BytesIO(),
+ stdout=StringIO(),
wait=False,
)
proc.stdin.close() # causes daemon-helper send SIGKILL to ceph -w
proc.wait()
- lines = six.ensure_str(proc.stdout.getvalue()).split('\n')
+ lines = proc.stdout.getvalue().split('\n')
count = len(filter(lambda line: '[WRN] OSD near full' in line, lines))
assert count == 0, 'Incorrect number of warning messages expected 0 got %d' % count
'ceph', '-w'
],
stdin=run.PIPE,
- stdout=BytesIO(),
+ stdout=StringIO(),
wait=False,
)
proc.stdin.close() # causes daemon-helper send SIGKILL to ceph -w
proc.wait()
- lines = six.ensure_str(proc.stdout.getvalue()).split('\n')
+ lines = proc.stdout.getvalue().split('\n')
count = len(filter(lambda line: '[WRN] OSD near full' in line, lines))
assert count == 0, 'Incorrect number of warning messages expected 0 got %d' % count