Skip to content

Commit

Permalink
Merge pull request #791 from bareos/dev/joergs/master/freebsd-python-…
Browse files Browse the repository at this point in the history
…bareos

systemtest python-bareos: adapt for FreeBSD
  • Loading branch information
pstorz committed Apr 22, 2021
2 parents 8e7d624 + ee700f7 commit ee04f78
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Expand Up @@ -20,7 +20,7 @@ and since Bareos version 20 this project adheres to [Semantic Versioning](https:
- fixed bug when user could enter wrong dates such as 2000-66-100 55:55:89 without being denied [PR #707]
- fix volume-pruning to be reliable on all test platforms [PR #761]
- fix memory leak in python module constants [PR #778]
- fix systemtests: reduce the number of broken tests to two [PR #771]
- fix systemtests: reduce the number of broken tests [PR #771] [PR #791]
- [Issue #1329]: If CommandACL limits any command, no messages can be read but "you have messages" is displayed. [PR #763]

### Added
Expand Down
4 changes: 2 additions & 2 deletions python-bareos/bareos/bsock/lowlevel.py
Expand Up @@ -600,7 +600,7 @@ def recv_submsg(self, length):
"""
msg = self.recv_bytes(length)
if type(msg) is str:
msg = bytearray(msg.decode("utf-8"), "utf-8")
msg = bytearray(msg.decode("utf-8", 'replace'), "utf-8")
if type(msg) is bytes:
msg = bytearray(msg)
self.logger.debug(str(msg))
Expand Down Expand Up @@ -642,7 +642,7 @@ def _get_input(self):

def _show_result(self, msg):
# print(msg.decode('utf-8'))
sys.stdout.write(msg.decode("utf-8"))
sys.stdout.write(msg.decode("utf-8", 'replace'))
# add a linefeed, if there isn't one already
if len(msg) >= 2:
if msg[-2] != ord(b"\n"):
Expand Down
1 change: 0 additions & 1 deletion systemtests/CMakeLists.txt
Expand Up @@ -631,7 +631,6 @@ set(SYSTEM_TESTS_DISABLED # initially empty
# add tests also here that are unreliable they are excluded when running tests
# during build in jenkins
set(SYSTEM_TESTS_BROKEN
python-bareos # Fails on FreeBSD
py3plug-fd-local-fileset # Fails with UnicodeEncodeError: 'utf-8' codec
# can't encode characters in position 133-142:
# surrogates not allowed
Expand Down
6 changes: 3 additions & 3 deletions systemtests/tests/python-bareos/write.sh
@@ -1,7 +1,7 @@
#!/bin/sh
# BAREOS® - Backup Archiving REcovery Open Sourced
#
# Copyright (C) 2019-2020 Bareos GmbH & Co. KG
# Copyright (C) 2019-2021 Bareos GmbH & Co. KG
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of version three of the GNU Affero General Public
Expand All @@ -22,7 +22,7 @@
file=$1
shift

printf "date=%s\n" "$(LANG=C date)" | tee --append $file
printf "date=%s\n" "$(LANG=C date)" | tee -a $file
for i in "$@"; do
echo "$i" | tee --append $file
echo "$i" | tee -a $file
done

0 comments on commit ee04f78

Please sign in to comment.