borgbackup / borg

Deduplicating archiver with compression and authenticated encryption.
https://www.borgbackup.org/
Other
11.24k stars 744 forks source link

Fix OpenBSD Vagrant #8554

Closed bket closed 2 days ago

bket commented 2 days ago

Fixes #8506.

8506 is likely caused by the Vagrant box having a mirror in its etc/installurl, which does not offer 7.4 packages. There are other mirrors out there who do, e.g., https://ftp.openbsd.org/pub/OpenBSD/.

codecov[bot] commented 2 days ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 81.79%. Comparing base (ebfd581) to head (33834c4). Report is 4 commits behind head on master.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #8554 +/- ## ======================================= Coverage 81.79% 81.79% ======================================= Files 74 74 Lines 13291 13292 +1 Branches 1957 1957 ======================================= + Hits 10871 10872 +1 Misses 1756 1756 Partials 664 664 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.


🚨 Try these New Features:

ThomasWaldmann commented 2 days ago

Tested it:

==> openbsd7.6: Booting VM...
==> openbsd7.6: Waiting for machine to boot. This may take a few minutes...
    openbsd7.6: SSH address: 127.0.0.1:2222
    openbsd7.6: SSH username: vagrant
    openbsd7.6: SSH auth method: private key
The configured shell (config.ssh.shell) is invalid and unable
to properly execute commands. The most common cause for this is
using a shell that is unavailable on the system. Please verify
you're using the full path to the shell and that the shell is
executable by the SSH user.

Set it to "sh":

diff --git a/Vagrantfile b/Vagrantfile
index 05cf9097..dfcc9ea3 100644
--- a/Vagrantfile
+++ b/Vagrantfile
@@ -430,6 +430,7 @@ Vagrant.configure(2) do |config|
     b.vm.provider :virtualbox do |v|
       v.memory = 1024 + $wmem
     end
+    b.ssh.shell = "sh"
     b.vm.provision "fs init", :type => :shell, :inline => fs_init("vagrant")
     b.vm.provision "packages openbsd", :type => :shell, :inline => packages_openbsd
     b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_sys_venv("openbsd7.6")

Then:

==> openbsd7.6: Running provisioner: packages openbsd (shell)...
    openbsd7.6: Running: inline script
    openbsd7.6: https://cloudflare.cdn.openbsd.org/pub/OpenBSD/7.6/packages-stable/amd64/: TLS handshake failure: handshake failed: error:14004410:SSL routines:CONNECT_CR_SRVR_HELLO:sslv3 alert handshake failure
    openbsd7.6: https://cloudflare.cdn.openbsd.org/pub/OpenBSD/7.6/packages/amd64/: TLS handshake failure: handshake failed: error:14004410:SSL routines:CONNECT_CR_SRVR_HELLO:sslv3 alert handshake failure
    openbsd7.6: https://cloudflare.cdn.openbsd.org/pub/OpenBSD/7.6/packages/amd64/: empty
    openbsd7.6: Can't find bash
bket commented 2 days ago

PR has been updated. Instead of replacing the Vagrant image by a new one, replace the mirror in /etc/installurl by one that offers packages for 7.4.

Updating the Vagrant OpenBSD box to something newer is something for future us :-)

ThomasWaldmann commented 2 days ago

Yay, that made the box working again, borg tests are running...

Noticed that though:

    openbsd7: /vagrant/borg/borg/.tox/py310-none/lib/python3.10/site-packages/urllib3/__init__.py:35:
NotOpenSSLWarning: urllib3 v2 only supports OpenSSL 1.1.1+,
currently the 'ssl' module is compiled with 'LibreSSL 3.8.2'.
See: https://github.com/urllib3/urllib3/issues/3020

Maybe this happened all the time and I just did not notice it before...

Update: crap, that warning makes 31 tests fail. :-(

ThomasWaldmann commented 2 days ago
diff --git a/src/borg/logger.py b/src/borg/logger.py
index 47109292..3e138416 100644
--- a/src/borg/logger.py
+++ b/src/borg/logger.py
@@ -116,6 +116,12 @@ def format(self, record: logging.LogRecord) -> str:
 # use something like this to ignore warnings:
 # warnings.filterwarnings('ignore', r'... regex for warning message to ignore ...')

+ 
+# we do not want that urllib spoils test output with LibreSSL related warnings on OpenBSD.
+# NotOpenSSLWarning: urllib3 v2 only supports OpenSSL 1.1.1+,
+#                    currently the 'ssl' module is compiled with 'LibreSSL 3.8.2'.
+warnings.filterwarnings("ignore", message=r".*urllib3 v2 only supports OpenSSL.*")
+

 def _log_warning(message, category, filename, lineno, file=None, line=None):
     # for warnings, we just want to use the logging system, not stderr or other files
bket commented 2 days ago

I've added the diff to the PR. Is this OK, or would you prefer me to squash the commits?

ThomasWaldmann commented 2 days ago

@bket Thanks, I merged it as is.