canonical / canonical/cloud-init

FreeBSD: failing unit tests in tests/unittests/cmd/devel/test_logs.py

Open
#4,463 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Python
Stars
3.8k
Forks
1.1k
Avg merge
2d 23h
Merged PRs (30d)
18

Description

# Bug report

The tests in tests/unittests/cmd/devel/test_logs.py are written with GNU ls in mind.
On FreeBSD they produce the following errors:

```
FAILED tests/unittests/cmd/devel/test_logs.py::TestCollectLogs::test_write_command_output_to_file[cmd1-Unexpected error while running command.\nCommand: ['ls', '/nonexistent-directory']\nExit code: 2\nReason: -\nStdout: \nStderr: ls: cannot access '/nonexistent-directory': No such file or directory-None] - assert "Unexpected error while running command.\nCommand: ['ls', '/nonexistent-directory']\nExit code: 2\nReason: -\nStdout: \nStderr: ls: cannot access '/nonexistent-...
FAILED tests/unittests/cmd/devel/test_logs.py::TestCollectLogs::test_stream_command_output_to_file[cmd1-ls: cannot access '/nonexistent-directory': No such file or directory\n] - assert "ls: cannot access '/nonexistent-directory': No such file or directory\n" == 'ls: /nonexistent-directory: No such file or directory\n'
```

## Steps to reproduce the problem

on FreeBSD, run tests (preferably with a netlink patched python version)

Here's what `ls /nonexistent-directory` actually says on FreeBSD and Alpine (busybox):
```
$ ls /nonexistent-directory
ls: /nonexistent-directory: No such file or directory
$
```
## Environment details
- Cloud-init version: tip of main
- Operating System Distribution: FreeBSD 15.0-CURRENT
- Cloud provider, platform or installer type: -

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.